anomalyco / anomalyco/opencode

[FEATURE]: Add MCP registration to the V2 plugin context

Open
#39,937 0 comments 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Jul 31, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

V2 plugins can provide skills through ctx.skill.transform and tools through ctx.tool.transform, but they cannot register an MCP server. This prevents one plugin package from distributing both domain skills and the MCP connection those skills depend on.

For example, a Sentry plugin should be able to provide Sentry skills and declare the existing remote server:

await ctx.mcp.transform((servers) => {
  servers.add("sentry", {
    type: "remote",
    url: "https://mcp.sentry.dev/mcp",
  })
})

The exact API is open for design. The important behavior is that an MCP registration is owned by the plugin lifecycle: it is applied when the plugin loads, removed and disconnected when the plugin is disabled or reloaded, composes with other plugins, and allows explicit user configuration to override or disable it. Authentication and connection status should continue through the existing MCP flows.

Without this capability, package authors must either ask users to maintain a separate mcp.servers config entry or reimplement an existing MCP server as native plugin tools. The dynamic MCP HTTP API is also not a substitute for a plugin-owned registration lifecycle.

This is narrower than the marketplace work tracked in #28696. A marketplace could distribute packages, but plugin-provided MCP registration is the runtime primitive needed for a package to bundle skills and an MCP connection cleanly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.