Guides

MCP servers

Expose local OpenCode MCP servers to Cursor models through namespaced tools.

open-cursor reads the mcp section from the same opencode.json used by OpenCode. It connects enabled local servers, discovers their tools, and registers each tool under an exact name:

mcp__<server>__<tool>

Hyphens and other punctuation become underscores. A server named hybrid-memory with a tool named memory-search becomes mcp__hybrid_memory__memory_search.

Worked local server

Add the MCP reference server to opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "mcp_everything": {
      "type": "local",
      "command": [
        "npx",
        "-y",
        "@modelcontextprotocol/server-everything"
      ],
      "enabled": true
    }
  }
}

This is the test-server example used in OpenCode's MCP documentation.

Restart OpenCode after changing the server list. Check what the bridge sees:

mcptool servers
mcptool tools mcp_everything

Then ask the model:

Use the mcp_everything add tool to add 3 and 4.

The system message gives the model the full namespaced tool name and input schema. OpenCode executes the resulting tool call.

Manual calls

mcptool uses the same server configuration:

mcptool servers
mcptool tools [server]
mcptool call <server> <tool> '{"key":"value"}'

This is useful for separating a server problem from model tool selection. If a manual call fails, fix the server command or arguments before debugging the model.

Local configuration fields

The bridge reads:

FieldMeaning
typeMust be local.
commandExecutable and arguments as an array.
environmentString environment variables passed to the server.
enabledSet false to skip the server.
timeoutStored from config; individual client operations currently use the MCP SDK behavior.

Current limits

  • The built-in bridge implements local stdio transport. It parses remote entries but does not connect them.
  • Server names and tool names are sanitised for OpenAI-compatible tool names.
  • Duplicate names after sanitising are skipped.
  • A server that fails during startup does not block the plugin. Its tools stay absent.
  • Large MCP servers add every discovered schema to the request. Disable servers you do not need.

Set CURSOR_ACP_MCP_BRIDGE=false to disable bridge discovery. See Configuration.

Permissions

Direct namespaced calls and shell calls do not share the same permission key. Read Permissions before allowing mcptool call * through bash.

On this page