AI Skill Hub 推荐使用:MCP网关 是一款优质的MCP工具。AI 综合评分 7.5 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。
MCP网关 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
MCP网关 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 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
# 安装后在 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 生效
Progressive disclosure for MCP - Minimal context bloat with on-demand tool discovery and dynamic server provisioning.
| Server | Description | Environment Variable |
|---|---|---|
github | GitHub API - issues, PRs, repos | GITHUB_PERSONAL_ACCESS_TOKEN |
gitlab | GitLab API - projects, MRs | GITLAB_PERSONAL_ACCESS_TOKEN |
slack | Slack messaging | SLACK_BOT_TOKEN |
notion | Notion workspace | NOTION_TOKEN |
linear | Linear issue tracking | LINEAR_API_KEY |
postgres | PostgreSQL database | POSTGRES_URL |
brave-search | Web search | BRAVE_API_KEY |
google-drive | Google Drive files | GDRIVE_CREDENTIALS |
sentry | Error tracking | SENTRY_AUTH_TOKEN |
stripe | Payments and billing | STRIPE_SECRET_KEY |
github-actions | CI/CD workflows | GITHUB_PERSONAL_ACCESS_TOKEN |
datadog | Monitoring and observability | DATADOG_API_KEY |
cloudflare | Edge network and Workers | CLOUDFLARE_API_TOKEN |
figma | Design files and components | FIGMA_ACCESS_TOKEN |
jira | Issue tracking | JIRA_API_TOKEN |
airtable | Spreadsheet database | AIRTABLE_TOKEN |
hubspot | CRM and marketing | HUBSPOT_ACCESS_TOKEN |
twilio | SMS and voice | TWILIO_ACCOUNT_SID |
...and 80+ more | Use gateway.catalog_search to explore | — |
See .env.example for all supported environment variables.
```bash
uvx pmcp
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.
pmcp setup pmcp setup --client claude --mode stdio pmcp setup --client opencode --mode http --write
```bash
docker run -it --rm \ -v ~/.mcp.json:/home/appuser/.mcp.json:ro \ -v ~/.env:/app/.env:ro \ ghcr.io/viperjuice/pmcp:latest
docker-compose up -d ```
uv sync --all-extras
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"
}]
}
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
[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 & ```
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:
| Server | Description | API Key |
|---|---|---|
playwright | Browser automation - navigation, screenshots, DOM inspection | Not required |
context7 | Library documentation lookup - up-to-date docs for any package | Optional (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:
| Field | Meaning |
|---|---|
startup_policy | eager, lazy, skipped, or unknown |
startup_source | Resolver source such as project, user, manifest, configured, or auto_start |
startup_skip_reason | Machine-readable skip reason such as policy_denied, missing_auth, or unknown_auto_start |
startup_env_var | Required environment variable name for missing-auth skips |
auth_state | Machine-readable downstream auth state such as missing_auth, insufficient_scope, elicitation_required, or policy_denied |
next_step | Non-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"
}
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
PMCP discovers MCP servers from:
.mcp.json in project root (highest priority)~/.mcp.json or ~/.claude/.mcp.json--config flag or PMCP_CONFIG env varpmcp init
export PMCP_LOCK_DIR=/custom/path pmcp
**Per-project lock (not recommended):**
bash pmcp --lock-dir ./.mcp-gateway ```
export GITHUB_PERSONAL_ACCESS_TOKEN=ghp_...
| Server | Description |
|---|---|
filesystem | File operations - read, write, search |
memory | Persistent knowledge graph |
fetch | HTTP requests with robots.txt compliance |
sequential-thinking | Problem solving through thought sequences |
git | Git operations via MCP |
sqlite | SQLite database operations |
time | Timezone operations |
puppeteer | Headless Chrome automation |
```bash
pmcp --lock-dir /custom/path
```bash
PMCP follows a progressive disclosure pattern - start with natural language, get recommendations, drill down as needed.
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` |
安装步骤: 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
配置说明: 使用环境变量中的令牌进行认证 PMCP_AUTH_TOKEN=mysecrettoken pmcp --transport http 避免将生产令牌传递给 `--auth-token`;命令行参数可能在共享主机上可见。 客户端必须在 `/mcp` 请求中包含 `Authorization: Bearer mysecrettoken`。 `/health` 和 `/metrics` 保留未经身份验证的设计;保护它们使用防火墙。
API/接口说明: 1. 设置 API 密钥(如果需要) export GITHUB_PERSONAL_ACCESS_TOKEN=ghp_... 无 API 密钥要求 | 服务 | 描述 | |--------|-------------| | `filesystem` | 文件操作 - 读取、写入、搜索 | | `memory` | 持久性知识图谱 | | `fetch` | HTTP 请求,遵循 robots.txt | | `sequential-thinking` | 问题解决通过思维序列 | | `git` | Git 操作 v
工作流 / 模块说明: PMCP 追随一个进步的披露模式 - 开始使用自然语言,获取建议,随着需要逐步深入。
高质量开源MCP工具,值得关注
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
总体来看,MCP网关 是一款质量良好的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | 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 |
收录时间:2026-05-28 · 更新时间:2026-05-30 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端