经 AI Skill Hub 精选评估,OpenCode MCP服务器 获评「强烈推荐」。这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.2 分,适合有一定技术背景的用户使用。
OpenCode MCP服务器 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
OpenCode MCP服务器 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/AlaeddineMessadi/opencode-mcp
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"opencode-mcp---": {
"command": "npx",
"args": ["-y", "opencode-mcp"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 OpenCode MCP服务器 执行以下任务... Claude: [自动调用 OpenCode MCP服务器 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"opencode_mcp___": {
"command": "npx",
"args": ["-y", "opencode-mcp"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
Delegate coding work to OpenCode from your MCP client.
opencode-mcp connects Claude, Cursor, VS Code, and other MCP clients to OpenCode's headless API. Ask questions, implement features, monitor background work, respond to questions and permissions, and review changes across projects.
Version 3.0.0 requires Node.js 22 or newer. Upgrading from 2.x? See the migration notes.
Install OpenCode and start its server from your project:
opencode serve --hostname 127.0.0.1 --port 4096
If you use the TUI, start it with opencode --port 4096 and share that server. Set OPENCODE_BASE_URL for another endpoint.
For Claude Code:
claude mcp add opencode -- npx -y opencode-mcp
For clients using an mcpServers configuration:
{
"mcpServers": {
"opencode": {
"command": "npx",
"args": ["-y", "opencode-mcp"]
}
}
}
Restart the client and call opencode_setup. Choose a provider from its configured providers, then use opencode_provider_models to select a model. Set OPENCODE_DEFAULT_PROVIDER and OPENCODE_DEFAULT_MODEL together or pass the selected IDs in each prompt call.
Client-specific configuration includes VS Code, Windsurf, Continue, Zed, and Amazon Q. To test unreleased changes, build from source and configure your client to run node with the absolute path to dist/index.js.
All settings are optional; an OpenCode server must already be running by default.
| Variable | Purpose |
|---|---|
OPENCODE_BASE_URL | Server endpoint; defaults to http://127.0.0.1:4096 |
OPENCODE_SERVER_USERNAME, OPENCODE_SERVER_PASSWORD | Optional server HTTP authentication |
OPENCODE_AUTO_SERVE | Set to true to opt in to launching a local server |
OPENCODE_DEFAULT_PROVIDER, OPENCODE_DEFAULT_MODEL | Default prompt provider/model pair |
OPENCODE_TOOL_PROFILE | full (default) or a smaller essential tool set |
OPENCODE_TASK_STORE | Override the local directory for persisted job records |
See configuration for storage, permissions, and client setup. Auto-start only supports local loopback HTTP endpoints; custom OpenCode CLI flags require a manually started server.
| Need | Tools |
|---|---|
| Setup and orientation | opencode_setup, opencode_context, opencode_provider_models |
| Quick question or follow-up | opencode_ask, opencode_reply |
| Start work and wait | opencode_run |
| Work in the background | opencode_fire, then opencode_check or opencode_wait |
| Recover or control a recorded job | opencode_job_list, opencode_job_get, opencode_job_cancel |
| Resolve required input | opencode_job_input, permission and question tools |
| Review the result | opencode_review_changes, opencode_conversation |
opencode_fire({
directory: "/absolute/path/to/project",
prompt: "Add input validation to POST /api/users and run the relevant tests",
providerID: "<configured-provider>",
modelID: "<available-model>"
})
// Save the returned job and session IDs; use them to monitor or resume observation.
Async results distinguish accepted, running, input_required, completed, failed, cancelled, and unknown. An observation timeout returns current progress; it does not mean the task failed or was cancelled. Follow the returned state and IDs instead of assuming an absent busy status means success.
Modern clients can use the MCP Tasks extension for opencode_run. Clients without that extension use ordinary tools, including opencode_fire and opencode_check. Task status is retrieved by polling; this package does not promise to wake an idle assistant with completion notifications.
Tools retain readable text and provide structured results for clients that consume them. Prompt tools accept optional model variants and OpenCode structured-output formats. See the generated tools reference and examples.
质量工具集,70+工具提供丰富功能,TypeScript编写保证代码质量。MCP标准实现便于集成,适合Claude用户快速扩展能力。维护活跃度良好。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:OpenCode MCP服务器 的核心功能完整,质量优秀。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | opencode-mcp |
| 原始描述 | 开源MCP工具:MCP server for OpenCode AI — 70 tools, 10 resources, 5 prompts. Use npx opencode。⭐41 · TypeScript |
| Topics | MCP服务器Claude插件AI编码工具开源工具集开发者工具 |
| GitHub | https://github.com/AlaeddineMessadi/opencode-mcp |
| License | MIT |
| 语言 | TypeScript |
收录时间:2026-05-20 · 更新时间:2026-05-30 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端