Skip to content

feat: start the MCP servers plugin packs declare - #230

Merged
ibetitsmike merged 7 commits into
mainfrom
mike/plugin-packs-15-pack-mcp-servers
Nov 12, 2026
Merged

ibetitsmike merged 7 commits into
mainfrom
mike/plugin-packs-15-pack-mcp-servers

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Xum opened this PR on behalf of @ibetitsmike.

Plugin packs can declare MCP servers (mcpServers in the manifest, or a root .mcp.json), but the workspace agent only started the servers in the workspace .mcp.json. This PR lets the MCP manager start pack servers too. The follow-up PR tells it which ones to start.

  • Manager.SetPackSources stores the packs' server declarations, in load order. It reloads in the background, and only when the declarations changed.
  • SetPackSources bumps a pack generation, and Reload skips only after it has loaded the current one. So a change that lands during an in-flight reload (agent startup, or a pack update that wakes the config watcher first) still loads.
  • Pack servers start even when the agent has no working directory, where the first reload gets no workspace config paths.
  • Pack servers are parsed after the workspace configs, so the existing first-wins dedup gives the workspace .mcp.json priority on a name collision, and an earlier pack wins over a later one.
  • The files that declare pack servers join the watched paths and the change snapshot, so editing them triggers a reload just like editing .mcp.json.
  • For Claude packs, ${CLAUDE_PLUGIN_ROOT} expands to the pack root in command, args, env, url and headers, and stdio servers get CLAUDE_PLUGIN_ROOT in their environment. This matches Claude Code. Expansion runs before ${VAR} env expansion, which would otherwise turn the placeholder into an empty string.
  • ParseConfig and pack parsing now share parseServerEntries, so both paths run the same validation.
  • Catalog entries record which pack declared a server, so coderd's plugin gate can filter them by chat.

Nothing calls SetPackSources yet.

Until now fork-ci never tested ./agent/x/agentmcp. This PR adds the package to fork-ci's agent test job.

Validation on ccab23a, run in a container: gofmt -l, go build ./agent/..., go vet ./agent/x/agentmcp/ and go test ./agent/x/agentmcp/ pass. Negative controls: dropping the revision from the server origin, or the generation bump in SetPackSources, makes TestSetPackSourcesReloads fail. Gating SetPackSources on config paths again makes TestSetPackSourcesAfterEmptyReload fail, and dropping the pack generation check makes TestReloadAfterStalePackInstall fail.

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum requested this review on behalf of @ibetitsmike.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T05:47:24.801956Z ccab23a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ibetitsmike ibetitsmike changed the title feat(agent/x/agentmcp): start the MCP servers plugin packs declare feat: start the MCP servers plugin packs declare Nov 12, 2026
@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum requested this review on behalf of @ibetitsmike.

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum requested this review on behalf of @ibetitsmike.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dfa81651fd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agent/x/agentmcp/fork_pack_servers.go Resolved
Comment thread agent/x/agentmcp/manager.go Resolved
Comment thread agent/x/agentmcp/fork_pack_servers.go Resolved
Comment thread agent/x/agentmcp/fork_pack_servers.go Resolved
Comment thread agent/x/agentmcp/fork_pack_servers.go Resolved
@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum requested this review on behalf of @ibetitsmike.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 1952b22516

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum requested this review on behalf of @ibetitsmike.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3099286965

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agent/x/agentmcp/fork_pack_servers.go Resolved
@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum requested this review on behalf of @ibetitsmike.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ccab23a930

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agent/x/agentmcp/fork_pack_servers.go Resolved
Comment thread agent/x/agentmcp/manager.go Resolved
@ibetitsmike
ibetitsmike merged commit be4c670 into main Nov 12, 2026
10 checks passed
@ibetitsmike
ibetitsmike deleted the mike/plugin-packs-15-pack-mcp-servers branch November 12, 2026 05:49
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum merged this PR on behalf of @ibetitsmike.

Merged after fork-ci passed on head ccab23a (run 43162634532; the agent-sdk job tested ./agent/x/agentmcp/...), Codex review 5869721408 on that head (P1 4546787252 declined as a hand-edit race outside the normal update path, P2 4546787243 declined), 0 unresolved threads, and local Go validation with negative controls on the revision origin, marker read, snapshot reset, empty-reload gate and pack generation gate. Pack servers start only for packs present in the workspace, behind fork-plugin-packs.

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