Skip to content

Commit 69cb23c

Browse files
CopilotMossaka
andauthored
docs: update AGENTS.md for stdio-based MCP configuration (#221)
* Initial plan * docs: add breaking changes section for v0.9.1 Docker-in-Docker removal Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> * docs: remove breaking changes section from README per feedback Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
1 parent 2790262 commit 69cb23c

1 file changed

Lines changed: 30 additions & 24 deletions

File tree

AGENTS.md

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -436,24 +436,30 @@ To use a local, writable GitHub MCP server with Copilot CLI, you must:
436436

437437
The agent container mounts the HOME directory, so this config file is automatically accessible to GitHub Copilot CLI running inside the container.
438438

439-
**Format:**
439+
**Format (stdio-based with npx):**
440440
```json
441441
{
442442
"mcpServers": {
443443
"github": {
444-
"type": "local",
445-
"command": "docker",
446-
"args": [
447-
"run",
448-
"-i",
449-
"--rm",
450-
"-e",
451-
"GITHUB_PERSONAL_ACCESS_TOKEN",
452-
"-e",
453-
"GITHUB_TOOLSETS=default",
454-
"ghcr.io/github/github-mcp-server:v0.19.0"
455-
],
456-
"tools": ["*"],
444+
"type": "stdio",
445+
"command": "npx",
446+
"args": ["-y", "github-mcp-custom@1.0.20", "stdio"],
447+
"env": {
448+
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}"
449+
}
450+
}
451+
}
452+
}
453+
```
454+
455+
**Alternative (using Go binary):**
456+
```json
457+
{
458+
"mcpServers": {
459+
"github": {
460+
"type": "stdio",
461+
"command": "/usr/local/bin/github-mcp-server",
462+
"args": ["stdio"],
457463
"env": {
458464
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}"
459465
}
@@ -463,13 +469,13 @@ The agent container mounts the HOME directory, so this config file is automatica
463469
```
464470

465471
**Key Requirements:**
466-
-**`"tools": ["*"]`** - Required field. Use `["*"]` to enable all tools, or list specific tool names
467-
- ⚠️ Empty array `[]` means NO tools will be available
468-
-**`"type": "local"`** - Required to specify local MCP server type
472+
-**`"type": "stdio"`** - Uses stdio transport (not Docker)
469473
-**`"env"` section** - Environment variables must be declared here with `${VAR}` syntax for interpolation
470-
-**Environment variable in args** - Use bare variable names in `-e` flags (e.g., `"GITHUB_PERSONAL_ACCESS_TOKEN"` without `$`)
471474
-**Shell environment** - Variables must be exported in the shell before running awf
472475
-**MCP server name** - Use `"github"` as the server name (must match `--allow-tool` flag)
476+
-**npx availability** - The agent container includes Node.js 22 with npx pre-installed
477+
478+
**Note:** As of v0.9.1, Docker-in-Docker support was removed ([PR #205](https://github.com/githubnext/gh-aw-firewall/pull/205)). Use stdio-based MCP servers instead of Docker-based ones.
473479

474480
### Running Copilot CLI with Local MCP Through Firewall
475481

@@ -498,17 +504,17 @@ sudo -E awf \
498504
1. `awf` needs sudo for iptables manipulation
499505
2. `-E` preserves GITHUB_TOKEN and GITHUB_PERSONAL_ACCESS_TOKEN
500506
3. These variables are passed into the agent container via the HOME directory mount
501-
4. The GitHub MCP server Docker container inherits them from the agent container's environment
507+
4. The stdio-based MCP server (running via npx) inherits them from the agent container's environment
502508

503509
### Troubleshooting
504510

505511
**Problem:** MCP server starts but says "GITHUB_PERSONAL_ACCESS_TOKEN not set"
506-
- **Cause:** Environment variable not passed correctly through sudo or to Docker container
512+
- **Cause:** Environment variable not passed correctly through sudo
507513
- **Solution:** Use `sudo -E` when running awf, and ensure the variable is exported before running the command
508514

509515
**Problem:** MCP config validation error: "Invalid input"
510-
- **Cause:** Missing `"tools"` field
511-
- **Solution:** Add `"tools": ["*"]` to the MCP server config
516+
- **Cause:** Invalid configuration format or missing required fields
517+
- **Solution:** Ensure `"type": "stdio"` and `"env"` section are properly configured
512518

513519
**Problem:** Copilot uses read-only remote MCP instead of local
514520
- **Cause:** Built-in MCP not disabled
@@ -528,7 +534,7 @@ Check GitHub Copilot CLI logs (use `--log-level debug`) for these indicators:
528534

529535
**Local MCP working:**
530536
```
531-
Starting MCP client for github with command: docker
537+
Starting MCP client for github with command: npx
532538
GitHub MCP Server running on stdio
533539
readOnly=false
534540
MCP client for github connected
@@ -545,7 +551,7 @@ Starting remote MCP client for github-mcp-server
545551
For GitHub Actions workflows:
546552
1. Create MCP config script that writes to `~/.copilot/mcp-config.json` (note: `~` = `/home/runner` in GitHub Actions)
547553
2. Export both `GITHUB_TOKEN` (for GitHub Copilot CLI) and `GITHUB_PERSONAL_ACCESS_TOKEN` (for GitHub MCP server) as environment variables
548-
3. Pull the MCP server Docker image before running tests: `docker pull ghcr.io/github/github-mcp-server:v0.19.0`
554+
3. Use stdio-based MCP configuration (npx or Go binary) - Docker-based MCP servers are no longer supported as of v0.9.1
549555
4. Run awf with `sudo -E` to preserve environment variables
550556
5. Always use `--disable-builtin-mcps` and `--allow-tool github` flags when running GitHub Copilot CLI
551557

0 commit comments

Comments
 (0)