Mcpx 5e8ad995

MCP运维云端

提供方 rohitgs28

运维云端 stdio · 本地进程 OAuth 授权 社区 / 第三方 ClaudeCursorVS Code
查看接入方式

MCPX是一个轻量级的MCP服务器网关代理,提供认证、速率限制、工具级访问控制和审计日志功能,无需修改现有服务器。

一句话选型结论

按资料字段整理

Mcpx 5e8ad995 属于运维云端类 MCP 服务器,stdio · 本地进程,OAuth 授权,可直接接入 Claude、Cursor、VS Code,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类运维云端 传输方式stdio · 本地进程 鉴权OAuth 授权 部署方式本地部署
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 4 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

运维云端
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量4暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

网关代理Go本地部署认证速率限制访问控制审计日志

安装与配置

stdio · 本地进程 OAuth 授权
客户端在本机拉起子进程,数据不出本机
docker run -p 8080:8080 -v $(pwd)/mcpx.yaml:/etc/mcpx/mcpx.yaml mcpx

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Docker,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 4 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
云资源查询

查实例、存储、账单等云上资源状态。

部署与发布

把部署、重启、回滚这类操作接进对话。

监控与告警

拉取监控指标,异常时让模型帮你判断。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 4 个工具,职责相对集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude、Cursor、VS Code,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好OAuth 授权对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在运维云端场景里让模型直接调用外部能力的人。
  • 已经在用 Claude、Cursor 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Mcpx 5e8ad995当前 4 stdio · 本地进程 本地部署 有 2026-05-17
lobehub 未标注 stdio · 本地进程 本地部署 有 2026-04-11
TrendRadar 未标注 stdio · 本地进程 本地部署 有 2026-04-13
Ui Tars Desktop 8a825770 未标注 stdio · 本地进程 本地部署 有 2026-05-17
ruflo 未标注 stdio · 本地进程 本地部署 有 2026-04-13
FastGPT 未标注 stdio · 本地进程 本地部署 有 2026-04-11

服务器档案

运维云端
字段来自项目仓库与公开索引,中文说明由本站标注
提供方rohitgs28上游标注的维护方 rohitgs28
分类运维云端本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式OAuth 授权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · Docker本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

25.2 KB
来自项目仓库与上游目录的原文,未做删改

mcpx

Secure your MCP servers in 5 minutes. One binary. One config file. No infrastructure to run.


What is mcpx, in plain English?

MCP servers give AI assistants real tools — the ability to read your files, query your database, call your APIs. That is powerful, but out of the box there is a catch: any client that connects can call any tool, with any input, as often as it likes. No login, no limits, no record of what happened.

mcpx is the checkpoint you put in front of them — think of it as a bouncer with a guest list, standing between your AI assistants and your tools:

  • ✅ Checks ID — only clients with a valid token or key get in (auth)
  • 🚫 Blocks the dangerous stuff — you decide which tools each client may call, and with what arguments (policy)
  • ⏱️ Stops abuse — caps how many calls come through per second (rate limiting)
  • 📝 Keeps a logbook — records who called what, when, and whether it was allowed (audit, metrics, tracing)
  • 🕵️ Catches tampering — flags when a server secretly rewrites a tool you already trusted (integrity pinning)

It is one small binary and one YAML file — no Kubernetes, no Docker Desktop, no gateway cluster. You point your AI clients at mcpx instead of directly at your servers, and your servers do not change at all.

Who is it for? Developers and teams running MCP servers behind Claude, Cursor, VS Code, or custom agents who want a lock on the door before going to production.```
MCP Client (Claude, Cursor, etc.)
│
▼
┌────────┐
│ mcpx │ auth · rate limit · policy · audit · metrics · tracing · tool integrity
└────────┘
│
┌───┴────────┐
▼ ▼
Server A Server B
(filesystem) (database)


## Why mcpx?

MCP servers are powerful but have **no built-in access control**. Any connected client can call any tool with any arguments. In production, you need auth, rate limiting, policies, and audit trails.

Most MCP gateway solutions require Kubernetes clusters, Docker Desktop, or full API gateway stacks. **mcpx doesn't.** It's a single binary with a single YAML config file.

| | mcpx | Microsoft MCP Gateway | Docker MCP Gateway | Kong AI MCP Proxy |
|---|---|---|---|---|
| **Setup time** | 5 minutes | Hours (K8s required) | Docker Desktop | Kong cluster |
| **Dependencies** | Single static binary | Kubernetes, Azure | Docker | Kong, Lua runtime |
| **Config** | One YAML file | CRDs + Helm charts | UI + profiles | kong.yaml + plugins |
| **Binary size** | ~10 MB | Cluster | Docker image | Full gateway |
| **Target users** | Devs & small teams | Enterprise Azure | Docker users | Existing Kong users |
| **Prometheus metrics** | ✅ Built-in | Via adapter | Via Docker | Via plugin |
| **Deep health checks** | ✅ Per-backend | ❌ | ❌ | Via plugin |
| **License** | MIT | MIT | Apache 2.0 | Apache 2.0 |

## Quick Start```bash
# Install from source
git clone https://github.com/rohitgs28/mcpx
cd mcpx
go build -o mcpx ./cmd/mcpx

# Or install directly
go install github.com/rohitgs28/mcpx/cmd/mcpx@latest

# Run with config
./mcpx -c mcpx.yaml

# Hot-reload the config file on every change
./mcpx -c mcpx.yaml -watch

Send SIGHUP to force a reload at any time (kill -HUP $(pidof mcpx)). Reloads rebuild the handler chain atomically: in-flight requests finish against the old config, new ones see the new config. Invalid configs are rejected and the previous config keeps running.```bash

Or use Docker

docker build -t mcpx .
docker run -p 8080:8080 -v $(pwd)/mcpx.yaml:/etc/mcpx/mcpx.yaml mcpx


The gateway starts on `:8080`. Point your MCP clients to `http://localhost:8080/mcp/{server_name}` instead of directly to your backend servers.

## Try it in 60 seconds

The repo ships a tiny mock MCP server so you can see the gateway work with no setup.```bash
# One command (Docker):
docker compose up --build

# …or run locally in two terminals:
go run ./examples/mock-mcp                  # terminal 1 - mock server on :3001
go run ./cmd/mcpx -c examples/demo.yaml     # terminal 2 - gateway on :8080

Then list the tools through the gateway:```bash
curl -s localhost:8080/mcp/demo \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | jq '.result.tools[].name'

"echo"

"read_file" ← dangerous_delete is filtered out by policy

curl -s localhost:8080/mcp/demo \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"dangerous_delete"}}'

{"jsonrpc":"2.0",...,"error":{"code":-32600,"message":"tool \"dangerous_delete\" is denied ..."}} (HTTP 403)


The mock advertises `echo`, `read_file`, and `dangerous_delete`; the demo policy denies the last one, so it's hidden from `tools/list` and blocked on call.

## Configuration```yaml
listen: ":8080"

servers:
  - name: filesystem
    url: http://localhost:3001
    policy:
      allow_tools:
        - read_file
        - list_directory
      deny_tools:
        - write_file
        - delete_file

  - name: database
    url: http://localhost:3002
    policy:
      read_only: true  # blocks tools/call, allows tools/list

  - name: github            # local stdio server, spawned by the gateway
    transport: stdio
    command: npx
    args: ["-y", "@modelcontextprotocol/server-github"]
    env:
      GITHUB_PERSONAL_ACCESS_TOKEN: "ghp_..."

auth:
  enabled: true
  type: bearer
  token: "your-secret-token"

audit:
  enabled: true
  output: stdout

rate_limit:
  enabled: true
  rps: 100
  burst: 20
  per_tool: true
  tool_rps: 10
  tool_burst: 5

inspection:
  tool_integrity: enforce   # off | warn | enforce - pin tool schemas, block mutation
  filter_tools_list: true   # hide policy-denied tools from tools/list responses

tracing:
  enabled: true
  exporter: otlp            # otlp (OTLP/HTTP, default) | stdout (debug)
  endpoint: localhost:4318  # OTLP/HTTP collector (required for exporter: otlp)
  sample_ratio: 1.0         # 0.0-1.0, fraction of requests traced (default 1.0)

cache:
  enabled: true             # per-tool opt-in under servers[].cache.tools
  max_entries: 1000
  default_ttl: 60s

Features

🔐 Authentication

Bearer token, API key, and OAuth 2.1 authentication. Requests without valid credentials are rejected before reaching any backend.

In oauth mode mcpx acts as an OAuth 2.1 protected resource server aligned with the MCP authorization spec: it verifies JWT signatures (RSA RS*/PS*, ECDSA ES256/ES384/ES512, and Ed25519 EdDSA) against the authorization server's JWKS and enforces audience binding (RFC 8707) - a token is rejected unless its aud claim names this gateway, which is the spec's defense against token-passthrough and confused-deputy attacks. It also publishes RFC 9728 Protected Resource Metadata at /.well-known/oauth-protected-resource and advertises it via WWW-Authenticate on 401 responses.```yaml
auth:
enabled: true
type: oauth
oauth:
resource: "https://gateway.example.com/mcp" # expected token audience
jwks_uri: "https://auth.example.com/.well-known/jwks.json"
issuer: "https://auth.example.com" # optional
authorization_servers:
- "https://auth.example.com"
algorithms: [ES256, RS256] # optional allow-list (default: all asymmetric)


Each JWKS key is bound to the algorithms its type permits. RSA keys verify `RS*`/`PS*`, each EC curve verifies only its own `ES*` algorithm, and Ed25519 keys verify only `EdDSA`. A key's JWK `alg`, when present, narrows that to exactly one algorithm. A token can therefore never choose to have a key used with a different algorithm, which closes off algorithm-confusion attacks. HMAC (`HS*`) and `none` are never accepted. RSA keys smaller than 2048 bits, encryption keys (`use: enc`), and malformed or off-curve EC keys in the JWKS are skipped.

The credential a client presents to mcpx (the `Authorization` header, or the API-key header) is stripped once it is verified and is **never forwarded to a backend**. Backends that need their own credentials get them through secret injection, described next.

### 🔑 Secret Injection

Keep backend credentials in the gateway so clients never see them. `servers[].headers` is set on every request forwarded to that backend and replaces any client header with the same name. Values can reference secrets instead of holding them in plain text:

| Reference | Resolves to |
|---|---|
| `${env:NAME}` | the environment variable `NAME` |
| `${file:PATH}` | the contents of `PATH`, with trailing newlines trimmed (works with Docker and Kubernetes secret mounts) |
| `$${` | a literal `${` |
```yaml
servers:
  - name: github
    url: https://api.githubcopilot.com/mcp/
    headers:
      Authorization: "Bearer ${file:/run/secrets/github_token}"
      X-Tenant: acme
  - name: local
    transport: stdio
    command: npx
    args: ["-y", "some-mcp-server"]
    env:
      API_KEY: ${env:SOME_API_KEY}     # stdio servers get secrets via env

auth:
  enabled: true
  type: bearer
  token: ${env:MCPX_GATEWAY_TOKEN}     # gateway tokens can be references too

References work in servers[].headers, servers[].env, auth.token, auth.clients[].token, and tracing.headers. Backend URLs are left as written because they show up in logs and on /servers. Resolution fails closed: an unset variable, an unreadable file, or an empty value stops startup (or rejects the reload). Error messages name the reference and never the value. References are resolved again on every reload. To rotate a credential, update the secret file and send SIGHUP; -watch only watches the config file itself. Stdio children restart automatically when their resolved env changes.

🔒 Backend TLS and mTLS

servers[].tls sets how mcpx connects to an https backend. It can trust a private CA, present a client certificate for mutual TLS, override the verified server name, and require a minimum TLS version. Health probes use the same settings.```yaml
servers:
- name: internal-tools
url: https://10.0.4.12:8443/mcp
tls:
ca_file: /etc/mcpx/internal-ca.pem # replaces system roots for this backend
cert_file: /etc/mcpx/gateway.pem # client certificate (mTLS)
key_file: /etc/mcpx/gateway.key
server_name: tools.internal # SNI and verification name (default: the url host)
min_version: "1.3" # "1.2" (default) or "1.3"


Certificates and keys are loaded and checked when the config loads. A missing file, a CA file with no certificates, or a key that doesn't match its certificate stops startup or rejects the reload, instead of failing on the first request. Files are read again on every reload, so to rotate a certificate, replace the files and send `SIGHUP`. `insecure_skip_verify: true` turns verification off and is meant for local testing only.

### 🛡️ Tool-Level Access Control

Define allow and deny lists per server. Use `read_only: true` to let clients discover tools without calling them. Deny lists take precedence.```yaml
policy:
  allow_tools: [read_file, list_directory]
  deny_tools: [write_file, delete_file]

With inspection.filter_tools_list: true, denied tools are also stripped from tools/list responses, so the model never even sees a tool it cannot call. Filtering is per client when auth provides an identity.

🎯 Argument-Level Rules

Constrain what a tool may be called with, not just whether it may be called. Constraints (equals, one_of, prefix, suffix, regex, required) are ANDed per argument and evaluated deterministically - violations return a 403 naming the violated rule.```yaml
policy:
tool_rules:
read_file:
args:
path: { prefix: "/data/" }
query:
args:
sql: { regex: "^SELECT ", required: true }


Scalar values compare as strings (bools and numbers normalized); a rule that targets a non-scalar value fails closed. `prefix` is a literal check - no path canonicalization.

### 👥 Per-Client Policies

Give each caller an identity and a policy. Bearer/API-key auth accepts multiple named credentials; OAuth derives the identity from a JWT claim (`identity_claim`, default `sub`). The effective decision is the **intersection** of the server policy and the client's override - both must allow a call, so overrides can only restrict, never widen, the baseline.```yaml
auth:
  enabled: true
  type: bearer
  clients:
    - { name: ci-bot,  token: "ci-secret" }
    - { name: analyst, token: "analyst-secret" }

clients:
  ci-bot:
    servers:
      filesystem:
        allow_tools: [read_file]

Each client sees its own filtered tools/list, audit entries carry the client name, and the tool-call metric gains a client label.

📡 Streaming (SSE) Pass-Through

MCP Streamable HTTP responses (Content-Type: text/event-stream) stream through the gateway unbuffered - events reach the client as the backend emits them, and streams may outlive the server's write timeout. Request-side auth, policy, and rate limiting apply as usual. To keep the tools/list security guarantee, when inspection is enabled the gateway pins tools/list requests to JSON responses (rewrites Accept), so integrity pinning and list filtering cannot be bypassed by a streaming response.

🖥️ Stdio Transport (Local MCP Servers)

Most real-world MCP servers are local processes spoken to over stdin/stdout (npx ..., uvx ...). With transport: stdio the gateway spawns the server itself and bridges HTTP JSON-RPC onto it - so auth, policies, rate limiting, audit logging, tool integrity pinning, and list filtering all apply to local servers exactly as they do to HTTP backends.```yaml
servers:
- name: filesystem
transport: stdio
command: npx
args: ["-y", "@modelcontextprotocol/server-filesystem", "/data"]
env: # extra environment for the child
LOG_LEVEL: info
workdir: /data # optional working directory
request_timeout: 30s # per-request reply deadline (default 30s)
policy:
allow_tools: [read_file, list_directory]


One shared child process serves all gateway clients: it is spawned lazily on first request, respawned (with backoff) if it crashes, and retired when its config entry changes or disappears. Request IDs are rewritten internally so concurrent clients never collide, and the MCP `initialize` handshake is cached - later clients get the cached result, and the handshake is replayed automatically after a respawn so existing sessions keep working. Children survive config hot-reloads that leave their entry untouched, and a graceful gateway shutdown closes their stdin (killing only those that linger).

Notifications return `202 Accepted` (mirroring the Streamable HTTP spec). Server-initiated messages (sampling, log notifications) are dropped with a log line - there is no single addressable client on a shared gateway.

### ⚡ Circuit Breaker

After a configurable number of consecutive backend failures (transport errors or `5xx`), the gateway fails fast with `503` instead of queueing requests against a dead upstream. After a cooldown, limited probe requests test recovery. State survives config hot-reloads.```yaml
circuit_breaker:
  enabled: true
  failure_threshold: 5
  cooldown: 30s
  half_open_max: 1

💾 Response Caching

Repeat calls to expensive, idempotent tools can be served from memory instead of the backend. Caching is deny-by-default: enabling the section caches nothing until you name a tool.```yaml
cache:
enabled: true
max_entries: 1000 # bounded LRU
default_ttl: 60s # used by tools with no ttl of their own
max_body_bytes: 262144 # 256 KiB; larger responses pass through uncached
purge_on_reload: false # true empties the cache on every config reload

servers:
- name: docs
url: http://localhost:3004
cache:
tools:
search_docs: { ttl: 5m }
get_page: {} # inherits default_ttl


Every response carries `X-Mcpx-Cache: hit|miss`, and hits also carry an `Age` header. Cached entries survive config hot-reloads, and `mcpx_cache_lookups_total` breaks hits and misses down per server and tool.

**What is never cached** - the cache is designed so a wrong answer is impossible rather than unlikely:

- **Anything a client is not allowed to call.** Policy is evaluated *before* the cache, so a newly-denied tool can never be answered from a warm entry.
- **Failures.** JSON-RPC errors, MCP results with `isError: true`, and non-`200` responses are skipped - a transient blip must not be pinned for the whole TTL.
- **Streams.** An SSE or event-stream response passes straight through to the client, unbuffered.
- **Oversized bodies.** Responses past `max_body_bytes` are streamed through, so one huge result cannot evict the whole cache.
- **Tools you didn't name.** No wildcards, no heuristics about which tools "look" read-only.

Entries are keyed by **server + tool + client identity + canonical arguments**, so two clients with different per-client policies never share one, and argument key order doesn't split entries. Cached bodies are re-pointed at the current request's JSON-RPC `id` before being served, so a client always sees a reply to the request it actually sent.

Concurrent identical misses are collapsed by **single-flight**: the first caller fetches, the rest wait and share its result rather than stampeding the backend. A waiter whose client disconnects stops waiting instead of outliving its request.

Because a hit costs the backend nothing, the cache sits *in front of* the circuit breaker: cached tools keep answering while a backend is down.

### 🔎 Tool Integrity Pinning

mcpx hashes the **full schema** of every tool (name, description, and input schema) the first time a backend advertises it, then flags any later change. This deterministically detects **rug-pull tool mutation** (CVE-2025-54136), cross-server shadowing, and full-schema poisoning - attacks where a server silently rewrites a tool the client already approved.```yaml
inspection:
  tool_integrity: enforce   # off | warn | enforce
  • warn - log a violation to the audit trail, pass the tool through.
  • enforce - log it and drop the mutated tool from tools/list so clients can't invoke it.

The baseline lives in memory and survives config hot-reloads. Hashing is canonical (key-order independent), so legitimate re-serialization doesn't trigger false positives.

> Scope note: this defends static tool-schema integrity, which is deterministically checkable. It does not attempt regex/LLM scanning of tool descriptions or runtime tool output for prompt injection - those are bypassable and better handled by least-privilege scoping, so mcpx deliberately doesn't ship security theater there.

⏱️ Rate Limiting

Global rate limiting protects all backends. Per-tool rate limiting prevents abuse of expensive operations. Token bucket algorithm with configurable burst.

📊 Prometheus Metrics

Built-in /metrics endpoint exposes request counts, latencies, tool usage, policy decisions, auth failures, and rate limit hits. Plug into Grafana, Datadog, or any Prometheus-compatible system.```
mcpx_requests_total{server="filesystem",method="tools/call",status_code="2xx"} 42
mcpx_tool_calls_total{server="filesystem",tool="read_file",decision="allow",client="ci-bot"} 38
mcpx_request_duration_ms_bucket{server="filesystem",le="50"} 35
mcpx_auth_failures_total 3
mcpx_rate_limit_hits_total 1
mcpx_breaker_trips_total 1
mcpx_breaker_state{server="database"} 1
mcpx_cache_lookups_total{server="docs",tool="search_docs",result="hit"} 17
mcpx_cache_entries 24


### 🔭 Distributed Tracing (OpenTelemetry)

Emit one OpenTelemetry span per request, exported over **OTLP/HTTP** to Jaeger, Tempo, Grafana, or any OTLP collector. Each request produces a root `mcpx.request` span with child spans for policy evaluation (`mcpx.policy`) and the backend call (`mcpx.proxy`), tagged with the server, MCP method, tool, client, and allow/deny decision. Inbound W3C `traceparent` headers are honored and trace context is propagated to instrumented HTTP backends, so a single trace spans the caller, the gateway, and the upstream server.```yaml
tracing:
  enabled: true
  exporter: otlp            # otlp (OTLP/HTTP, default) | stdout (debug)
  endpoint: localhost:4318  # OTLP/HTTP collector
  service_name: mcpx        # optional (default "mcpx")
  sample_ratio: 1.0         # optional, 0.0-1.0 (default 1.0)
  insecure: true            # optional, plain HTTP; set false for TLS
  headers:                  # optional, e.g. auth for a hosted collector
    authorization: "Bearer ..."

Tracing is strictly opt-in: when disabled (the default) it is a no-op with negligible overhead, and no exporter connection is made. It uses the OTLP/HTTP exporter (not gRPC) to keep the binary lean. Settings are read once at startup, so changing them needs a restart.

🏥 Deep Health Checks

/health probes each backend server and reports individual status, latency, and policy configuration. Returns degraded when some backends are down, unhealthy when all are down.```json
{
"status": "degraded",
"servers": [
{"name": "filesystem", "healthy": true, "latency_ms": 2.1},
{"name": "database", "healthy": false, "error": "unreachable: connection refused"}
]
}


### 📝 Audit Logging

Every request is logged with server name, method, tool name, authenticated client, client IP, policy decision, and latency. JSON output for your existing log infrastructure. Every response carries an `X-Request-ID` for correlation, and all gateway-generated errors share a consistent JSON envelope (`{"error":{"code":...,"message":...}}`, or a JSON-RPC error when the request carried a parseable message).

### 🌐 CORS Support

Browser-based MCP clients can connect through the gateway with configurable CORS headers.

### 🔀 Multi-Server Routing

Register multiple MCP servers behind a single gateway. Clients address them by name: `/mcp/filesystem`, `/mcp/database`, `/mcp/github`.

## API

| Endpoint | Description |
|---|---|
| `POST /mcp/{server}` | Proxy MCP JSON-RPC requests to the named backend |
| `GET /health` | Deep health check with per-backend status |
| `GET /servers` | List all registered backend servers |
| `GET /metrics` | Prometheus metrics |
| `GET /.well-known/oauth-protected-resource` | RFC 9728 metadata (only when `auth.type: oauth`) |

## Architecture```
cmd/mcpx/main.go              CLI entrypoint, middleware chain assembly
internal/
├── config/config.go           YAML config loading and validation
├── mcp/message.go             MCP JSON-RPC message types and parsing
├── proxy/proxy.go             Core reverse proxy with request inspection
├── auth/auth.go               Bearer, API key, and OAuth 2.1 middleware
├── auth/oauth.go              JWT/JWKS validation + RFC 9728 metadata
├── ratelimit/ratelimit.go     Global and per-tool rate limiting
├── audit/audit.go             Structured audit logging (slog + JSON)
├── policy/policy.go           Tool/argument/client policy engine
├── integrity/integrity.go     Full-schema tool pinning (rug-pull detection)
├── breaker/breaker.go         Per-backend circuit breaker
├── cache/cache.go             Response cache: bounded LRU + TTL + single-flight
├── httperr/httperr.go         Consistent JSON error envelopes
├── middleware/requestid.go    X-Request-ID propagation
├── metrics/metrics.go         Prometheus-compatible metrics (no deps)
├── tracing/tracing.go         OpenTelemetry OTLP tracing + root-span middleware
├── health/health.go           Deep health checking with backend probes
└── cors/cors.go               CORS middleware for browser clients

Middleware chain: CORS → Metrics → Auth → Rate Limit → Gateway (Policy → Cache → Breaker → Proxy → Audit)

Every request is inspected at the MCP protocol level. The gateway parses JSON-RPC messages to extract the method and tool name, evaluates the policy before forwarding, and inspects tools/list responses for schema integrity and policy filtering on the way back.

Security

mcpx is explicit about what it defends and what it doesn't. See SECURITY.md for the full threat model - which MCP attacks (rug-pulls, token passthrough, confused deputy, schema poisoning) it mitigates and how, plus the deliberate non-goals (it does not do bypassable regex/LLM prompt-injection scanning). Report vulnerabilities via GitHub Security Advisories.

Roadmap

See ROADMAP.md for the full plan. Key upcoming work:

  • [x] OAuth 2.1 authentication (audience validation + RFC 9728 metadata)
  • [x] Full-schema tool integrity pinning (rug-pull detection)
  • [x] Hot config reload (SIGHUP + watch)
  • [x] SSE / Streamable HTTP pass-through
  • [x] Argument-level and per-client policies
  • [x] Per-backend circuit breaker
  • [x] Stdio transport (spawn local MCP servers)
  • [x] OpenTelemetry tracing (OTLP/HTTP spans, W3C context propagation)
  • [x] Response caching for idempotent tools (LRU + TTL + single-flight)
  • [x] Secret injection for backend credentials (env/file references; no token passthrough)
  • [x] Backend mTLS (client certificates, private CA, server name override)
  • [ ] WebSocket transport proxying
  • [ ] Web dashboard
  • [ ] Plugin system (Go + WASM)
  • [ ] Helm chart

Contributing

Contributions welcome. See CONTRIBUTING.md for setup instructions.bash go test ./... # run tests go vet ./... # lint golangci-lint run # extended lint

License

MIT. See LICENSE for details.

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Mcpx 5e8ad995 怎么安装?

在客户端按下面的安装命令接入:docker run -p 8080:8080 -v $(pwd)/mcpx.yaml:/etc/mcpx/mcpx.yaml mcpx。装完在客户端配置里引用同一个包或端点。

Mcpx 5e8ad995 怎么在 Claude、Cursor、VS Code 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Mcpx 5e8ad995 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Mcpx 5e8ad995 需要 API Key 吗?

资料标注需要OAuth 授权认证,使用前准备好对应凭据,并按最小权限配置。

Mcpx 5e8ad995 支持哪些客户端?

资料标注支持 Claude、Cursor、VS Code;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Mcpx 5e8ad995 能提供哪些能力?

资料显示约 4 个工具;能力标签包括 访问控制、Go、Claude。具体工具清单以官方文档为准。

Mcpx 5e8ad995 需要什么运行环境?

运行时为 Docker;属于本地进程,需要在本机装好运行环境。

Mcpx 5e8ad995 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。