[PR #6452] feat(mcp): add MCP server to expose custom tools via stdio #11910

Open
opened 2026-02-16 18:16:51 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6452

State: open
Merged: No


Add ability to run OpenCode as an MCP server, allowing external MCP clients to access custom tools defined in .opencode/tool/ and plugins.

Features:

  • opencode mcp serve command to start stdio MCP server
  • opencode mcp serve --list for dry-run tool listing
  • Config-driven: mcpServer.enabled and mcpServer.tools for filtering
  • Wildcard patterns for allowlist/blocklist tool filtering
  • Only custom tools exposed (built-ins excluded for security)

Config example:

{
  "mcpServer": {
    "enabled": true,
    "tools": { "*": false, "my-tool": true }
  }
}

Relates to: #3306 #1507 #296

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6452 **State:** open **Merged:** No --- Add ability to run OpenCode as an MCP server, allowing external MCP clients to access custom tools defined in `.opencode/tool/` and plugins. Features: - `opencode mcp serve` command to start stdio MCP server - `opencode mcp serve --list` for dry-run tool listing - Config-driven: `mcpServer.enabled` and `mcpServer.tools` for filtering - Wildcard patterns for allowlist/blocklist tool filtering - Only custom tools exposed (built-ins excluded for security) Config example: ```json { "mcpServer": { "enabled": true, "tools": { "*": false, "my-tool": true } } } ``` Relates to: #3306 #1507 #296
yindo added the pull-request label 2026-02-16 18:16:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11910