NC

nazar256/combine-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

35 stars 7 forks 质量 61 趋势 12

一个MCP(模型上下文协议)聚合器,允许你将多个MCP服务器合并到单一接口。代码大多由AI生成。

概览

一个MCP(模型上下文协议)聚合器,允许你将多个MCP服务器合并到单一接口。代码大多由AI生成。 这个应用的主要原因是绕过光标限制,即一次只能使用两个MCP服务器。无论如何,我添加第三个MCP服务器时,导致无法使用另外两个服务器中的一个。 MCP 聚合器作为光标(或其他 MCP 客户端)与多个 MCP 服务器之间的桥梁。它既作为 MCP 服务器(与光标通信)也作为 MCP 客户端(与后端 MCP 服务器通信)工作。 主要功能:- 为光标及其他MCP客户端提供标准接口 - 连接多个后端MCP服务器- 前缀从后端服务器(例如:

概述(AI 翻译)

一个MCP(模型上下文协议)聚合器,允许你将多个MCP服务器合并到单一接口。代码大多由AI生成。

为什么要把MCP服务器合并成一个?

这个应用的主要原因是绕过光标限制,即一次只能使用两个MCP服务器。无论如何,我添加第三个MCP服务器时,导致无法使用另外两个服务器中的一个。

概述

MCP 聚合器作为光标(或其他 MCP 客户端)与多个 MCP 服务器之间的桥梁。它既作为 MCP 服务器(与光标通信)也作为 MCP 客户端(与后端 MCP 服务器通信)工作。

主要特点:

  • 为光标及其他MCP客户端提供标准接口
  • 连接多个后端MCP服务器
  • 后端服务器的方法前缀(例如,“shortcut_search_stories”表示“search_stories”方法,来自“快捷”MCP)
  • 通过用划线替换划线以实现光标兼容性,自动净化工具名称
  • 可通过环境变量和 JSON 配置文件进行配置
  • 带可配置级别的调试日志

安装

使用安装脚本(推荐)

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MCP Aggregator

An MCP (Model Context Protocol) aggregator that allows you to combine multiple MCP servers into a single interface. The code is mostly AI-generated.

Why combine MCP servers into one?

The primary reason for this app was to work around Cursor’s limitation of only being able to use 2 MCP servers at a time. No matter which, in my case when I added 3rd MCP server, it was breaking the ability to use one of other two.

Overview

The MCP Aggregator acts as a bridge between Cursor (or any other MCP client) and multiple MCP servers. It functions both as an MCP server (when talking to Cursor) and as an MCP client (when talking to backend MCP servers).

Key features:

  • Provides a stdio interface for Cursor and other MCP clients
  • Connects to multiple backend MCP servers
  • Prefixes methods from backend servers (e.g., “shortcut_search_stories” for “search_stories” method from a “shortcut” MCP)
  • Automatically sanitizes tool names by replacing dashes with underscores for Cursor compatibility
  • Configurable via environment variables and JSON config file
  • Debug logging with configurable levels

Installation

You can install the latest version of combine-mcp using our installation script:

# Download and run the installation script
curl -fsSL https://raw.githubusercontent.com/nazar256/combine-mcp/main/install.sh | bash

# Or install a specific version
curl -fsSL https://raw.githubusercontent.com/nazar256/combine-mcp/main/install.sh | bash -s -- -v v1.0.0

The script will:

  • Detect your operating system and architecture
  • Download the appropriate pre-compiled binary
  • Verify the checksum
  • Install it to a suitable location in your PATH
  • Make it executable

Using go install (alternative)

# Install directly from GitHub (binary will be placed in $GOPATH/bin)
go install github.com/nazar256/combine-mcp/cmd/combine-mcp@latest

# Ensure $GOPATH/bin is in your PATH
# For example, add this to your .bashrc or .zshrc:
# export PATH=$PATH:$(go env GOPATH)/bin

Using Docker (alternative)

You can run combine-mcp directly using Docker without installing it locally:

# Run the latest version
docker run --rm -v ~/.config/mcp:/config ghcr.io/nazar256/combine-mcp:latest

# Run a specific version
docker run --rm -v ~/.config/mcp:/config ghcr.io/nazar256/combine-mcp:v1.0.0

# Set environment variables
docker run --rm -v ~/.config/mcp:/config -e MCP_CONFIG=/config/config.json -e MCP_LOG_LEVEL=debug ghcr.io/nazar256/combine-mcp:latest

To use it with Cursor, you’d need to configure the MCP server to use Docker:

{
  "mcpServers": {
    "aggregator": {
      "command": "docker",
      "args": ["run", "--rm", "-v", "~/.config/mcp:/config", "ghcr.io/nazar256/combine-mcp:latest"],
      "env": {
        "MCP_CONFIG": "/config/config.json"
      }
    }
  }
}

Using the Makefile

The project includes a Makefile for common tasks:

# Build the binary
在 GitHub 查看完整 README

安装

docker run --rm -v ~/.config/mcp:/config ghcr.io/nazar256/combine-mcp:latest
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "aggregator": { "command": "docker", "args": ["run", "--rm", "-v", "~/.config/mcp:/config", "ghcr.io/nazar256/combine-mcp:latest"], "env": { "MCP_CONFIG": "/config/config.json" } } } }