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.
Featured Servers
🧠 Kratos (Memory)
Repository: opencode-ecosystem/kratos
Kratos provides long-term persistent memory for your OpenCode agent. Without it, the agent “forgets” details once the session ends. Kratos stores context, user preferences, and project-specific knowledge in a local vector database.
- Use case: “Remember that I use Tabs instead of Spaces for this project.”
- Installation:
opencode mcp install kratos
📚 Archon (Knowledge Base)
Repository: opencode-ecosystem/archon
Archon enables RAG (Retrieval-Augmented Generation) capabilities. You can feed it PDF documents, API documentation, or internal wikis, and it makes that knowledge available to the AI.
- Use case: “How do I use our internal ‘Galaxy’ component library?” (after Indexing documents)
- Installation:
opencode mcp install archon
🎭 Playwright (Browser Automation)
Repository: opencode-ecosystem/playwright-mcp
Gives OpenCode access to a headless browser. It can navigate websites, take screenshots, interact with DOM elements, and run end-to-end tests.
- Use case: “Go to localhost:3000 and verify that the login button works.”
- Installation:
opencode mcp install playwright
🔮 In Memoria (Code Intelligence)
Repository: opencode-ecosystem/in-memoria
A Rust-based background service that analyzes your codebase’s AST (Abstract Syntax Tree). It learns your coding patterns and provides much faster, smarter context to the LLM than standard text search.
- Use case: Deep refactoring across multiple files with high dependency awareness.
How to Develop an MCP Server
OpenCode provides an SDK for Go, TypeScript, and Python to help you build your own MCP servers.
// Example: Creating a simple MCP tool in TypeScript
import { Server } from '@model-context-protocol/sdk';
const server = new Server({
name: "my-weather-tool",
version: "1.0.0"
});
server.defineTool("get_weather", {
city: "string"
}, async ({ city }) => {
return `The weather in ${city} is sunny!`;
});
server.start();
For full documentation, visit the MCP Developer Guide.