MCP设置器
一个生产级的模块化应用程序,用于跨不同的AI服务和操作系统安装和管理MCP(模型上下文协议)服务器。
架构概述
这是一个 模块化单仓库 与:
- 一个共享的业务逻辑层 -核心领域、用例和基础设施
- 两个独立的前端:
- 🖥️ 桌面应用程序 (Electron)-跨平台图形用户界面 - ⌨️ 命令行界面 -命令行界面
两个前端使用相同的业务逻辑,确保一致性和可维护性。
特性
✅ 全面实施
- ✅ MCP注册表集成 -从官方注册表搜索、浏览和获取服务器
- ✅ 多客户端支持 -Claude桌面、Claude CLI、光标、继续、Gemini CLI
- ✅ 交叉平台的 -具有操作系统特定配置检测的Windows、macOS、Linux
- ✅ 安装 -使用自动配置从注册表安装MCP服务器
- ✅ 凭证管理 -配置旁边的安全.env文件存储
- ✅ 健康检查 -验证服务器配置和凭据
- ✅ 备份和恢复 -完整快照备份,包括凭据
- ✅ 跨客户管理 -在客户端之间复制/移动服务器
- ✅ 完整的CLI -8个命令,具有可读性和JSON输出
- ✅ 整洁架构 -SOLID原则,依赖注入,可测试
🚧 计划的
- 🚧 桌面图形用户界面 -Electron应用程序(骨架存在,需要实现)
- 🚧 自动化测试 -单元、集成、E2E测试
- 🚧 MCP服务器卸载 -通过CLI/GUI删除服务器
技术栈
- TypeScript 5.x -类型安全开发
- 电子28+ -跨平台桌面框架
- Vite 5.x -HMR快速构建工具
- Vitest -单元和集成测试
- 剧作家 -端到端测试
- 黄道 -运行时验证
- 注射器 -依赖注入
建筑
该项目遵循 模块化架构 具有共享的业务逻辑和多个前端:
src/
├── shared/ # Shared domain models and infrastructure
│ ├── domain/ # Core entities, value objects
│ └── infrastructure/ # File system, OS detection, etc.
│
├── features/ # Business logic features (shared by all frontends)
│ ├── service-detection/
│ ├── mcp-installation/
│ └── config-management/
│
└── app/ # Frontend implementations
├── electron/ # Desktop GUI (Electron)
│ ├── main/ # Electron main process
│ ├── renderer/ # Electron renderer (UI)
│ └── preload/ # Preload scripts
└── cli/ # Command-line interface关键的原则:业务逻辑完全独立于前端。CLI和Desktop应用程序都使用相同的用例和域逻辑。
看 建筑.md 获取详细的架构文档。
发展原则
本项目严格遵守:
- SOLID -单一职责、开放/封闭、Liskov替换、接口隔离、依赖倒置
- 不要重复自己 -不要重复自己
- 保持简单 -保持简单,愚蠢
- 雅格尼 -你不需要它
看 代理商.md 详细的开发指南。
入门指南
先决条件
- Node.js 18+LTS
- npm 9+或pnpm
安装
# Install dependencies
npm install快速入门-CLI
CLI是 功能齐全 并准备使用:
# Detect installed MCP clients
npm run dev:cli detect
# Search the MCP registry
npm run dev:cli search --query filesystem
# Install an MCP server
npm run dev:cli install brave-search --client claude-desktop
# List installed servers
npm run dev:cli installed --client claude-desktop
# Check server health
npm run dev:cli healthcheck brave-search --client claude-desktop
# Create a backup
npm run dev:cli backup
# Get help
npm run dev:cli --help📖 完整的CLI文档: CLI.md
发展
# Development - CLI (fully functional)
npm run dev:cli # Run any CLI command
# Development - Desktop App (skeleton only)
npm run dev:electron # Run Electron app in dev mode
# Type checking
npm run type-check
# Linting
npm run lint
npm run lint:fix
# Formatting
npm run format
npm run format:check测试
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with UI
npm run test:ui
# Run tests with coverage
npm run test:coverage
# Run E2E tests
npm run test:e2e建筑
# Build business logic (shared)
npm run build:core
# Build Desktop App
npm run build:electron
npm run package:mac # macOS
npm run package:win # Windows
npm run package:linux # Linux
# Build CLI
npm run build:cli
# Build everything
npm run build:all项目结构
mcp-setter/
├── src/ # Source code
│ ├── shared/ # Shared domain and infrastructure
│ ├── features/ # Feature modules
│ └── app/ # Application entry points
├── tests/ # Tests
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ └── e2e/ # End-to-end tests
├── docs/ # Documentation
│ └── adr/ # Architecture Decision Records
├── scripts/ # Utility scripts
├── build/ # Build assets (icons, etc.)
├── AGENTS.md # AI agent development guidelines
├── ARCHITECTURE.md # Architecture documentation
├── CLAUDE.md # Claude Code guidance
└── package.json # Project dependencies and scripts环境变量
创建一个 .env 文件基于 .env.example:
CONTEXT7_API_KEY=your_key_here
GITHUB_MCP_PAT=your_token_here
N8N_API_KEY=your_key_here
N8N_API_URL=your_url_here安全说明:从不承诺 .env 版本控制。
贡献
该项目遵循严格的编码标准:
文档
- CLI.md -完整的CLI使用指南和示例
- CLAUDE.md -Claude Code AI指南
- 代理商.md -核心发展原则和指导方针
- 建筑.md -详细的架构文档
- src/README.md -源代码结构
- docs/adr/ -架构决策记录
许可证
麻省理工学院
支持
对于问题和功能请求,请使用GitHub问题跟踪器。
