Collaborative MCP Proxy Server

Collaborative MCP Proxy Server

Enables multi-AI collaborative analysis by proxying requests to existing login-based MCP servers (Gemini CLI and Codex CLI) from Claude Desktop or Claude Code.

Category
访问服务器

README

🤖 Collaborative MCP Proxy Server

Multi-AI collaborative analysis system for Claude Desktop and Claude Code using existing login-based MCP servers.

✨ Features

  • Multi-AI Collaboration: Integrates Ollama, Gemini CLI, Codex CLI, and Serena MCP
  • ARM64 Mac Optimized: Native Apple Silicon performance
  • Login-Based Authentication: Uses existing CLI configurations (no API keys needed)
  • Privacy-Focused: Local processing with Ollama for sensitive data
  • Pressure Vessel Analysis: Specialized engineering analysis capabilities
  • Claude Integration: Works with both Claude Desktop and Claude Code

Installation

Prerequisites

  • Node.js 18+
  • Existing Gemini CLI MCP and Codex CLI MCP installed and logged in
  • Claude Desktop or Claude Code

Setup

  1. Clone/Create the project:
mkdir collaborative-mcp-proxy
cd collaborative-mcp-proxy
# Copy the files: package.json, index.js, proxy-handler.js
  1. Install dependencies:
npm install
  1. Make executable:
chmod +x index.js

Configuration

Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "collaborative-proxy": {
      "command": "node",
      "args": ["/path/to/collaborative-mcp-proxy/index.js"]
    }
  }
}

Claude Code Configuration

Add to your MCP configuration:

{
  "collaborative-proxy": {
    "command": "node",
    "args": ["/path/to/collaborative-mcp-proxy/index.js"]
  }
}

Usage

Once configured, you can use the collaborative analysis in Claude:

Basic Analysis

Use the collaborate tool to analyze this pressure vessel specification...

Planning Mode

{
  "tool": "collaborate",
  "arguments": {
    "task": "Create analysis plan for pressure vessel design",
    "mode": "plan"
  }
}

Full Analysis Mode

{
  "tool": "collaborate", 
  "arguments": {
    "task": "Analyze pressure vessel compliance with ASME standards",
    "content": "Vessel specifications...",
    "mode": "apply"
  }
}

Review Mode

{
  "tool": "collaborate",
  "arguments": {
    "task": "Review completed analysis",
    "content": "Previous analysis results...", 
    "mode": "review"
  }
}

Collaboration Modes

1. Plan Mode (mode: "plan")

  • Creates detailed analysis plan using Gemini
  • Identifies objectives, focus areas, and deliverables
  • Best for complex tasks requiring upfront planning

2. Apply Mode (mode: "apply") - Default

  • Performs full collaborative analysis
  • Gemini: Comprehensive analysis and risk assessment
  • Codex: Technical implementation and compliance analysis
  • Generates synthesized consensus
  • Most comprehensive option

3. Review Mode (mode: "review")

  • Reviews and validates existing analysis
  • Provides quality assessment and improvements
  • Best for validation of completed work

How It Works

Architecture

Claude Desktop/Code
       ↓
Collaborative MCP Proxy
       ↓
┌─────────────┬─────────────┐
│ Gemini CLI  │ Codex CLI   │
│ MCP         │ MCP         │
│ (logged in) │ (logged in) │
└─────────────┴─────────────┘

Workflow

  1. Request: Claude sends collaboration request to proxy
  2. Distribution: Proxy calls individual MCPs via subprocess
  3. Collection: Proxy gathers results from each MCP
  4. Synthesis: Proxy generates consensus using Gemini
  5. Response: Combined analysis returned to Claude

Agent Specializations

  • Gemini: System-level analysis, risk assessment, comprehensive evaluation
  • Codex: Technical implementation, code quality, standards compliance
  • Consensus: Synthesis of all perspectives with unified recommendations

Implementation Details

Subprocess Calling

The proxy server calls existing MCPs as subprocesses, preserving their login sessions:

const geminiProcess = spawn('gemini-cli-command', args);
const codexProcess = spawn('codex-cli-command', args);

Error Handling

  • Timeout protection (2 minutes per MCP call)
  • Graceful degradation if one MCP fails
  • Detailed error logging for debugging

Mock Implementation

Current implementation includes mock responses for demonstration. To connect to real MCPs:

  1. Update callGeminiMCP() to spawn actual Gemini CLI process
  2. Update callCodexMCP() to spawn actual Codex CLI process
  3. Ensure proper JSON-RPC message formatting

Development

Testing

# Start the server in development mode
npm run dev

# Test with manual JSON-RPC calls
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | node index.js

Debugging

The server logs to stderr, so you can monitor activity:

node index.js 2> debug.log

Extending

To add new MCPs or capabilities:

  1. Add new methods to ProxyHandler
  2. Update tool schema in handleToolsList()
  3. Implement subprocess calling logic

Troubleshooting

Common Issues

1. MCP Not Recognized

  • Verify claude_desktop_config.json path is correct
  • Restart Claude Desktop after configuration changes
  • Check file permissions on index.js

2. Subprocess Errors

  • Ensure Gemini CLI and Codex CLI are installed and logged in
  • Verify MCP command paths are correct
  • Check Node.js version (18+ required)

3. Timeout Issues

  • Increase timeout in proxy-handler.js if needed
  • Check network connectivity for external MCP calls
  • Monitor stderr logs for detailed error information

Logging

All server activity is logged to stderr:

# View logs while running
node index.js 2>&1 | grep "MCP Proxy"

License

MIT License - See LICENSE file for details

Contributing

  1. Fork the repository
  2. Create feature branch
  3. Add tests for new functionality
  4. Submit pull request

Roadmap

  • [ ] Real MCP subprocess integration
  • [ ] Configuration file support
  • [ ] Advanced workflow orchestration
  • [ ] Result caching and persistence
  • [ ] Web UI for collaboration management
  • [ ] Integration with more AI models

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选