opencode
opencode copied to clipboard
feat(mcp): add MCP server to expose custom tools via stdio
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 servecommand to start stdio MCP server -
opencode mcp serve --listfor dry-run tool listing - Config-driven:
mcpServer.enabledandmcpServer.toolsfor 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