Skip to content

feat: load the MCP servers a plugin pack manifest declares - #231

Merged
ibetitsmike merged 16 commits into
mainfrom
mike/plugin-packs-16-manifest-mcp
Nov 12, 2026
Merged

ibetitsmike merged 16 commits into
mainfrom
mike/plugin-packs-16-manifest-mcp

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Xum opened this PR on behalf of @ibetitsmike.

This connects the MCP servers that installed plugin packs declare to the agent's MCP manager (#230), and gates them per chat in coderd.

Agent (agent/agentcontext, agent/)

  • Manifests may declare mcpServers as a path, an inline map, or an array of either. A Claude pack loads its root .mcp.json first, then each declared entry. For any other manifest, a declaration replaces the default .mcp.json, the same way its skills declaration does.
  • Declared paths go through the existing containment checks, so a symlink cannot escape the pack. Bundles (.mcpb, .dxt) and URLs are skipped.
  • A mistyped mcpServers field rejects a Claude pack, the same as its other path fields.
  • Each resolve hands the current pack list to the MCP manager. Resolves that finish out of order are ignored. Nothing is sent during capability negotiation, because that would restart every pack server on each reconnect.
  • A pack server's MCP resource row has SourcePath set to the manifest and Source set to <declaring file>#<server name>. A bare file would not be unique: the database keys rows on (agent, source), and one file can declare several servers. While coderd does not advertise pack rows, the agent drops pack server rows.

coderd (coderd/x/chatd)

  • pinnedWorkspaceMCPTools now runs filterPackResources, so a chat sees a pack's MCP tools only when that pack is enabled for the chat.
  • packRowSourceFile strips the trailing #name from MCP server rows before matching the declaring file against the pack's files.
  • ARCHITECTURE.md gets a TODO for the author only.

Known gaps:

  • Marketplace entry mcpServers, bundles and URLs are not supported.
  • CLAUDE_PLUGIN_DATA and CLAUDE_PROJECT_DIR are not expanded.
  • A $ in the pack path gets mangled by env expansion.
  • Two installed packs can share a server name. The agent keeps the first, and coderd may then drop it if that pack is not enabled for the chat.

Validation on 1d986df, run in a container (7fe84e6, the merge of main after #230, has the same tree):

  • gofmt -l on the changed files passes.
  • go build ./agent/... ./coderd/... ./enterprise/... passes.
  • go vet on ./agent/, ./agent/agentcontext/, ./agent/x/agentmcp/ and ./coderd/x/chatd/ passes.
  • go test ./agent/agentcontext/ ./agent/x/agentmcp/ passes.
  • go test -run 'Plugin|Pack|PinnedWorkspaceMCP' ./coderd/x/chatd/ passes.
  • Negative control: skipping the pack commit marker read makes TestResolverPackMCPSources fail.

@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:54:16.188435Z 7fe84e6 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

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.

@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: c406253eff

ℹ️ 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/mcpcatalog.go Resolved
Comment thread coderd/x/chatd/ARCHITECTURE.md Resolved
Comment thread agent/agentcontext/fork_pack_mcp.go Resolved
Comment thread agent/agentcontext/fork_pack_mcp.go Resolved
Comment thread agent/agentcontext/fork_pack_mcp.go Resolved
Comment thread agent/agentcontext/fork_pack_mcp.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: 2367d95eb1

ℹ️ 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/agentcontext/fork_pack_mcp.go Resolved
Comment thread agent/agentcontext/fork_pack_mcp.go Resolved
Comment thread agent/agentcontext/fork_pack_mcp.go Resolved
Comment thread agent/fork_pack_mcp.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. Keep it up!

Reviewed commit: 75742848f7

ℹ️ 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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 1d986dfc2f

ℹ️ 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".

Base automatically changed from mike/plugin-packs-15-pack-mcp-servers to main November 12, 2026 05:49
@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. Can't wait for the next one!

Reviewed commit: 7fe84e63ff

ℹ️ 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
ibetitsmike merged commit 260675c into main Nov 12, 2026
10 checks passed
@ibetitsmike
ibetitsmike deleted the mike/plugin-packs-16-manifest-mcp branch November 12, 2026 06:17
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum merged this PR on behalf of @ibetitsmike.

Merged after fork-ci passed on head 7fe84e6 (run 43164043188), Codex reviewed that head with no major issues (receipt comment 6815912141), 0 unresolved threads, local Go validation with negative controls, and a live end-to-end UAT on the 7fe84e6 server and agent with the laiso/cman pack: the pack server reached the enabled chat with 9 tools, a tool call succeeded, a chat without the pack saw no tools, and disable and uninstall removed the tools. A disabled or uninstalled pack's server process keeps running until the cleanup follow-up lands. 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