1MCP Server

by 1mcp-app
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Indicated by server-filesystem capability, which likely allows file operations on git repositories

  • Provides platform-specific configurations and file paths for Linux users

  • Provides platform-specific configurations and file paths for macOS users

1MCP - 一个 MCP 服务器,满足所有人的需求

将多个 MCP 服务器聚合为一个的统一模型上下文协议服务器实现。

概述

1MCP(One MCP)旨在简化您与 AI 助手的协作方式。1MCP 无需为不同的客户端(Claude Desktop、Cherry Studio、Cursor、Roo Code、Claude 等)配置多个 MCP 服务器,而是提供一个统一的服务器,该服务器能够:

  • 将多个 MCP 服务器聚合到一个统一的界面
  • 通过消除冗余服务器实例来减少系统资源的使用
  • 简化不同 AI 助手之间的配置管理
  • 为 AI 模型与外部工具和资源交互提供标准化方式
  • 支持动态配置重新加载,无需重启服务器
  • 处理正常关机和资源清理

快速入门

要使 Cursor 能够使用已在 Claude Desktop 中配置的现有 MCP 服务器,请按照以下步骤操作:

  1. 使用 Claude Desktop 配置文件运行 1MCP 服务器:
npx -y @1mcp/agent --config ~/Library/Application\ Support/Claude/claude_desktop_config.json
  1. 将 1MCP 服务器添加到您的 Cursor 配置文件 ( ~/.cursor/mcp.json ):
{ "mcpServers": { "1mcp": { "type": "http", "url": "http://localhost:3050/sse" } } }
  1. 好好享受!

用法

您可以直接使用npx运行服务器:

# Basic usage (starts server with SSE transport) npx -y @1mcp/agent # Use existing Claude Desktop config npx -y @1mcp/agent --config ~/Library/Application\ Support/Claude/claude_desktop_config.json # Use stdio transport instead of SSE npx -y @1mcp/agent --transport stdio # Show all available options npx -y @1mcp/agent --help

可用选项:

  • --transport, -t :选择传输类型(“stdio”或“sse”,默认值:“sse”)
  • --config, -c :使用特定的配置文件
  • --port, -P :更改 SSE 端口(默认值:3050)
  • --host, -H :更改 SSE 主机(默认值:localhost)
  • --tags, -g :按标签过滤服务器(请参阅下面的标签部分)
  • --help, -h :显示帮助

环境变量示例:

# Using environment variables ONE_MCP_PORT=3051 ONE_MCP_TAGS=network,filesystem npx -y @1mcp/agent # Or in your shell configuration export ONE_MCP_PORT=3051 export ONE_MCP_TAGS=network,filesystem npx -y @1mcp/agent

Docker

您还可以使用 Docker 运行 1MCP:

# Pull the latest image docker pull ghcr.io/1mcp-app/agent:latest # Run with SSE transport (default) docker run -p 3050:3050 ghcr.io/1mcp-app/agent # Run with a custom config file docker run -p 3050:3050 -v /path/to/config.json:/config.json ghcr.io/1mcp-app/agent --config /config.json # Run with stdio transport docker run -i ghcr.io/1mcp-app/agent --transport stdio

可用的图像标签:

  • latest :最新稳定版本
  • vX.YZ :特定版本(例如v1.0.0
  • sha-<commit> :特定提交

环境变量

您可以使用以ONE_MCP_为前缀的环境变量配置 1MCP:

  • ONE_MCP_TRANSPORT :传输类型(“stdio”或“sse”,默认值:“sse”)
  • ONE_MCP_PORT :SSE 端口(默认值:3050)
  • ONE_MCP_HOST :SSE 主机(默认值:“localhost”)
  • ONE_MCP_CONFIG :配置文件路径
  • ONE_MCP_TAGS :用于过滤服务器的标签的逗号分隔列表

环境变量示例:

docker run -p 3051:3051 \ -e ONE_MCP_PORT=3051 \ -e ONE_MCP_TAGS=network,filesystem \ ghcr.io/1mcp-app/agent

了解标签

标签可帮助您控制哪些 MCP 服务器可供不同客户端使用。您可以将标签视为描述每个服务器功能的一个标签。

如何使用标签

  1. 在您的服务器配置中:向每个服务器添加标签以描述其功能
{ "mcpServers": { "web-server": { "command": "uvx", "args": ["mcp-server-fetch"], "tags": ["network", "web"], "disabled": false }, "file-server": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "~/Downloads"], "tags": ["filesystem"], "disabled": false } } }
  1. 在 stdio 模式下启动 1MCP 时:您可以按标签过滤服务器
# Only start servers with the "network" tag npx -y @1mcp/agent --transport stdio --tags "network" # Start servers with either "network" or "filesystem" tags npx -y @1mcp/agent --transport stdio --tags "network,filesystem"
  1. 使用 SSE 传输时:客户端可以请求具有特定标签的服务器
{ "mcpServers": { "1mcp": { "type": "http", "url": "http://localhost:3050/sse?tags=network" // Only connect to network-capable servers } } }

示例标签:

  • network :用于发出 Web 请求的服务器
  • filesystem :用于处理文件操作的服务器
  • memory :适用于提供内存/存储的服务器
  • shell :适用于运行 shell 命令的服务器
  • db :用于处理数据库操作的服务器

配置

全局配置

服务器自动管理全局位置的配置:

  • macOS/Linux: ~/.config/1mcp/mcp.json
  • Windows: %APPDATA%/1mcp/mcp.json

配置文件格式

{ "mcpServers": { "mcp-server-fetch": { "command": "uvx", "args": [ "mcp-server-fetch" ], "disabled": false }, "server-memory": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-memory" ], "disabled": false } } }

工作原理

系统架构

请求流程

发展

安装依赖项:

pnpm install

构建服务器:

pnpm build

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

pnpm watch

运行服务器:

pnpm dev

调试

使用MCP Inspector (可作为包脚本使用):

pnpm inspector

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

-
security - not tested
A
license - permissive license
-
quality - not tested

统一的模型上下文协议服务器,将多个 MCP 服务器聚合为一个,让 Claude Desktop、Cursor 和 Cherry Studio 等 AI 助手连接到单个服务器,而无需管理多个实例。

  1. Overview
    1. Quick Start
      1. Usage
        1. Docker
          1. Environment Variables
          2. Understanding Tags
        2. Configuration
          1. Global Configuration
          2. Configuration File Format
        3. How It Works
          1. System Architecture
          2. Request Flow
        4. Development
          1. Debugging
        ID: ttsuowc5pm