使用说明
MCP经理
模型上下文协议(MCP)服务器的集中式配置管理器。定义一次MCP服务器,将其自动同步到所有AI客户端。
问题
每个AI客户端(Claude Desktop、Cursor、Zed、Continue.dev等)都以不同的格式和位置维护自己的MCP配置文件。MCP经理充当 单一事实来源 --您只需配置一次服务器,然后单击一下即可同步到所有客户端。
支持的客户
| 客户端 | 格式 | 配置密钥 |
|---|---|---|
| 克劳德桌面 | JSON | mcpServers |
| 游标 | JSON | mcpServers |
| Windsurf IDE | JSON | mcpServers |
| VS代码(Cline/Roo) | JSON | mcpServers |
| Zed编辑器 | JSONC | context_servers |
| Continue.dev | YAML(数组) | mcpServers |
| OpenCode AI | JSONC | mcp (类型:本地、环境) |
| 源代码图Cody | JSON | cody.mcpServers |
| 鹅(块) | YAML(地图) | extensions (cmd、envs) |
| JetBrains集成开发环境 | XML | llm.mcpServers |
| Copilot CLI | JSON | mcpServers |
| Gemini CLI | JSON | mcpServers (httpUrl 对于远程服务器) |
朱尼,JSON。 mcpServers (type: stdio, mcp-remote 远程服务器网桥) |
建筑
┌─────────────────────────────────────────┐
│ Electron (Main Process) │
│ ┌──────────┐ ┌────────────────────┐ │
│ │ SQLite │ │ Sync Engine │ │
│ │ Database │ │ backup → translate │ │
│ │ (servers,│ │ → write (retry) │ │
│ │ targets) │ └────────┬───────────┘ │
│ └──────────┘ │ │
│ │ ┌────────┴──────────┐ │
│ │ │ Schema Translators │ │
│ │ │ (13 client formats)│ │
│ │ └────────┬──────────┘ │
│ │ │ │
│ │ ┌────────┴──────────┐ │
│ │ │ Parsers │ │
│ │ │ JSON│JSONC│YAML│XML│ │
│ │ └───────────────────┘ │
│ ┌────┴─────────────────────────────┐ │
│ │ IPC Handlers (preload bridge) │ │
│ └──────────────────────────────────┘ │
└────────────────┬────────────────────────┘
│ contextBridge
┌────────────────┴────────────────────────┐
│ Renderer (React + Tailwind) │
│ Dashboard │ ServerForm │ SyncHub │
└─────────────────────────────────────────┘
技术栈
- 电子 --带安全IPC的桌面外壳
- React 18+TypeScript --渲染器UI
- Tailwind CSS --造型
- 维特 --用于渲染器和主进程的bundler
- 更好平方3 --服务器和同步目标的本地数据库
- jsoc解析器 --无损JSONC编辑(保留注释)
- YAML --基于AST的YAML编辑(保留格式)
- xml2js --JetBrains XML配置操作
- 维测试 --测试框架
入门指南
快速入门(npx)
直接运行MCP管理器,无需克隆——要求Node.js≥18:
npx @hiosdra/mcp-manager
或全局安装:
npm install -g @hiosdra/mcp-manager
mcp-manager
发展
先决条件
- Node.js≥18
- npm
安装并运行
npm install
# Development (renderer + main + electron)
npm run dev
# Production build
npm run build
文档网站
该存储库现在包括一个独立的文档应用程序 docs/ 该网站已准备好稍后作为静态网站发布(例如在GitHub Pages上)。
# Run the docs site locally
npm run dev:docs
# Build the static docs output into dist/docs
npm run build:docs
GitHub Pages部署工作流示例包含在 .github/workflows/deploy-docs.yml.
运行测试
npm test
主要特点
- 单一事实来源 --在经理的SQLite数据库中定义一次服务器
- 从现有客户导入 --扫描你的人工智能工具,并导入它们现有的MCP服务器配置
- 无损配置编辑 --JSONC注释和YAML格式被保留
- 自动备份 —
.backup每次配置更改前创建的文件 - 使用指数回退重试 --处理Windows上的文件锁(EPERM)
- JetBrains路径消毒 --包含空格的args在XML中自动引用
- 每个客户端切换 --为每台服务器单独启用/禁用同步目标
- 客户端自动检测 --扫描特定于操作系统的路径以查找已安装的AI客户端
项目结构
src/
├── main/ # Electron main process
│ ├── main.ts # App entry, IPC handlers
│ ├── preload.ts # contextBridge (secure IPC)
│ ├── database/ # SQLite schema & repository
│ ├── parsers/ # JSON, JSONC, YAML, XML parsers
│ ├── translators/ # Schema translators (13 clients)
│ ├── sync/ # Sync engine (backup, translate, write)
│ └── utils/ # Client detector, path mapping
├── renderer/ # React frontend
│ ├── App.tsx # Main app with navigation
│ ├── components/ # Dashboard, ServerForm, SyncHub, StatusBar
│ └── hooks/ # useServers, useDetectedClients, useSync
└── shared/
└── types.ts # Shared TypeScript types & interfaces
docs/
├── index.html # Static docs entry
├── src/ # React-powered documentation site
└── vite.config.ts # Standalone docs build config
tests/
├── schemaTranslator.test.ts # 27 tests — all 13 client formats
├── parsers.test.ts # 22 tests — JSON, JSONC, YAML, XML
├── serverRepository.test.ts # 12 tests — CRUD + sync targets
├── syncEngine.test.ts # 13 tests — end-to-end sync + backup
└── clientDetector.test.ts # 2 tests — Gemini CLI and Junie path detection
发布到npm
当你创建一个新的包时,该包会通过GitHub Actions自动发布 GitHub发布.
一次性设置
- 创建一个npm帐户 在 npmjs.com 如果你没有。
- 创建npm访问令牌 --转到npmjs.com→ 账户→ 访问令牌→ 生成新令牌(类型: 自动化).
- 将令牌添加为GitHub机密 --转到repo设置→ 秘密与变量→ 行动→ 新存储库机密,命名它
NPM_TOKEN,粘贴令牌。
发布新版本
# Bump version (patch / minor / major)
npm version patch # e.g. 0.1.0 → 0.1.1
# Push the version commit and tag
git push && git push --tags
然后从标签中创建一个GitHub Release——工作流将自动构建、测试并发布到npm。
