Remove unsupported cwd from generated .vscode/mcp.json#23144
Merged
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/76f2aec7-97d6-44f5-ae59-28f4697d7faf Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
The `cwd` field in `.vscode/mcp.json` is not supported by Copilot CLI and caused `gh aw mcp-server` to fail with a "spawn gh ENOENT" error. - Remove CWD field from VSCodeMCPServer struct - Remove cwd from generated mcp.json config - Update tests to reflect struct change - Remove cwd from documentation example Agent-Logs-Url: https://github.com/github/gh-aw/sessions/76f2aec7-97d6-44f5-ae59-28f4697d7faf Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue with starting GH-AW as MCP server
Remove unsupported Mar 26, 2026
cwd from generated .vscode/mcp.json
dsyme
approved these changes
Mar 26, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the unsupported cwd field from the generated VS Code MCP server configuration so gh aw mcp-server can be launched successfully when configured via gh aw init.
Changes:
- Dropped the
CWD/cwdfield from the VS Code MCP server config struct and generation logic. - Updated CLI unit tests to match the new generated config shape.
- Updated documentation to remove
cwdfrom the manual.vscode/mcp.jsonexample.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/cli/mcp_config_file.go | Stops generating "cwd": "${workspaceFolder}" in .vscode/mcp.json by removing the struct field and initializer usage. |
| pkg/cli/mcp_config_file_test.go | Removes test expectations around CWD in the generated config. |
| docs/src/content/docs/reference/gh-aw-as-mcp-server.md | Updates the VS Code configuration example to omit cwd. |
| .github/workflows/unbloat-docs.lock.yml | Regenerates locked workflow content/heredoc markers and metadata hash. |
| .github/workflows/daily-multi-device-docs-tester.lock.yml | Regenerates locked workflow content/heredoc markers and metadata hash. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copilot CLI does not support the
cwdfield in MCP server configuration, causinggh aw mcp-serverto fail withspawn gh ENOENTwhen configured viagh aw init.Changes
pkg/cli/mcp_config_file.go: RemovedCWDfield fromVSCodeMCPServerstruct and dropped"cwd": "${workspaceFolder}"from the generated configpkg/cli/mcp_config_file_test.go: Updated tests to match the stripped structdocs/…/gh-aw-as-mcp-server.md: Removedcwdfrom the manual configuration exampleGenerated
mcp.jsonnow produces:{ "servers": { "github-agentic-workflows": { "command": "gh", "args": ["aw", "mcp-server"] } } }🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.