使用说明
mcp线
mcp-wire是一个Go CLI,它通过一个界面跨多个AI编码工具安装和配置mcp(模型上下文协议)服务器。
运作原理
无需手动编辑配置。跑 mcp-wire 使用指导安装和卸载向导打开全屏TUI。
视觉漫游
查看运行中的TUI(从具有隔离目标配置的实际运行中记录):
| 安装流 | 卸载流 |
|---|---|
有关每个屏幕的分步分解,请参阅 docs/tui-walkthrough.md.
选择来源
从捆绑的策划服务或社区MCP注册表中选择:
mcp-wire — Install
Install › Source
Where should mcp-wire look for services?
› Curated services recommended, maintained by mcp-wire
Registry services community-published MCP servers
Both curated + registry combined
↑↓ move Enter select Esc back
搜索并选择服务
在数百个注册表项中进行实时筛选搜索:
mcp-wire — Install
Install › community ✓ › Service › Targets › Review › Apply
Search: sentry 2 matches
› ai.sentry/sentry-mcp
Sentry error tracking and performance monitoring MCP server
registry · http · remote · API key
ai.example/sentry-alerts
Forward Sentry alerts to your AI coding assistant
registry · sse · remote · none
— end of results —
↑↓ move Enter select type to filter Esc back
安装前检查
注册表服务显示元数据并需要明确确认:
mcp-wire — Install
Install › community ✓ › Service › Targets › Review › Apply
△ Registry Service — not curated by mcp-wire
ai.sentry/sentry-mcp
Sentry error tracking and performance monitoring MCP server
Source: community registry
Transport: http
URL: https://mcp.sentry.io/sse
Registry services are community-published. Review before proceeding.
› Yes, proceed No, go back
←→ move Enter confirm Esc back
显式CLI模式
对于脚本和CI,显式命令在没有TUI的情况下工作:
mcp-wire install jira --target claude --no-prompt
mcp-wire uninstall sentry --target opencode
诊断
跑 mcp-wire doctor 用于只读诊断报告。它列出了每个支持的目标,是否在此系统上检测到它,它将写入的配置路径以及该文件是否存在,当前功能标志状态,以及mcp-wire用于其自己的配置、凭据、用户本地服务和注册表缓存的路径。它还打印丢失目标和禁用功能的提示。该命令从不写入任何配置或凭据文件。
mcp-wire doctor
机器可读元数据(用于代理和自动化)
跑 mcp-wire metadata 打印一个稳定的JSON文档,描述mcp-wire可以做什么。它适用于需要在不驱动交互式TUI的情况下检查功能的AI代理和脚本:
mcp-wire metadata
该文档包括支持的传输和安装范围、每个目标(包括安装状态、配置路径、支持的范围以及是否可以自动完成OAuth)、所选源中的每个服务(包括传输、身份验证要求和所需的环境变量)以及当前功能标志状态。默认情况下,只列出经过策划的服务;通过 --source registry 或 --source all 包括社区注册表服务(这需要启用注册表功能)。
顶级 schema_version 字段标识文档结构,仅在发生中断更改时递增,因此自动化可以固定到已知的形状。这 auth 每个服务上的字段是 oauth, api_key,或 none.
{
"schema_version": 1,
"mcp_wire_version": "0.2.2",
"transports": ["http", "sse", "stdio"],
"scopes": ["user", "project"],
"targets": [
{
"name": "Claude Code",
"slug": "claude",
"installed": true,
"config_path": "/home/you/.claude.json",
"scopes": ["user", "project", "effective"],
"supports_oauth": false
}
],
"services": [
{
"name": "sentry",
"description": "Sentry MCP server (OAuth)",
"source": "curated",
"transport": "http",
"auth": "oauth",
"install_method": "remote",
"env": []
}
],
"features": [
{ "name": "registry", "enabled": false, "description": "Official MCP Registry integration" }
]
}
常见问题 jq:
# List the slugs of every installed target
mcp-wire metadata | jq -r '.targets[] | select(.installed) | .slug'
# List curated services that require no credentials
mcp-wire metadata | jq -r '.services[] | select(.auth == "none") | .name'
# Show the required environment variables for a specific service
mcp-wire metadata | jq '.services[] | select(.name == "linear") | .env'
喜欢 doctor,此命令是只读的:它从不写入任何配置或凭据文件。
范围感知安装(Claude代码)
对于支持作用域的目标(目前是Claude Code),您可以选择编写MCP配置的位置:
user(默认):跨项目可用project:仅适用于当前项目
mcp-wire install jira --target claude --scope user
mcp-wire install jira --target claude --scope project
mcp-wire uninstall jira --target claude --scope project
支持的目标
claude-克劳德代码codex-Codex CLIopencode-OpenCode
支持服务列表
捆绑(策划)
这些附带二进制文件,开箱即用:
context7-Context7文档查找MCP(OAuth)github-GitHub MCP服务器(OAuth)jira-Atlassian Rovo MCP服务器(OAuth)linear-线性MCP服务器(OAuth)notion-Notion MCP服务器(OAuth)sentry-哨兵MCP服务器(OAuth)playwright-Playwright浏览器自动化MCP(npx @playwright/mcp@latest)
MCP注册中心(社区)
mcp线也可以从以下位置安装 MCP官方登记处,允许访问数百个社区发布的MCP服务器。启用:
mcp-wire feature enable registry
启用后,安装向导将提供一个源选择步骤(Curated/Registry/Both),对所有注册表项进行实时搜索。
凭据存储
当您在安装过程中接受“保存到凭据存储?”提示时,mcp-wire会将凭据写入:
~/.config/mcp-wire/credentials
该文件是一个普通文件 KEY=value 列表中,每行一个凭证。它是用mode创建的 0600 (仅限所有者读/写)在使用模式创建的目录内 0700.mcp-wire在每次写入时重新应用这些权限,包括之前创建具有更广泛权限的现有目录时。
在安装时,凭据按以下顺序解析,第一场比赛获胜:
- 过程环境变量。
- 上面的本地凭据文件。
- 交互式提示(在以下情况下跳过
--no-prompt已设置)。
有几件事值得了解:
- 值以明文形式存储。mcp-wire不会加密它们或与系统密钥链集成。
- 相同的值被写入每个目标工具的MCP配置中(例如。
~/.claude.json,~/.codex/config.toml),因此目标配置文件也是使用mode创建的0600. - 交互式提示屏蔽了TUI(密码样式回显)和普通CLI中的键入输入(
term.ReadPassword).mcp-wire从不将存储的凭据值回显到屏幕、日志或错误消息中。 - 要删除服务的存储凭据,请使用卸载流程,在“删除存储的凭据?”提示下回答“是”,或直接编辑凭据文件。
安装
自制(macOS/Linux)
brew tap andreagrandi/tap
brew install mcp-wire
验证安装
运行内置的冒烟测试,以确认二进制启动和非变异命令有效。这些测试使用一个隔离的临时 HOME 所以他们永远不会碰你真正的MCP配置或凭据:
make smoke-test
或者将脚本指向任何已构建的二进制文件:
./scripts/smoke-test-release.sh ./bin/mcp-wire
还要在以下情况下验证Homebrew安装的副本 mcp-wire 存在于您的酒窖中:
SMOKE_TEST_HOMEBREW=true ./scripts/smoke-test-release.sh "$(brew --prefix mcp-wire)/bin/mcp-wire"
从源代码构建
git clone https://github.com/andreagrandi/mcp-wire
cd mcp-wire
make build
./bin/mcp-wire
故障排除
看 docs/故障排除.md 常见问题的解决方案,包括:
- 在您的系统上未检测到目标
- 空的或过时的注册表搜索
- 每次都提示凭据
- OAuth安装后的后续步骤
--no-prompt失败- 配置文件安全性和作用域行为
跑 mcp-wire doctor 首先是只读诊断报告。
贡献
欢迎提供意见,特别是新的服务定义。
- 通过YAML添加新服务:在中创建文件
services/(无需Go代码)。 - 服务架构:
name,description,transport,或者url(为sse/http)或command/args(为stdio). - 运输价值:
http(可流式传输的HTTP端点),sse(服务器发送事件端点),stdio(基于本地命令的MCP服务器)。 - OAuth服务:添加
auth: oauth在适用的情况下,安装流可以驱动身份验证提示/自动化。 - 在PR之前运行检查:
make test,make test-integration,make build. - 更新
CHANGELOG.md:每个具有用户可见更改(命令、标志、服务、目标、安装流程、打包)的PR都会在下面添加一个项目符号## [Unreleased]。请参阅中的“变更日志更新”部分AGENTS.md了解什么是重要的以及如何格式化条目。CI强制执行此操作。
示例服务文件:
name: example
description: "Example MCP"
transport: http
auth: oauth
url: "https://mcp.example.com/mcp"
env: []
示例 stdio 服务:
name: example-stdio
description: "Example local MCP"
transport: stdio
command: npx
args: ["-y", "@example/mcp-server"]
env: []