使用说明
MCP路由器
一种轻量级的容器化MCP(模型上下文协议)路由器,在转发到AI服务之前通过Ollama增强提示。
特征
- 快速增强:使用本地Ollama模型(deepseek-r1、llama3)来改进提示
- MCP聚合:多个MCP服务器的单个HTTP端点
- 容器化:在macOS上通过Colima在Docker中运行
- 钥匙链集成:通过以下方式管理秘密
ks命令行界面
目标客户
- Claude MAX(桌面和代码)
- VS Code+GitHub Copilot Pro
快速开始
先决条件
# Install Colima and Docker
brew install colima docker
# Install ks (Keychain Secrets manager)
brew tap loteoo/formulas && brew install ks
ks init
# Start Colima
colima start
设置
# Clone and enter project
cd ~/Projects/Insiders
# Generate .env from Keychain secrets
./scripts/gen-env-from-ks.sh
# Start the stack
docker compose up -d
# Check status
docker compose ps
发展
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -e ".[dev]"
# Run locally (without Docker)
uvicorn router.main:app --reload --port 9090
建筑
Desktop Apps → MCP Router (:9090) → Ollama Enhancement → MCP Servers
│
├── /context7/
├── /desktop-commander/
├── /sequential-thinking/
├── /fetch/
└── /ollama/
配置
MCP配置文件
| 文件 | 目的 |
|---|---|
configs/mcp-servers.json |
定义聚合MCP服务器的路由器内部配置 |
mcp.json |
客户端配置 用于测试路由器端点(SSE/HTTP到:9090) |
.mcp.json |
重构原始MCP服务器的Symlink(~/.local/share/mcps/.mcp.json) |
测试工作流程:使用 mcp.json 测试新路由器,同时 .mcp.json 参考原始MCP设置进行比较。
环境变量
看 .env.example 对于所有选项。从钥匙链生成:
./scripts/gen-env-from-ks.sh
添加秘密
# Add a secret to Keychain
ks add obsidian_api_key "your-api-key"
# Regenerate .env
./scripts/gen-env-from-ks.sh
项目结构
├── router/ # FastAPI router service
├── configs/ # Application-specific MCP configs
├── scripts/ # Utility scripts
├── docker-compose.yml # Container orchestration
└── .github/ # Copilot agents, prompts, instructions
许可证
麻省理工学院