OpenCode配置MCP
操作步骤
- 配置MCP服务信息。
- 根据需求,创建项目级MCP或全局MCP。
- 项目级MCP:在当前项目目录下,创建“.opencode/opencode.json”并打开,将MCP信息写入并保持。根据实际情况填写DevKit AI的MCP服务器的URL(即5配置的IP地址和端口)。
- 全局MCP:创建“/root/.config/opencode/opencode.json”文件,将MCP信息写入并保持。根据实际情况填写DevKit AI的MCP服务器的URL(即5配置的IP地址和端口)。

{ "$schema": "https://opencode.ai/config.json", "mcp": { "devkitai-mcp": { "type": "remote", "url": "http://xx.xx.xx.xx:xxxx/mcp", } } } -
opencode mcp auth

- 在OpenCode中已存在添加的MCP服务。
- 根据需求,创建项目级MCP或全局MCP。
父主题: 配置MCP服务
