Skip to content

Fix GITHUB_TOOLSETS environment variable configuration for Docker containers#1513

Merged
pelikhan merged 3 commits intocopilot/review-mcp-configurationfrom
copilot/fix-toolsets-configuration
Oct 11, 2025
Merged

Fix GITHUB_TOOLSETS environment variable configuration for Docker containers#1513
pelikhan merged 3 commits intocopilot/review-mcp-configurationfrom
copilot/fix-toolsets-configuration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 11, 2025

Problem

The Claude and Codex engines were incorrectly passing the GITHUB_TOOLSETS environment variable to the GitHub MCP server Docker container. They were using -e GITHUB_TOOLSETS (which expects the value from the host environment) and then setting the actual value in a separate env section, rather than passing the value directly in the Docker args as documented.

This meant the toolset configuration wasn't being properly passed to the container, potentially causing the GitHub MCP server to not receive the correct toolset restrictions.

Solution

Updated both Claude and Codex engines to pass GITHUB_TOOLSETS with its value directly in the Docker args, matching the documented pattern:

docker run -i --rm \
  -e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
  -e GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security,experiments" \
  ghcr.io/github/github-mcp-server

Before (Incorrect):

args: [
  "run",
  "-i",
  "--rm",
  "-e",
  "GITHUB_TOOLSETS",  # Name only - expects value from host env
  "ghcr.io/github/github-mcp-server"
]
env: {
  "GITHUB_TOOLSETS": "all"  # Value set separately
}

After (Correct):

args: [
  "run",
  "-i",
  "--rm",
  "-e",
  "GITHUB_TOOLSETS=all",  # Value passed directly in args
  "ghcr.io/github/github-mcp-server"
]
env: {
  # GITHUB_TOOLSETS removed - no longer needed in env section
}

Changes

  • Claude Engine (claude_engine.go): Changed to use -e GITHUB_TOOLSETS=<value> format in docker args and removed GITHUB_TOOLSETS from env section
  • Codex Engine (codex_engine.go): Changed to use -e GITHUB_TOOLSETS=<value> format in docker args and removed GITHUB_TOOLSETS from TOML env section
  • Copilot Engine: Already correct (no changes needed)
  • Tests: Updated test expectations to match new format

Testing

All unit and integration tests pass, including specific toolset configuration tests. Manual verification confirms the correct Docker command format is now generated for all configurations:

  • Default (no toolsets configured): GITHUB_TOOLSETS=all
  • Specific toolsets: GITHUB_TOOLSETS=repos,issues,pull_requests
  • All toolsets explicitly: GITHUB_TOOLSETS=all
Original prompt

Fix the way toolsets=all is configured. It needs to be passed through an environment variable to the github container. Update the current implementation to use the
GITHUB_TOOLSETS env var.

===
Using Toolsets With Docker

When using Docker, you can pass the toolsets as environment variables:

docker run -i --rm
-e GITHUB_PERSONAL_ACCESS_TOKEN=
-e GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security,experiments"
ghcr.io/github/github-mcp-server


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

…gs for all engines

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix toolsets configuration in GitHub container Fix GITHUB_TOOLSETS environment variable configuration for Docker containers Oct 11, 2025
Copilot AI requested a review from pelikhan October 11, 2025 04:09
@pelikhan pelikhan changed the base branch from main to copilot/review-mcp-configuration October 11, 2025 04:25
@pelikhan pelikhan marked this pull request as ready for review October 11, 2025 04:26
@pelikhan pelikhan merged commit b8a5d7e into copilot/review-mcp-configuration Oct 11, 2025
12 checks passed
@pelikhan pelikhan deleted the copilot/fix-toolsets-configuration branch October 11, 2025 04:27
pelikhan added a commit that referenced this pull request Oct 11, 2025
…ormat (#1509)

* Initial plan

* Update Codex remote GitHub MCP configuration to new streamable HTTP format

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* Update Codex remote GitHub MCP configuration to new streamable HTTP format

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* Use readonly API endpoint instead of headers for Codex remote mode

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* Update dev.md to use codex with remote GitHub MCP

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* Update dev.md to trigger on dispatch and write poetry

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* Remove unnecessary GitHub tool configuration from Dev workflow

* Refactor GitHub token usage to standardize on GH_AW_GITHUB_TOKEN across workflows and tests

* Update workflow triggers to include push events for dev.lock.yml

* Fix GITHUB_TOOLSETS environment variable configuration for Docker containers (#1513)

* Initial plan

* Fix GITHUB_TOOLSETS to pass through environment variable in Docker args for all engines

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants