Skip to content

Configure shared MCP servers - #697

Merged
Eli Pinkerton (wallstop) merged 1 commit into
mainfrom
agent/devcontainer-mcp-zai
Sep 3, 2026
Merged

Configure shared MCP servers#697
Eli Pinkerton (wallstop) merged 1 commit into
mainfrom
agent/devcontainer-mcp-zai

Conversation

@wallstop

@wallstop Eli Pinkerton (wallstop) commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Why: Agent clients lose shared MCP access after rebuilds and fresh clones.

What:

  • Configure GitHub and Z.AI servers for every agent client
  • Restore runtimes and entries during the container lifecycle
  • Keep credentials out of generated files and process arguments

Note

Medium Risk
Changes devcontainer lifecycle, credential resolution, and gitignored MCP client files; mitigated by launchers that fail closed, no secrets in configs, and new contract tests.

Overview
Adds a shared MCP catalog (GitHub’s official Docker server plus Z.AI Vision, Web Search, Web Reader, and Zread) and wires it into every supported agent client through a new configure-shared path in unity-mcp.mjs, with npm run mcp:configure-shared for manual repair. Unity configure now merges the same shared entries alongside unity-mcp-remote instead of only writing the bridge.

Launchers (github-mcp.mjs, zai-mcp.mjs) resolve secrets at runtime (environment → .env.local → GitHub token cache) and refuse unauthenticated starts; tokens go to Docker via env or a mode-0600 header file, not generated MCP configs or argv.

The devcontainer pre-installs @z_ai/mcp-server and mcp-remote, mounts persistent agent state, forwards GITHUB_PERSONAL_ACCESS_TOKEN and Z_AI_API_KEY, runs shared config on create/start (before Unity), and background-pulls the GitHub MCP image. validate-mcp-config accepts shared-only configs when Unity is unavailable.

Reviewed by Cursor Bugbot for commit b5db6de. Bugbot is set up for automated code reviews on this repo. Configure here.

@wallstop
Eli Pinkerton (wallstop) merged commit 113ed47 into main Sep 3, 2026
17 of 25 checks passed
@wallstop
Eli Pinkerton (wallstop) deleted the agent/devcontainer-mcp-zai branch September 3, 2026 20:45

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b5db6de. Configure here.

}
$serverKey = $jsonConfigs[$path]
$servers = $json.$serverKey
$hasSharedServer = $null -ne $servers -and $null -ne $servers.PSObject.Properties['github']

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Validator crashes on missing server collection

Medium Severity

The new shared-only check reads $json.$serverKey outside the existing try while Set-StrictMode -Version Latest is on. A present JSON config that omits mcpServers, servers, or mcp now throws and aborts the validator instead of recording UNH-MCP-INVALID.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b5db6de. Configure here.

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.

1 participant