MCPico

MCPico

MCP proxy that bundles flat tool lists into hierarchical subcommand groups, reducing context token usage and improving tool discovery.

Category
访问服务器

README

MCPico

MCP proxy that bundles flat tool lists into hierarchical subcommand groups.

MCPico (MCP + "ico" = tiny) wraps upstream MCP servers, grouping their tools into discoverable subcommand-based tools. One tool per group, not one per tool. The help subcommand auto-generates rich documentation from upstream schemas.

The Problem

MCP servers expose tools as a flat list. Every tool costs context tokens. A filesystem server exposes 14+ separate tools — the model sees all of them, all the time, even when it only needs one.

Some clients add "tool search" as a workaround. But searching requires the model to proactively look for tools it doesn't know exist. No structural signal about which tools relate to each other.

MCPico's Solution

Group related tools under a single entry point. The model sees 9 groups instead of 14 tools. Discovery is built-in via help:

→ filesystem tools:
  14 tools → 9 groups: read, write, edit, create, list, directory, move, search, get

Features

  • Tool bundling — Groups tools by prefix (configurable separator), collapsing flat tool lists
  • Auto-generated help — Each group's help subcommand is built from upstream tool schemas
  • Multi-server aggregation — Proxy multiple upstream MCP servers through one interface
  • Dual upstream transport — Supports both stdio and Streamable HTTP (SSE) upstream servers
  • Dual listen transport — MCPico itself listens via stdio or HTTP/SSE (configurable port)
  • Configurable timeouts — Per-server connection timeout with sensible default (30s)
  • Resource & prompt passthrough — Namespaced to avoid collisions across servers
  • Authentication — Bearer, custom header, and OAuth2 client_credentials with automatic token refresh
  • Listen endpoint auth — Protect the SSE endpoint with bearer token validation

Usage

Install

npm install -g mcpico

Configure

Create mcpico.json:

{
  "servers": [
    {
      "name": "filesystem",
      "transport": {
        "type": "stdio",
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
      }
    }
  ]
}

Run

mcpico

Connect your MCP client

Add MCPico as a server in your MCP client config:

{
  "mcpServers": {
    "mcpico": {
      "command": "mcpico",
      "args": ["--config", "/path/to/mcpico.json"]
    }
  }
}

How it works

  1. Connect to upstream MCP servers
  2. Discover their tools (tools/list)
  3. Group tools by prefix (configurable separator, default _)
    • filesystem_read_file, filesystem_write_file → group filesystem
  4. Register each group as a single MCP tool with a command string argument
  5. Forward tool calls by parsing <subcommand> {"key":"value"} and proxying to upstream
  6. Generate help dynamically from original tool schemas

Command format

<subcommand> {"arg1":"val1","arg2":"val2"}

Examples:

  • help — see all subcommands and their parameters
  • read_file {"path":"/tmp/hello.txt"} — call a specific tool
  • write_file {"path":"/tmp/out.txt","content":"hello"} — with arguments

Multi-server aggregation

MCPico can proxy multiple upstream servers simultaneously:

{
  "servers": [
    {
      "name": "filesystem",
      "transport": {
        "type": "stdio",
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
      }
    },
    {
      "name": "github",
      "transport": {
        "type": "sse",
        "url": "https://mcp-github.example.com/mcp"
      }
    }
  ]
}

Groups from different servers are merged if they share a prefix. Otherwise each server's tools appear as separate groups.

Configuration

Field Type Default Description
servers ServerConfig[] required Upstream MCP servers to proxy
separator string "_" Separator for prefix-based tool grouping
groups object {} Explicit group overrides ({ "group": ["tool1","tool2"] })
listen ListenConfig {"type":"stdio"} How MCPico exposes itself to MCP clients

ListenConfig

Field Type Required Description
type "stdio" yes Standard stdio transport
type "sse" yes HTTP/SSE — specify port and optional host
// SSE listen mode — MCPico as an HTTP endpoint
{
  "servers": [...],
  "listen": {
    "type": "sse",
    "port": 3000
  }
}

ServerConfig

Field Type Required Description
name string yes Friendly name / group namespace
transport TransportConfig yes How to connect to the upstream server
connectTimeoutMs number no Connection timeout in ms (default: 30000)

TransportConfig (stdio)

Field Type Required Description
type "stdio" yes Transport type
command string yes Executable to spawn
args string[] no Command-line arguments
env object no Environment variables
cwd string no Working directory

TransportConfig (SSE / Streamable HTTP)

Field Type Required Description
type "sse" yes Transport type
url string yes Full URL to MCP Streamable HTTP endpoint

Authentication

MCPico supports two layers of authentication:

Layer 1: Protecting the listen endpoint

When MCPico exposes an SSE endpoint, you can require a bearer token from clients:

{
  "servers": [...],
  "listen": {
    "type": "sse",
    "port": 3000,
    "auth": {
      "type": "bearer",
      "token": "${MCPICO_API_KEY}"
    }
  }
}

Clients must include Authorization: Bearer <token> in requests. Invalid or missing tokens receive a 401 response.

Layer 2: Authenticating to upstream servers

Upstream servers can require authentication. MCPico supports three methods:

Bearer token — standard Authorization: Bearer <token> header:

{
  "servers": [
    {
      "name": "internal-api",
      "transport": {
        "type": "sse",
        "url": "https://api.internal/mcp"
      },
      "auth": {
        "type": "bearer",
        "token": "${INTERNAL_KEY}"
      }
    }
  ]
}

Custom header — arbitrary headers (e.g. X-API-Key):

{
  "auth": {
    "type": "header",
    "name": "X-API-Key",
    "value": "${WIDGET_KEY}"
  }
}

OAuth 2.0 client credentials — machine-to-machine authentication with automatic token refresh:

{
  "auth": {
    "type": "oauth",
    "grant_type": "client_credentials",
    "client_id": "${PROVIDER_CLIENT_ID}",
    "client_secret": "${PROVIDER_CLIENT_SECRET}",
    "token_url": "https://auth.example.com/oauth/token",
    "scopes": ["read", "write"]
  }
}

MCPico handles the full OAuth flow:

  • Fetches initial access token on startup
  • Caches tokens in ~/.mcplico/credentials.json
  • Automatically refreshes before expiry
  • Retries on 401 with fresh tokens

All auth fields support ${ENV_VAR} interpolation — never hardcode secrets.

Auth config reference

Field Type Required Description
auth.type "bearer" | "header" | "oauth" yes Auth method
auth.token string for bearer Bearer token value
auth.name string for header Header name
auth.value string for header Header value
auth.grant_type "client_credentials" for oauth OAuth grant type
auth.client_id string for oauth OAuth client ID
auth.client_secret string for oauth OAuth client secret
auth.token_url string for oauth Token endpoint URL
auth.scopes string[] no OAuth scopes to request
auth.authorization_server_url string no Auth server URL (if different from token_url issuer)

Development

Development

npm install
npm run build    # TypeScript compilation
npm test         # Run tests (138 tests, vitest)
npm run dev      # Run directly with tsx

License

MIT

推荐服务器

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

官方
精选