Skip to main content
Glama

MCP Proxy Server

by adamwattis

MCP代理服务器

MCP 代理服务器通过单一接口聚合并服务于多个 MCP 资源服务器。该服务器充当中央枢纽,可以:

  • 连接和管理多个 MCP 资源服务器
  • 通过统一的界面展示其综合能力
  • 将请求路由到适当的后端服务器
  • 汇总来自多个来源的回复

特征

资源管理

  • 发现并连接多个 MCP 资源服务器
  • 聚合所有连接服务器的资源
  • 维护跨服务器的一致 URI 方案
  • 处理资源路由和解析

工具聚合

  • 公开所有连接服务器的工具
  • 将工具调用路由到适当的后端服务器
  • 维护工具状态并处理响应

及时处理

  • 汇总所有已连接服务器的提示
  • 将提示请求路由到适当的后端
  • 处理多服务器提示响应

配置

该服务器需要一个 JSON 配置文件,用于指定要连接的 MCP 服务器。复制示例配置并根据你的需要进行修改:

cp config.example.json config.json

配置结构示例:

{ "servers": [ { "name": "Server 1", "transport": { "command": "/path/to/server1/build/index.js" } }, { "name": "Server 2", "transport": { "command": "server2-command", "args": ["--option1", "value1"], "env": ["SECRET_API_KEY"] } }, { "name": "Example Server 3", "transport": { "type": "sse", "url": "http://localhost:8080/sse" } } ] }

运行服务器时必须提供配置文件:

MCP_CONFIG_PATH=./config.json mcp-proxy-server

发展

安装依赖项:

npm install

构建服务器:

npm run build

对于使用自动重建的开发:

npm run watch

对于连续运行的开发:

# Stdio npm run dev # SSE npm run dev:sse

安装

要与 Claude Desktop 一起使用,请添加服务器配置:

在 MacOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json

{ "mcpServers": { "mcp-proxy": { "command": "/path/to/mcp-proxy-server/build/index.js", "env": { "MCP_CONFIG_PATH": "/absolute/path/to/your/config.json", "KEEP_SERVER_OPEN": "1" } } } }
  • KEEP_SERVER_OPEN即使客户端断开连接,SSE 仍会保持运行。当多个客户端连接到 MCP 代理时非常有用。

调试

由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们推荐使用MCP Inspector ,它以包脚本的形式提供:

npm run inspector

检查器将提供一个 URL 来访问浏览器中的调试工具。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

一个中央枢纽,将多个 MCP 资源服务器聚合到单个统一的界面,使用户能够通过一个连接点访问来自多个后端服务器的工具和功能。

  1. 特征
    1. 资源管理
    2. 工具聚合
    3. 及时处理
  2. 配置
    1. 发展
      1. 安装
        1. 调试

      Related MCP Servers

      • -
        security
        A
        license
        -
        quality
        A middleware server that enables multiple isolated instances of the same MCP servers to coexist independently with unique namespaces and configurations.
        Last updated -
        190
        56
        TypeScript
        MIT License
      • -
        security
        F
        license
        -
        quality
        An MCP server that connects to the Resource Hub, allowing centralized configuration and management of tools and resources across different MCP environments.
        Last updated -
        2
        JavaScript
        • Apple
      • -
        security
        A
        license
        -
        quality
        An MCP server implementation that standardizes how AI applications access tools and context, providing a central hub that manages tool discovery, execution, and context management with a simplified configuration system.
        Last updated -
        9
        Python
        MIT License
      • -
        security
        -
        license
        -
        quality
        An MCP server that enables Claude and other MCP clients to interact with Mattermost workspaces, providing channel management, messaging capabilities, and topic monitoring functionality.
        Last updated -
        TypeScript

      View all related MCP servers

      MCP directory API

      We provide all the information about MCP servers via our MCP API.

      curl -X GET 'https://glama.ai/api/mcp/v1/servers/adamwattis/mcp-proxy-server'

      If you have feedback or need assistance with the MCP directory API, please join our Discord server