Opencode MCP Protocol Deep Dive

Learn how to extend Opencode with custom tools using the Model Context Protocol.

What is MCP?

MCP (Model Context Protocol) allows you to connect external tools and data sources to Opencode.

Configuration

Add MCP servers to your config:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/files"]
    }
  }
}
  • filesystem - File system access
  • github - GitHub integration
  • postgres - Database queries
  • brave-search - Web search

Next Steps