MCP Servers
MCP (Model Context Protocol) is the open standard that powers OpenCode’s extensibility. It allows the AI agent to interact with external tools, data sources, and environments in a standardized way.
Think of MCP Servers as “skills” or “drivers” that you can install to give your AI new superpowers. OpenCode supports any MCP-compatible server.
Featured MCP Servers
With Context MCP
Repository: boxpositron/with-context-mcp
Manages project-specific markdown notes with templates, batch edits, and ignore patterns. Perfect for maintaining structured project documentation that your agent can reference.
- Use case: “Remember the API design decisions we made for v2” — persist and retrieve project context
- Install: Add to your
opencode.jsonMCP servers configuration
Xquik — X/Twitter Data
Repository: Xquik-dev/x-twitter-scraper
X/Twitter data extraction skill with MCP server, REST API, and 20 extraction tools. Works with Claude Code, Cursor, Codex, and 40+ agents.
- Use case: “Find the latest discussions about React Server Components on Twitter”
- Install: Add to your MCP servers with your API credentials
MCP Voice Interface
Repository: shantur/mcp-voice-interface
Talk to AI assistants using your voice through a web browser. Compatible with Claude Desktop and OpenCode.
- Use case: Hands-free coding — dictate instructions while your hands are on the keyboard
- Install: Run the web server and connect via MCP
Opencode Browser
Repository: different-ai/opencode-browser
Browser automation plugin for OpenCode. Navigate websites, interact with DOM elements, and extract content.
- Use case: “Go to localhost:3000 and verify the login button works”
- Install: GitHub
Popular MCP Integrations
Many OpenCode plugins use MCP under the hood. Here are some categories:
| Category | Examples | Description |
|---|---|---|
| Web Search | Exa, Google AI Search | Search the web for real-time information |
| Documentation | Context7 | Fetch official library documentation into context |
| Code Search | Grep.app | Search across public GitHub repositories |
| Browser | Playwright MCP, Opencode Browser | Automate browser interactions and testing |
| Memory | Opencode Mem, With Context | Persistent memory and project context storage |
Built-in MCPs in Oh My OpenAgent
If you use Oh My OpenAgent, three MCP servers are always on:
| MCP | Based On | Purpose |
|---|---|---|
websearch | Exa | Web search for code, docs, solutions |
context7 | Context7 | Official documentation lookup |
grep_app | Grep.app | GitHub code search across public repositories |
No configuration needed — they work out of the box.
Configuring MCP Servers
Add MCP servers to your opencode.json:
{
"mcpServers": {
"my-server": {
"command": "npx",
"args": ["-y", "@my-org/mcp-server"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
For Oh My OpenAgent users, MCP servers can also be configured in oh-my-openagent.json.
Developing Your Own MCP Server
OpenCode provides SDKs for building custom MCP servers:
TypeScript
import { Server } from '@model-context-protocol/sdk';
const server = new Server({
name: "my-tool",
version: "1.0.0"
});
server.defineTool("get_data", {
query: "string"
}, async ({ query }) => {
return `Results for: ${query}`;
});
server.start();
Go
import "github.com/anomalyco/opencode-sdk-go/mcp"
server := mcp.NewServer("my-tool", "1.0.0")
server.Tool("get_data", "Fetch data", func(args map[string]interface{}) string {
return "Results"
})
server.Start()
Python
from opencode_sdk import MCPServer
server = MCPServer("my-tool", "1.0.0")
@server.tool("get_data")
def get_data(query: str) -> str:
return f"Results for: {query}"
server.start()
For full documentation, visit the MCP Developer Guide.
More Resources
- Awesome OpenCode — Browse all plugins and MCP servers
- Oh My OpenAgent — Agent harness with built-in MCP servers
- Official MCP Spec — Protocol specification and documentation