mcp-installer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

MCP Installer

MCP 安装工具

Find, install, and configure MCP servers for OpenCode.
<workflow>
查找、安装和配置适用于OpenCode的MCP服务器。
<workflow>

1. Search for MCP Server

1. 搜索MCP服务器

Check local catalog first (quick check for already-documented MCPs):
bash
python3 ~/.config/opencode/skill/mcp-installer/scripts/list_mcps.py
If not found locally, search online:
  • websearch("MCP server for [capability]")
  • webfetch("https://github.com/modelcontextprotocol/servers")
  • Check npm:
    @modelcontextprotocol/server-*
  • Check the MCP spec repo: https://github.com/modelcontextprotocol
优先检查本地目录(快速查找已记录的MCP):
bash
python3 ~/.config/opencode/skill/mcp-installer/scripts/list_mcps.py
若本地未找到,在线搜索
  • websearch("适用于[功能]的MCP server")
  • webfetch("https://github.com/modelcontextprotocol/servers")
  • 查看npm:
    @modelcontextprotocol/server-*
  • 查看MCP规范仓库:https://github.com/modelcontextprotocol

2. Read MCP Details

2. 查看MCP详情

For relevant matches, read the full MCP file:
references/mcps/<name>.md
Contains installation config, setup, features, and links.
对于匹配的结果,读取完整的MCP文件:
references/mcps/<name>.md
包含安装配置、设置步骤、功能特性及相关链接。

3. Configure

3. 配置

Add the MCP config to user's
opencode.json
.
将MCP配置添加至用户的
opencode.json
文件中。

4. Document New MCPs

4. 记录新MCP

If you discovered a new MCP server online, you MUST document it for future reference in
references/mcps/<name>.md
using the template below.
若你在线发现了新的MCP服务器,必须将其记录到
references/mcps/<name>.md
文件中,供后续参考,使用下方模板。

5. Setup (if needed)

5. 初始化设置(如有需要)

  • OAuth: Run
    opencode mcp auth <server-name>
  • API keys: Set environment variables
  • Other: Follow MCP-specific setup steps
</workflow>
<question_tool>
Batching: Use the
question
tool for 2+ related questions. Single questions → plain text.
Syntax:
header
≤12 chars,
label
1-5 words, add "(Recommended)" to default.
When to ask: Multiple MCPs match the need, or setup requires OAuth/API keys.
</question_tool>
<configuration>
  • OAuth:运行
    opencode mcp auth <server-name>
  • API密钥:设置环境变量
  • 其他:遵循MCP专属的初始化步骤
</workflow>
<question_tool>
批量处理:若有2个及以上相关问题,使用
question
工具。单个问题直接返回纯文本。
语法
header
不超过12个字符,
label
为1-5个单词,默认选项添加“(推荐)”。
适用场景:多个MCP匹配需求,或初始化设置需要OAuth/API密钥时。
</question_tool>
<configuration>

Local MCP

本地MCP

jsonc
{
  "mcp": {
    "name": {
      "type": "local",
      "command": ["npx", "-y", "@package/name"]
    }
  }
}
jsonc
{
  "mcp": {
    "name": {
      "type": "local",
      "command": ["npx", "-y", "@package/name"]
    }
  }
}

Remote MCP

远程MCP

jsonc
{
  "mcp": {
    "name": {
      "type": "remote",
      "url": "https://example.com/mcp"
    }
  }
}
jsonc
{
  "mcp": {
    "name": {
      "type": "remote",
      "url": "https://example.com/mcp"
    }
  }
}

MCP Tool Management

MCP工具管理

MCPs expose tools. Control via the
permission
section using the tool name (usually the MCP name):
Global/Agent Permission:
jsonc
{
  "permission": {
    "my-mcp": "deny",          // Disable all tools for this MCP
    "my-mcp*": "deny"          // Wildcard support
  }
}
Pattern-based control:
jsonc
{
  "permission": {
    "my-mcp": {
      "safe_tool": "allow",
      "risky_tool": "ask",
      "*": "deny"
    }
  }
}
MCP会暴露工具。可通过
permission
部分,使用工具名称(通常为MCP名称)进行控制:
全局/Agent权限
jsonc
{
  "permission": {
    "my-mcp": "deny",          // 禁用该MCP的所有工具
    "my-mcp*": "deny"          // 支持通配符
  }
}
基于规则的控制
jsonc
{
  "permission": {
    "my-mcp": {
      "safe_tool": "allow",
      "risky_tool": "ask",
      "*": "deny"
    }
  }
}

Legacy Configuration

旧版配置

Agents may occasionally work on legacy projects using outdated configuration fields (e.g.,
tools:
). You MUST correct these to the modern
permission:
system when encountered.
Agents偶尔会处理使用旧版配置字段(如
tools:
)的遗留项目。遇到时必须将其修正为现代的
permission:
系统。

OAuth

OAuth

Remote MCPs with OAuth auto-authenticate:
bash
opencode mcp auth <server-name>
Check status:
opencode mcp list
</configuration>
<reference_files>
You need...Read this file
All config options (local, remote, oauth, env vars)
references/configuration.md
Common MCP server examples
references/examples.md
Troubleshooting issues
references/troubleshooting.md
Note: The local catalog (
list_mcps.py
) is a cache of discovered MCPs, not a complete list. SHOULD always search online if you don't find a match locally.
</reference_files>
<documenting_new_mcps>
When discovering new MCP servers, you MUST document them:
Location:
references/mcps/<name>.md
Template:
markdown
---
name: mcp-name
url: https://github.com/org/repo
type: local|remote
auth: oauth|api-key|none
description: One-line description
tags: [tag1, tag2]
---
支持OAuth的远程MCP可自动认证:
bash
opencode mcp auth <server-name>
检查状态:
opencode mcp list
</configuration>
<reference_files>
需求读取文件
所有配置选项(本地、远程、OAuth、环境变量)
references/configuration.md
常见MCP服务器示例
references/examples.md
问题排查
references/troubleshooting.md
注意:本地目录(
list_mcps.py
)是已发现MCP的缓存,并非完整列表。若本地未找到匹配项,务必在线搜索。
</reference_files>
<documenting_new_mcps>
当发现新的MCP服务器时,必须进行记录:
存储位置
references/mcps/<name>.md
模板
markdown
---
name: mcp-name
url: https://github.com/org/repo
type: local|remote
auth: oauth|api-key|none
description: 一行描述
tags: [tag1, tag2]
---

Display Name

显示名称

Brief description.
简短描述。

Installation

安装

```jsonc { "mcp": { "name": { "type": "remote", "url": "https://example.com/mcp" } } } ```
jsonc
{
  "mcp": {
    "name": {
      "type": "remote",
      "url": "https://example.com/mcp"
    }
  }
}

Setup

初始化设置

Steps for auth, env vars, etc.
认证、环境变量等步骤。

Features

功能特性

  • Feature 1
  • Feature 2
  • 特性1
  • 特性2

Links

链接

  • GitHub

Then run: `python3 scripts/list_mcps.py` to verify.
  • GitHub

然后运行:`python3 scripts/list_mcps.py` 进行验证。

Frontmatter Fields

前置字段说明

FieldRequiredPurpose
name
YesMCP identifier (key in config)
url
NoSource URL
type
Yes
local
or
remote
auth
Yes
oauth
,
api-key
, or
none
description
YesOne-liner for catalog
tags
NoArray of category tags
</documenting_new_mcps>
字段是否必填用途
name
MCP标识符(配置中的键名)
url
源地址
type
local
remote
auth
oauth
api-key
none
description
目录中的一行描述
tags
分类标签数组
</documenting_new_mcps>