mcp-installer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMCP 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.pyIf 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>.mdContains 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.json4. Document New MCPs
4. 记录新MCP
If you discovered a new MCP server online, you MUST document it for future reference in using the template below.
references/mcps/<name>.md若你在线发现了新的MCP服务器,必须将其记录到文件中,供后续参考,使用下方模板。
references/mcps/<name>.md5. Setup (if needed)
5. 初始化设置(如有需要)
- OAuth: Run
opencode mcp auth <server-name> - API keys: Set environment variables
- Other: Follow MCP-specific setup steps
<question_tool>
Batching: Use the tool for 2+ related questions. Single questions → plain text.
questionSyntax: ≤12 chars, 1-5 words, add "(Recommended)" to default.
headerlabelWhen to ask: Multiple MCPs match the need, or setup requires OAuth/API keys.
</question_tool>
<configuration>- OAuth:运行
opencode mcp auth <server-name> - API密钥:设置环境变量
- 其他:遵循MCP专属的初始化步骤
<question_tool>
批量处理:若有2个及以上相关问题,使用工具。单个问题直接返回纯文本。
question语法:不超过12个字符,为1-5个单词,默认选项添加“(推荐)”。
headerlabel适用场景:多个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 section using the tool name (usually the MCP name):
permissionGlobal/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会暴露工具。可通过部分,使用工具名称(通常为MCP名称)进行控制:
permission全局/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., ). You MUST correct these to the modern system when encountered.
tools:permission:Agents偶尔会处理使用旧版配置字段(如)的遗留项目。遇到时必须将其修正为现代的系统。
tools:permission:OAuth
OAuth
Remote MCPs with OAuth auto-authenticate:
bash
opencode mcp auth <server-name>Check status:
</configuration>
opencode mcp list<reference_files>
| You need... | Read this file |
|---|---|
| All config options (local, remote, oauth, env vars) | |
| Common MCP server examples | |
| Troubleshooting issues | |
Note: The local catalog () is a cache of discovered MCPs, not a complete list. SHOULD always search online if you don't find a match locally.
list_mcps.py</reference_files>
<documenting_new_mcps>
When discovering new MCP servers, you MUST document them:
Location:
references/mcps/<name>.mdTemplate:
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>检查状态:
</configuration>
opencode mcp list<reference_files>
| 需求 | 读取文件 |
|---|---|
| 所有配置选项(本地、远程、OAuth、环境变量) | |
| 常见MCP服务器示例 | |
| 问题排查 | |
注意:本地目录()是已发现MCP的缓存,并非完整列表。若本地未找到匹配项,务必在线搜索。
list_mcps.py</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
前置字段说明
| Field | Required | Purpose |
|---|---|---|
| Yes | MCP identifier (key in config) |
| No | Source URL |
| Yes | |
| Yes | |
| Yes | One-liner for catalog |
| No | Array of category tags |
</documenting_new_mcps>
| 字段 | 是否必填 | 用途 |
|---|---|---|
| 是 | MCP标识符(配置中的键名) |
| 否 | 源地址 |
| 是 | |
| 是 | |
| 是 | 目录中的一行描述 |
| 否 | 分类标签数组 |
</documenting_new_mcps>