能力标签
MCP网关
🔌
MCP工具

MCP网关

基于 Python · 让 AI 助手直接操作你的系统与工具
英文名:pmcp
⭐ 9 Stars 🍴 3 Forks 💻 Python 📄 MIT 🏷 AI 7.5分
7.5AI 综合评分
mcppythonmeta-server
✦ AI Skill Hub 推荐

AI Skill Hub 推荐使用:MCP网关 是一款优质的MCP工具。AI 综合评分 7.5 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。

📚 深度解析

MCP网关 是一款基于 MCP(Model Context Protocol)标准协议的 AI 工具扩展。MCP 协议由 Anthropic 开发并开源,旨在建立 AI 模型与外部工具之间的标准化通信接口,目前已被 Claude Desktop、Claude Code、Cursor 等主流 AI 工具采纳。

通过安装 MCP网关,你的 AI 助手将获得额外的工具调用能力,可以用自然语言直接操控该工具的功能,无需学习复杂的命令行语法。MCP 工具的核心价值在于"一次配置,永久增强"——配置完成后,每次与 AI 对话时都可以无缝调用这些工具。

在技术实现上,MCP 工具通过标准的 JSON-RPC 协议与 AI 客户端通信,工具的功能以"工具列表"的形式暴露给 AI 模型,AI 可以按需调用。MCP网关 提供了结构化的工具调用接口,使 AI 模型能够精确地理解和使用每个功能点,显著降低 AI 在工具使用上的错误率。

与传统的 API 集成相比,MCP 工具的优势在于无需编写代码——用户只需在配置文件中添加几行 JSON,即可让 AI 获得全新能力。AI Skill Hub 将 MCP网关 评为 AI 评分 7.5 分,属于同类工具中的优质选择。

📋 工具概览

MCP网关 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

GitHub Stars
⭐ 9
开发语言
Python
支持平台
Windows / macOS / Linux
维护状态
轻量级项目,按需更新
开源协议
MIT
AI 综合评分
7.5 分
工具类型
MCP工具
Forks
3

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

MCP网关 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

📌 核心特色
  • 通过标准 MCP 协议与 Claude、Cursor 等主流 AI 客户端深度集成
  • 提供结构化工具调用接口,显著降低 AI 集成复杂度
  • 支持 Claude Desktop 和 Claude Code 无缝接入,开箱即用
  • 可与其他 MCP 工具组合叠加,构建完整 AI 工作站
  • 轻量无侵入设计,不影响现有系统架构
🎯 主要使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/ViperJuice/pmcp

# 方式二:手动配置 claude_desktop_config.json
{
  "mcpServers": {
    "mcp--": {
      "command": "npx",
      "args": ["-y", "pmcp"]
    }
  }
}

# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
📋 安装步骤说明
  1. 确认已安装 Node.js(v18 或以上版本)
  2. 打开 Claude Desktop 或 Claude Code 的 MCP 配置文件
  3. 按「交给 Agent 安装 → Claude Desktop」标签中的 JSON 配置填入 mcpServers 字段
  4. 保存配置文件并重启 Claude 客户端
  5. 重启后,在对话中即可使用本工具
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 安装后在 Claude 对话中直接使用
# 示例:
用户: 请帮我用 MCP网关 执行以下任务...
Claude: [自动调用 MCP网关 MCP 工具处理请求]

# 查看可用工具列表
# 在 Claude 中输入:"列出所有可用的 MCP 工具"
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
// claude_desktop_config.json 配置示例
{
  "mcpServers": {
    "mcp__": {
      "command": "npx",
      "args": ["-y", "pmcp"],
      "env": {
        // "API_KEY": "your-api-key-here"
      }
    }
  }
}

// 保存后重启 Claude Desktop 生效
📑 README 深度解析 真实文档 完整度 78/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

PMCP - Progressive MCP

PyPI version License: MIT

Progressive disclosure for MCP - Minimal context bloat with on-demand tool discovery and dynamic server provisioning.

Requires API Key

ServerDescriptionEnvironment Variable
githubGitHub API - issues, PRs, reposGITHUB_PERSONAL_ACCESS_TOKEN
gitlabGitLab API - projects, MRsGITLAB_PERSONAL_ACCESS_TOKEN
slackSlack messagingSLACK_BOT_TOKEN
notionNotion workspaceNOTION_TOKEN
linearLinear issue trackingLINEAR_API_KEY
postgresPostgreSQL databasePOSTGRES_URL
brave-searchWeb searchBRAVE_API_KEY
google-driveGoogle Drive filesGDRIVE_CREDENTIALS
sentryError trackingSENTRY_AUTH_TOKEN
stripePayments and billingSTRIPE_SECRET_KEY
github-actionsCI/CD workflowsGITHUB_PERSONAL_ACCESS_TOKEN
datadogMonitoring and observabilityDATADOG_API_KEY
cloudflareEdge network and WorkersCLOUDFLARE_API_TOKEN
figmaDesign files and componentsFIGMA_ACCESS_TOKEN
jiraIssue trackingJIRA_API_TOKEN
airtableSpreadsheet databaseAIRTABLE_TOKEN
hubspotCRM and marketingHUBSPOT_ACCESS_TOKEN
twilioSMS and voiceTWILIO_ACCOUNT_SID
...and 80+ moreUse gateway.catalog_search to explore

See .env.example for all supported environment variables.

Installation

```bash

Or run directly without installing

uvx pmcp

Configure with `pmcp setup`

PMCP includes a wizard-style helper that can render ready-to-use MCP client config for Claude and OpenCode. The generated config only connects your client to the PMCP gateway. Downstream MCP servers stay lazy until first use unless you add them to autoStart in your .mcp.json.

Use pmcp setup to print the generated config:

pmcp setup --client claude --mode stdio    # Claude local stdio
pmcp setup --client claude --mode http     # Claude shared-service HTTP
pmcp setup --client opencode --mode stdio  # OpenCode local stdio
pmcp setup --client opencode --mode http   # OpenCode shared-service HTTP

Named profiles cover the common modes:

pmcp setup --profile local-stdio
pmcp setup --profile shared-local-http
pmcp setup --profile authenticated-shared-http
pmcp setup --profile ci

Write directly into your client config with --write:

pmcp setup --client claude --mode http --write

Without --write, pmcp setup prints the config so you can paste it into: - Claude: ~/.mcp.json - OpenCode: ~/.config/opencode/opencode.json

Use shared-service HTTP mode when running one PMCP service for multiple sessions or clients. Use single-process stdio mode for local testing.

Render client setup snippets

pmcp setup pmcp setup --client claude --mode stdio pmcp setup --client opencode --mode http --write

Docker

```bash

Using Docker

docker run -it --rm \ -v ~/.mcp.json:/home/appuser/.mcp.json:ro \ -v ~/.env:/app/.env:ro \ ghcr.io/viperjuice/pmcp:latest

Using Docker Compose

docker-compose up -d ```

Quick Start

Example: Adding GitHub Support

You: "I need to manage GitHub issues"

gateway.request_capability({ query: "github issues" })

Returns (if not already configured):

{
  "status": "candidates",
  "candidates": [{
    "name": "github",
    "candidate_type": "server",
    "is_running": false,
    "requires_api_key": true,
    "env_var": "GITHUB_PERSONAL_ACCESS_TOKEN",
    "env_instructions": "Create at https://github.com/settings/tokens with repo scope"
  }]
}

Start with bearer auth from the environment

PMCP_AUTH_TOKEN=mysecrettoken pmcp --transport http


Avoid passing production tokens with `--auth-token`; command-line arguments can
be visible in process listings on shared hosts.

Clients must then include `Authorization: Bearer mysecrettoken` on `/mcp` requests.
`/health` and `/metrics` remain unauthenticated by design; protect them with
firewall rules, IP allowlists, or reverse-proxy policy before any non-localhost
exposure.

**Assumptions and trust model:**

- PMCP binds to `127.0.0.1` by default — not safe to expose publicly without
  `PMCP_AUTH_TOKEN`.
- Config files (`.mcp.json`) are trusted inputs — treat them like code; do not load untrusted configs.
- Secrets in `.env` files are passed to child MCP server processes; protect the `.env` file with filesystem permissions.

**Production background service (Linux systemd):**
ini

~/.config/systemd/user/pmcp.service

[Unit] Description=PMCP MCP Gateway

[Service] Environment=PMCP_AUTH_TOKEN=replace-with-secret-token ExecStart=/usr/local/bin/pmcp --transport http Restart=on-failure

[Install] WantedBy=default.target

bash systemctl --user enable --now pmcp

Or with nohup:
bash PMCP_AUTH_TOKEN=replace-with-secret-token nohup pmcp --transport http >> ~/.pmcp/logs/gateway.log 2>&1 & ```

Optional Eager Startup

Packaged manifest servers do not start automatically. They are lazy by default: PMCP can discover or provision them from the manifest, then connect on first use.

To eagerly start a server every time PMCP starts, list it in top-level autoStart:

{
  "autoStart": ["playwright", "context7"],
  "mcpServers": {}
}

Common opt-in choices:

ServerDescriptionAPI Key
playwrightBrowser automation - navigation, screenshots, DOM inspectionNot required
context7Library documentation lookup - up-to-date docs for any packageOptional (for higher rate limits)

Startup policy decisions are visible through gateway.health and live pmcp status --verbose. Health rows keep the existing name, status, tool_count, and error fields, and may also include:

FieldMeaning
startup_policyeager, lazy, skipped, or unknown
startup_sourceResolver source such as project, user, manifest, configured, or auto_start
startup_skip_reasonMachine-readable skip reason such as policy_denied, missing_auth, or unknown_auto_start
startup_env_varRequired environment variable name for missing-auth skips
auth_stateMachine-readable downstream auth state such as missing_auth, insufficient_scope, elicitation_required, or policy_denied
next_stepNon-secret suggested next action when an auth state needs operator action

For persistent administration, use the config tools:

gateway.config_status({})
gateway.get_startup_policy({})
gateway.set_startup_policy({
  "operation": "add",
  "names": ["playwright"],
  "source": "project"
})

gateway.set_startup_policy is preview-only by default. To write, select exactly one source or path and pass both "apply": true and "dry_run": false. The writer updates only top-level autoStart, preserves unrelated .mcp.json keys and server definitions, writes atomically, and returns a refresh next step instead of silently reconnecting servers. Diagnostics report stale autoStart, legacy disableAutoStart conflicts, policy-denied rows, and missing-auth rows without printing secret values.

PMCP negotiates the current MCP protocol version with downstream servers and continues to connect to older supported servers. The local conformance matrix covers negotiated status handling for 2024-11-05, 2025-03-26, 2025-06-18, and 2025-11-25, with 2025-11-25 preferred for new initialization attempts. gateway.health and pmcp status --json can include the negotiated protocol_version and declared server capabilities when a connected server reports them.

Modern MCP task support is conservative. PMCP forwards task-augmented tool calls only when a tool advertises execution.taskSupport and the downstream server advertises task capability. Required-task tools fail before dispatch if the server does not advertise task support. Task records are transient gateway state, not durable PMCP storage.

The tenant code-mode host contract in specs/tenant-code-mode-host-contract.md freezes the PMCP/companion-server boundary for future hosted sandbox execution. PMCP remains the broker; the companion tenant server remains the execution authority.

Gateway observability is local and structured. gateway.invoke accepts trace context through _meta.traceparent, _meta.tracestate, and _meta.baggage and preserves those string values on PMCP-owned downstream request metadata. The same keys are tolerated on HTTP requests. PMCP does not require or configure an OpenTelemetry exporter.

gateway.health may include gateway_diagnostics and recent audit_events. Diagnostics report transport/header compatibility, trace support, audit buffer readiness, auth metadata presence, and rate-limit configuration without secret values. Audit events are bounded in memory and include method/action, server or tool identity, protocol version when known, task ID when present, outcome, latency, auth state, and redacted error text.

PMCP's Streamable HTTP endpoint remains compatible with existing clients that send no draft headers. It also tolerates MCP-Protocol-Version, Mcp-Method, and Mcp-Name request headers for clients experimenting with draft MCP transport conventions. These headers are compatibility inputs, not a promise that PMCP implements every draft MCP extension.

Servers stopped with gateway.disconnect_server remain visible in health as offline or lazy when PMCP still knows their configuration, and startup policy observation fields are preserved.

Example missing-auth health row:

{
  "name": "github",
  "status": "offline",
  "tool_count": 0,
  "startup_policy": "skipped",
  "startup_source": "manifest",
  "startup_skip_reason": "missing_auth",
  "startup_env_var": "GITHUB_PERSONAL_ACCESS_TOKEN"
}

Guidance Configuration

Create ~/.claude/gateway-guidance.yaml:

guidance:
  level: "minimal"  # Options: "off", "minimal", "standard"

  layers:
    mcp_instructions: true   # L0 philosophy
    code_hints: true         # L1 hints
    code_snippets: false     # L2 examples (default: off)
    methodology_resource: true  # L3 guide

Levels: - minimal (default): L0 + L1 (~200 tokens overhead) - standard: L0 + L1 + L2 (~320 tokens overhead) - off: No guidance

Configuration

Config Discovery

PMCP discovers MCP servers from:

  1. Project config: .mcp.json in project root (highest priority)
  2. User config: ~/.mcp.json or ~/.claude/.mcp.json
  3. Custom config: Via --config flag or PMCP_CONFIG env var

Initialize config (interactive)

pmcp init

Environment variable

export PMCP_LOCK_DIR=/custom/path pmcp


**Per-project lock (not recommended):**
bash pmcp --lock-dir ./.mcp-gateway ```

1. Set API key (if required)

export GITHUB_PERSONAL_ACCESS_TOKEN=ghp_...

No API Key Required

ServerDescription
filesystemFile operations - read, write, search
memoryPersistent knowledge graph
fetchHTTP requests with robots.txt compliance
sequential-thinkingProblem solving through thought sequences
gitGit operations via MCP
sqliteSQLite database operations
timeTimezone operations
puppeteerHeadless Chrome automation

CLI Commands

```bash

CLI flag

pmcp --lock-dir /custom/path

Missing API Key

```bash

Progressive Disclosure Workflow

PMCP follows a progressive disclosure pattern - start with natural language, get recommendations, drill down as needed.

Troubleshooting

🇨🇳 中文文档镜像 AI 翻译 2026-06-03
英文原文章节由系统翻译为中文摘要,便于快速理解。完整原文见上方 "📑 README 深度解析"。
📌 简介

PMCP 是一个进步的 MCP(Minimal Context Bloat with on-demand tool discovery and dynamic server provisioning)项目,旨在提供最小的上下文膨胀和按需工具发现以及动态服务器分配。

📋 环境依赖

PMCP 需要 API 密钥,具体要求如下:| 服务 | 描述 | 环境变量 | |--------|-------------|---------------------| | `github` | GitHub API - issues, PRs, repos | `GITHUB_PERSONAL_ACCESS_TOKEN` | | `gitlab` | GitLab API - projects, MRs | `GITLAB_PERSONAL_ACCESS_TOKEN` |

🛠 安装步骤(Docker/pip/源码)

安装步骤: Or run directly without installing uvx pmcp Configure with `pmcp setup` PMCP 包含一个向导式帮助工具,可以生成一个可用的 MCP 客户端配置文件,用于 Claude 和 OpenCode。生成的配置文件只连接 PMCP 网关,下游 MCP 服务器在首次使用时才会被激活,除非您将它们添加到您的 `.mcp.json` 中的 `autoStart` 中。 使用 `pmcp setup` 打印生成的配置: ```bash pmcp setup --client claude --mode stdio # Claude local stdio pm

🚀 使用教程

快速入门示例: 添加 GitHub 支持 ``` You: "I need to manage GitHub issues" gateway.request_capability({ query: "github issues" }) ``` 如果尚未配置,返回: ```json { "status": "candidates", "candidates": [{ "name": "github", "candidate_type": "server", "is_running": false, "requires_api_key": true, "env_var": "GITHUB_PERSONAL_ACCESS_TOKEN", "env_instructions": "Create at https://github.com/settings/tokens with repo

⚙️ 配置说明(含 MCP / env)

配置说明: 使用环境变量中的令牌进行认证 PMCP_AUTH_TOKEN=mysecrettoken pmcp --transport http 避免将生产令牌传递给 `--auth-token`;命令行参数可能在共享主机上可见。 客户端必须在 `/mcp` 请求中包含 `Authorization: Bearer mysecrettoken`。 `/health` 和 `/metrics` 保留未经身份验证的设计;保护它们使用防火墙。

🔌 API 说明

API/接口说明: 1. 设置 API 密钥(如果需要) export GITHUB_PERSONAL_ACCESS_TOKEN=ghp_... 无 API 密钥要求 | 服务 | 描述 | |--------|-------------| | `filesystem` | 文件操作 - 读取、写入、搜索 | | `memory` | 持久性知识图谱 | | `fetch` | HTTP 请求,遵循 robots.txt | | `sequential-thinking` | 问题解决通过思维序列 | | `git` | Git 操作 v

🔄 工作流/模块

工作流 / 模块说明: PMCP 追随一个进步的披露模式 - 开始使用自然语言,获取建议,随着需要逐步深入。

🎯 aiskill88 AI 点评 A 级 2026-05-28

高质量开源MCP工具,值得关注

📚 实用指南(长尾问题)
适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
  • Python 依赖冲突:建议用 venv / uv 隔离环境
部署方案
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
pmcp 中文教程pmcp 安装报错怎么办pmcp MCP 配置pmcp 与同类工具对比pmcp 最佳实践pmcp 适合谁用

⚡ 核心功能

👥 适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
⭐ 最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
  • Python 依赖冲突:建议用 venv / uv 隔离环境

👥 适合人群

Claude Desktop / Claude Code 用户AI 工具开发者需要扩展 AI 能力的专业人士自动化工程师

🎯 使用场景

  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站

⚖️ 优点与不足

✅ 优点
  • +MIT 协议,可免费商用
  • +标准化 MCP 协议,生态互联性强
  • +与 Claude 官方生态无缝对接
  • +即插即用,配置简单快捷
⚠️ 不足
  • 依赖 Claude 客户端,非 Claude 用户无法使用
  • MCP 协议仍在持续演进,接口可能变更
  • 需要一定的配置步骤
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。

🔗 相关工具推荐

📚 相关教程推荐
📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🗺️ 相关解决方案
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

pmcp 是一款Python开发的AI辅助工具。开源MCP工具:MCP Gateway - A meta-server for minimal Claude Code tool bloat with progressive 。⭐9 · Python 主要应用场景包括:minimal Claude Code工具集成。
💡 AI Skill Hub 点评

总体来看,MCP网关 是一款质量良好的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。

⬇️ 获取与下载
⬇ 下载源码 ZIP

✅ MIT 协议 · 可免费商用 · 直接从 aiskill88 服务器下载,无需跳转 GitHub

📚 深入学习 MCP网关
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 pmcp
原始描述 开源MCP工具:MCP Gateway - A meta-server for minimal Claude Code tool bloat with progressive 。⭐9 · Python
Topics mcppythonmeta-server
GitHub https://github.com/ViperJuice/pmcp
License MIT
语言 Python
🔗 原始来源
🐙 GitHub 仓库  https://github.com/ViperJuice/pmcp

收录时间:2026-05-28 · 更新时间:2026-05-30 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。