AI Collaboration MCP Server

AI Collaboration MCP Server

Enables collaboration with multiple AI providers (Claude, GPT-4, Gemini, Ollama) directly from VS Code with automatic project context injection and persistent conversation history. Provides streamlined tools for getting AI advice, multi-provider research, and enhanced context sharing across sessions.

Category
访问服务器

README

AI Collaboration MCP Server

A streamlined Model Context Protocol (MCP) server that provides enhanced AI collaboration tools for VS Code with automatic project context injection and conversation history.

🚀 Features

  • Multi-Provider Support: Claude, GPT-4, Gemini, and Ollama
  • Workspace-Specific Conversation History: Each project gets isolated conversation memory
  • Automatic Context Injection: Project files, structure, and README automatically included
  • Dynamic Workspace Management: Switch between projects seamlessly
  • API Call Management: Rate limiting (3 calls per provider per hour)
  • Streamlined Tools: Just 4 essential tools that work together

🛠️ Tools Available

1. #set_workspace

Set the current workspace directory for project-specific conversation history and context.

Usage in VS Code:

@workspace use #set_workspace with workspace_path="/path/to/your/project"

2. #consult_ai

Get expert advice from a specific AI provider with full project context.

Usage in VS Code:

@workspace use #consult_ai with claude about error handling best practices

3. #multi_ai_research

Get perspectives from multiple AI providers on complex questions.

Usage in VS Code:

@workspace use #multi_ai_research to analyze authentication approaches

4. #mandatory_execute

Force tool execution with explicit commands.

Usage in VS Code:

@workspace !consult_ai
@workspace use #multi_ai_research

📦 Installation

Prerequisites

  • Node.js 18+
  • VS Code with MCP support
  • API keys for desired AI providers

1. Clone and Setup

git clone https://github.com/yourusername/ai-collaboration-mcp-server.git
cd ai-collaboration-mcp-server
npm install

2. Configure Environment Variables

Create a .env file:

# AI Provider API Keys (add the ones you want to use)
ANTHROPIC_API_KEY=your_claude_key_here
OPENAI_API_KEY=your_openai_key_here  
GEMINI_API_KEY=your_gemini_key_here

# Ollama Configuration (for local AI)
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama3.2:latest

3. Build the Server

npm run build

4. Configure VS Code MCP

Option A: Workspace-specific (recommended for testing)

Create .vscode/mcp.json in your project:

{
  "servers": {
    "ai-collaboration": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/ai-collaboration-mcp-server/build/index.js"],
      "env": {
        "ANTHROPIC_API_KEY": "your_key_here",
        "OPENAI_API_KEY": "your_key_here",
        "GEMINI_API_KEY": "your_key_here",
        "OLLAMA_BASE_URL": "http://localhost:11434"
      }
    }
  }
}

Option B: Global configuration (for all projects)

Create ~/.vscode/mcp.json:

{
  "servers": {
    "ai-collaboration": {
      "type": "stdio", 
      "command": "node",
      "args": ["/absolute/path/to/ai-collaboration-mcp-server/build/index.js"],
      "env": {
        "ANTHROPIC_API_KEY": "your_key_here",
        "OPENAI_API_KEY": "your_key_here",
        "GEMINI_API_KEY": "your_key_here",
        "OLLAMA_BASE_URL": "http://localhost:11434"
      }
    }
  }
}

5. Enable MCP Auto-start (Optional)

Add to your VS Code settings.json:

{
  "chat.mcp.autostart": "newAndOutdated"
}

🎯 Usage

First Time Setup Per Project:

  1. Restart VS Code after configuration
  2. Open VS Code chat (sidebar or Cmd+Shift+I)
  3. Set workspace for your project:
    @workspace use #set_workspace with workspace_path="/full/path/to/your/project"
    

Daily Usage:

  1. Use the AI tools:
    • @workspace use #consult_ai with claude about my code
    • @workspace use #multi_ai_research to compare approaches
    • @workspace !consult_ai (force execution)

When Switching Projects:

  1. Set new workspace:
    @workspace use #set_workspace with workspace_path="/path/to/other/project"
    

💡 Tip: Each project gets its own .mcp-conversation-history.json file for isolated conversation memory.

⚠️ Important Syntax Note

When using @workspace in VS Code, MCP tool names must be prefixed with #:

Correct: @workspace use #consult_ai with claude about my code
Wrong: @workspace use consult_ai with claude about my code

Without @workspace, no # is needed: ✅ Also correct: use consult_ai with claude about my code

🔧 Development

Run in Development Mode

npm run dev

Test the Server

npm test

Debug with MCP Inspector

npx @modelcontextprotocol/inspector node build/index.js

🧠 How It Works

Enhanced Context Injection

Every tool call automatically includes:

  • Project structure and files
  • README and package.json content
  • Relevant conversation history
  • Current workspace context

Conversation History

  • Persistent file-based history (.mcp-conversation-history.json)
  • Smart relevance filtering
  • Cross-session context continuity

API Management

  • Rate limiting per provider (3 calls/hour)
  • Automatic retry with exponential backoff
  • Clear error handling and user feedback

🔒 Security Notes

  • API keys are stored in MCP configuration (keep them secure)
  • Conversation history is stored locally
  • No data sent to external services except AI provider APIs

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

📄 License

MIT License - see LICENSE file for details

🆘 Troubleshooting

MCP Server Won't Start

  1. Check Cmd+Shift+P → "MCP: List Servers"
  2. Verify file paths in configuration
  3. Check VS Code Output panel for errors
  4. Ensure Node.js and dependencies are installed

API Keys Not Working

  1. Verify keys are correctly set in MCP configuration
  2. Check for typos or extra spaces
  3. Ensure keys have proper permissions

Tools Not Appearing

  1. Restart VS Code completely
  2. Try @workspace in chat to trigger MCP loading
  3. Check MCP server logs for errors

🌟 Why This Approach?

This streamlined server demonstrates that smart consolidation beats feature proliferation:

  • 3 core tools instead of 7+ specialized ones
  • Enhanced context shared across all tools
  • Easier maintenance and debugging
  • Better user experience with consistent functionality
  • Reduced cognitive load - focus on what you want, not which tool to use

Perfect for teams wanting powerful AI collaboration without complexity!

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选