Skip to content

MCP Servers

Model Context Protocol (MCP)

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.

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.json MCP 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

Many OpenCode plugins use MCP under the hood. Here are some categories:

CategoryExamplesDescription
Web SearchExa, Google AI SearchSearch the web for real-time information
DocumentationContext7Fetch official library documentation into context
Code SearchGrep.appSearch across public GitHub repositories
BrowserPlaywright MCP, Opencode BrowserAutomate browser interactions and testing
MemoryOpencode Mem, With ContextPersistent memory and project context storage

Built-in MCPs in Oh My OpenAgent

If you use Oh My OpenAgent, three MCP servers are always on:

MCPBased OnPurpose
websearchExaWeb search for code, docs, solutions
context7Context7Official documentation lookup
grep_appGrep.appGitHub 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