Skip to content

Remove unsupported cwd from generated .vscode/mcp.json#23144

Merged
dsyme merged 4 commits intomainfrom
copilot/fix-gh-aw-mcp-server-issue
Mar 26, 2026
Merged

Remove unsupported cwd from generated .vscode/mcp.json#23144
dsyme merged 4 commits intomainfrom
copilot/fix-gh-aw-mcp-server-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 26, 2026

Copilot CLI does not support the cwd field in MCP server configuration, causing gh aw mcp-server to fail with spawn gh ENOENT when configured via gh aw init.

Changes

  • pkg/cli/mcp_config_file.go: Removed CWD field from VSCodeMCPServer struct and dropped "cwd": "${workspaceFolder}" from the generated config
  • pkg/cli/mcp_config_file_test.go: Updated tests to match the stripped struct
  • docs/…/gh-aw-as-mcp-server.md: Removed cwd from the manual configuration example

Generated mcp.json now 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.

Copilot AI and others added 2 commits March 26, 2026 16:28
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 cwd from generated .vscode/mcp.json Mar 26, 2026
Copilot AI requested a review from dsyme March 26, 2026 16:37
@dsyme dsyme marked this pull request as ready for review March 26, 2026 17:18
Copilot AI review requested due to automatic review settings March 26, 2026 17:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/cwd field 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 cwd from the manual .vscode/mcp.json example.

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>
@dsyme dsyme merged commit 476d00c into main Mar 26, 2026
55 checks passed
@dsyme dsyme deleted the copilot/fix-gh-aw-mcp-server-issue branch March 26, 2026 18:44
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.

Our instructions on using GH-AW as an MCP server refer to an unsupported construct

3 participants