Skip to main content
Glama
Dirichelet

Remote OpenCode MCP Server

by Dirichelet

Remote OpenCode MCP

让 AI(如 Claude Desktop、Cursor)能真正动手干活:改代码、跑命令、跑测试。

原理:AI 负责思考和规划,本项目的 bridge 把任务传给本机的 OpenCode 执行,再把结果带回来。

启动

需要先装好 uvOpenCode

uv sync
uv run opencode-mcp

就这一条命令:bridge 启动时会自动拉起 opencode 后端,退出时自动回收。

Related MCP server: opencode-mcp-tool

指定 AI 干活的项目

AI 默认在你启动命令时所在的目录工作。想固定操作某个项目,在 AI 客户端配置里加一个环境变量即可(见下一节):

"env": { "OPENCODE_WORKSPACE": "/absolute/path/to/your-project" }

接入 AI 客户端

bridge 没有界面,需要在 AI 客户端的 MCP 设置里添加一次(以 Claude Desktop 为例):

{
  "mcpServers": {
    "opencode-executor": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/remote-opencode-mcp", "run", "opencode-mcp"],
      "env": { "OPENCODE_WORKSPACE": "/absolute/path/to/your-project" }
    }
  }
}

保存并重启客户端即可。之后正常对话就行,比如对 AI 说"帮我在项目里加个 README",它会自动通过 bridge 调用 OpenCode 完成并汇报结果。

停止

在运行 bridge 的终端按 Ctrl+C

License

MIT

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server implementation that enables connection between OpenAI APIs and MCP clients for coding assistance with features like CLI interaction, web API integration, and tool-based architecture.
    35
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    This is a Model Context Protocol (MCP) server that allows AI assistants to interact with the OpenCode CLI. It enables AI assistants to leverage multiple AI models through a unified interface, with features like plan mode for structured thinking and extensive model selection.
    1
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    An MCP server that lets an AI coding agent delegate implementation work to the OpenCode CLI, choosing an explicit provider + model on every call.
    3
    MIT