Model Context Protocolのクライアントとバックエンドに対して、アイデンティティ、認可、および実行ディスパッチを管理するプロトコル権限ゲートウェイです。
別名 mcpg-dev/mcpg, model-context-protocol-gateway
- スター
- 0
- ツール
- 1
- ダウンロード数(30日間)
- —
- 最新バージョン
- —
- 最終コミット
- 2026年11月13日
- ライセンス
- Apache-2.0
MCPG MCPとは
MCPGはMCPサーバーです。 Model Context Protocolのクライアントとバックエンドに対して、アイデンティティ、認可、および実行ディスパッチを管理するプロトコル権限ゲートウェイです。. 1個のツールを提供しており、builtなどがあります。
プロジェクトのREADMEから生成された概要
MCPG MCP server について
mcpgは、Model Context Protocolのクライアントとバックエンドに対するアイデンティティ、認可、および実行ディスパッチの管理を可能にします。クライアントとダウンストリームシステムの中間に位置するプロトコル権限ゲートウェイとして機能し、セッションのライフサイクル全体とプロトコルの実装を処理します。開発者は、cargoやnpmを使用してローカルにデプロイしたり、DockerやKubernetesとHelmチャートを使用して本番環境にデプロイしたりできます。
このゲートウェイは、プラグインシステムを通じて、ツール呼び出し、プロンプトリクエスト、およびリソース読み取りをオペレーターが定義したバックエンドにルーティングします。HTTP、gRPC、SQL、およびNATSやKafkaなどのメッセージングシステムを含む、さまざまな通信方法をサポートしています。また、credential_issuerプラグインファミリーを使用してアウトバウンドの認証情報を管理し、バックエンドが特定のURIを通じて発行された値を参照できるようにします。
セキュリティは中核となる要素であり、システムはCEL式を使用してディスパッチ前の認可を強制し、OIDC、OAuth、またはJWKSを通じてアイデンティティを解決します。PrometheusメトリクスとOpenTelemetryトレースを通じてオブザーバビリティを提供し、複雑なマルチステップのパイプラインやタスク拡張されたツール呼び出しが完全に監視および制御されることを保証します。
できること
- 1セキュアなツール実行AIクライアントは、バックエンドに到達する前に、特定の信頼レベルとCEL式によって制限されたツール呼び出しを実行できます。
- 2自動化された認証情報管理開発者は、OAuth 2.0やVaultの動的なデータベース認証情報の管理を、ゲートウェイのプラグインシステムに委譲できます。
- 3多様なデータソースの接続SQLデータベース、GraphQL API、またはLLMプロバイダーを含む、幅広いバックエンドにMCPリクエストをルーティングできます。
- 4複雑なワークフローのオーケストレーションエージェントは、サンプリングや聞き取りのためにクライアントとの対話を必要とするマルチステップのパイプラインを実行できます。
プロジェクトの README から作成されています。すべてのユースケースは、その引用と照らし合わせて確認されています。
MCPG MCPのインストール方法
フォーマット検証日 2026年11月10日Cursor に追加Gooseに追加Claude CodeにMCPG MCPをインストール
$ claude mcp add mcpg -- npx -y model-context-protocol-gatewayCursorにMCPG MCPをインストール
~/.cursor/mcp.json
{
"mcpServers": {
"mcpg": {
"command": "npx",
"args": [
"-y",
"model-context-protocol-gateway"
]
}
}
}VS CodeにMCPG MCPをインストール
.vscode/mcp.json
{
"servers": {
"mcpg": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"model-context-protocol-gateway"
]
}
}
}VS Code CLIにMCPG MCPをインストール
$ code --add-mcp '{"name":"mcpg","type":"stdio","command":"npx","args":["-y","model-context-protocol-gateway"]}'Claude DesktopにMCPG MCPをインストール
claude_desktop_config.json
{
"mcpServers": {
"mcpg": {
"command": "npx",
"args": [
"-y",
"model-context-protocol-gateway"
]
}
}
}CodexにMCPG MCPをインストール
$ codex mcp add mcpg -- npx -y model-context-protocol-gatewayCodex config.tomlにMCPG MCPをインストール
~/.codex/config.toml
[mcp_servers.mcpg] command = "npx" args = ["-y", "model-context-protocol-gateway"]
Gemini CLIにMCPG MCPをインストール
$ gemini mcp add -s user mcpg npx -- -y model-context-protocol-gatewayGemini settings.jsonにMCPG MCPをインストール
~/.gemini/settings.json
{
"mcpServers": {
"mcpg": {
"command": "npx",
"args": [
"-y",
"model-context-protocol-gateway"
]
}
}
}MCPG MCPツール 1
READMEから検出built
| built | — |
設定
MCPG_CONFIG
| 名前 | 説明 | 種類 |
|---|---|---|
| MCPG_CONFIG | — |
自動チェック
実行日 2026年11月14日完全なレポート →自動チェックに合格しました。これはセキュリティ監査ではありません。コードを読み、サーバーに必要最小限のアクセス権を与えてください。 チェックの仕組み
- ソースリポジトリがリンクされており、アクセス可能mcpg-dev/mcpg is public and reachablegithub.com/mcpg-dev/mcpg ↗合格
- パッケージがこのリポジトリをソースとして指定model-context-protocol-gateway names mcpg-dev/mcpg as sourcenpmjs.com/package/model-context-protocol-gateway ↗合格
- ビルドの来歴 (Sigstore 証明)Sigstore attestation for model-context-protocol-gatewaynpmjs.com/package/model-context-protocol-gateway/v/0.1.0-rc. ↗合格
- オープンソースライセンス (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗合格
- 過去1年以内にコミットまたはリリースありLast commit or release 2026-11-13github.com/mcpg-dev/mcpg ↗合格
- OpenSSF Scorecard未チェック
- パッケージ名が有名なパッケージに酷似していないNo popular package one edit away from model-context-protocol-gateway合格
- パッケージおよびその依存関係に重大な勧告なし未チェック
- モデルへの隠れた指示がない1 tool description and the README read; no override phrases, credential paths or hidden characters合格
- 破壊的なツールがラベル付けされているNo tool named like delete, drop or exec合格
- リモートエンドポイントが MCP ハンドシェイクに応答未チェック
README
GitHubで見るMCPG — Model Context Protocol Gateway
MCPG is a protocol-authority gateway for the Model Context Protocol. It sits between MCP clients and downstream backend systems, owning protocol handling, session lifecycle, identity, authorization, execution dispatch, and observability.
Production-grade Rust · extensive unit + integration + MCP-conformance coverage · implements MCP 2026-07-28 and 2025-11-25 (both CI-conformance-gated; legacy 2025-06-18 / 2025-03-26 accepted on request)
Build an MCP server with MCPG: see
docs/agent-authoring-guide.mdfor the AI-agent authoring procedure, anddocs/mcp-server-ideas.mdfor 25 concrete systems worth wrapping (name.com, Cloudflare, GitHub, Stripe, iPhone Simulator, and more) — each with a runnable sample underexamples/.Compliance status: start at
docs/compliance/mcp-compliance.mdfor the canonical reference. The supported-feature matrix is atdocs/compliance/compliance-support.md; operator knobs and metrics are documented indocs/configuration.mdanddocs/observability.md. Doc index:docs/README.md.
What MCPG Does
- Speaks MCP over Streamable HTTP with SSE streaming — the finalized
2026-07-28revision (stateless, header-routed) and the session-based2025-11-25default; the server always emits2026-07-28as its wire string and accepts the legacy2025-06-18/2025-03-26revisions when a client requests them - Routes tool calls, prompt gets, and resource reads to operator-defined backends
- Enforces pre-dispatch authorization with trust levels and CEL expressions
- Resolves identity via JWKS, OIDC/OAuth (multi-provider), or header assertion
- Orchestrates multi-step pipelines with client interaction (elicitation, sampling)
- Supports MCP Tasks — task-augmented tool calls with background execution, polling, cancellation, and result retrieval
- Distributes state across NATS, Redis, or in-process backends per capability (activated via per-capability
<capability>.store/<bus>.busoverrides) - Manages outbound credentials (OAuth 2.0 client_credentials, Vault dynamic DB, static) via the
credential_issuerplugin family — backends reference issued values throughcred://<plugin_id>/<target>URIs, with cached, auto-refreshed tokens - Surfaces MCP App URLs (
_meta.mcpAppUrl) on resource descriptors with CEL interpolation - Delivers subject-scoped resource notifications with 4 filter scopes (all, subject, session, expression)
- Extends via async plugin system — dual-tier (Native + Wasm) tool-gate, transform, and identity chains
- Enforces external guardrails via HTTP webhook callouts with CEL triggers and fail-open/fail-closed policies
- Gates tool calls via Machine Payment Protocol with HMAC-bound challenges
- Emits Prometheus metrics and OpenTelemetry traces
Backends
Backends are cdylib plugins — the gateway binary hard-wires none. The
catalog ships 32 backend and connector plugins; a caller selects one
per capability via a nested backend.kind: discriminator. Common kinds:
| Kind | Transport |
|---|---|
http |
HTTP POST/GET to downstream endpoints |
command |
Local subprocess execution |
nats / kafka / amqp |
Messaging (request/reply, pub/sub) |
grpc |
gRPC via proto-less JSON mapping |
graphql / soap |
GraphQL query/mutation, SOAP |
sql |
SQL + warehouse databases (Postgres, MySQL, Snowflake, BigQuery, ClickHouse, DuckDB, Oracle, …) |
ldap / dynamodb / email / sftp |
Directory, key-value, mail, file transfer |
openapi |
OpenAPI spec → generated tools |
mock |
Static fixture response |
pipeline |
Multi-step orchestration (11 step types) |
| LLM/media family | 17 kinds — OpenAI, Azure OpenAI, Anthropic, Gemini, Stability, and OpenAI-compatible chat/embedding/image/TTS/STT |
Full reference: docs/backends.md.
Install
The model-context-protocol-gateway package installs mcpg together with
mcpg-config, mcpg-cloud and mcpg-plugin:
npx model-context-protocol-gateway --help # npm, one-shot
npm install -g model-context-protocol-gateway # npm
pipx install model-context-protocol-gateway # PyPI (or: uvx model-context-protocol-gateway)
cargo install model-context-protocol-gateway --version <version> # crates.io: a launcher that runs the release binaries
cargo binstall model-context-protocol-gateway --version <version> # the release binaries directly
curl -fsSL https://raw.githubusercontent.com/mcpg-dev/mcpg/main/install.sh | sh
The container image is ghcr.io/mcpg-dev/mcpg:<version>. Every install path:
mcpg.dev/docs/install.
Build from source
# Build
cargo build
# Test
cargo test
# Run
MCPG_CONFIG=config.example.yaml cargo run
Docker & Kubernetes
# Build Docker image (from repo root)
docker build -t mcpg:latest -f apps/gateway/Dockerfile .
# Run single instance
docker run -p 8787:8787 -v $(pwd)/config.yaml:/etc/mcpg/config.yaml:ro mcpg:latest
# Deploy to Kubernetes via Helm (single instance). The charts are
# 0.1.0-beta.N prereleases: always pass --version.
helm install mcpg oci://ghcr.io/mcpg-dev/charts/mcpg --version <chart-version>
# Deploy HA with NATS backend (multi-instance)
helm install mcpg oci://ghcr.io/mcpg-dev/charts/mcpg --version <chart-version> \
--set replicaCount=3 \
--set nats.enabled=true \
--set autoscaling.enabled=true \
--set podDisruptionBudget.enabled=true
Full deployment guide: docs/deployment.md. Helm chart reference: Kubernetes install with Helm.
Configuration
See config.example.yaml for a working configuration. Full reference: docs/configuration.md.
server:
bind_address: "127.0.0.1:8787"
observability:
logs:
level: "info"
sinks:
- kind: stderr
config: { format: json }
mcp:
capabilities:
tools:
- name: "my_tool"
description: "Example HTTP backend"
backend:
kind: http
url: "https://api.example.com/endpoint"
method: post
timeout_ms: 5000
Documentation
| Document | Description |
|---|---|
| docs/architecture.md | System architecture, module structure, request flow |
| docs/request-flow.md | Complete request lifecycle, all routes, plugin extension points |
| docs/configuration.md | Complete configuration reference |
| docs/backends.md | Backend kinds and connector plugins with examples |
| docs/pipelines.md | Pipeline execution, 11 step types, suspension/resumption |
| docs/identity-and-authorization.md | JWKS, OIDC/OAuth, trust levels, CEL policy |
| docs/infrastructure.md | Session stores, delivery buses, pipeline stores |
| docs/observability.md | Logging, Prometheus metrics, OpenTelemetry |
| docs/api-reference.md | HTTP endpoints, MCP operations, SSE protocol |
| docs/deployment.md | Docker, Kubernetes/Helm, deployment topologies |
| docs/plugins.md | Plugin system: traits, registry, Wasm, config |
| Kubernetes install with Helm | Helm chart reference — parameters, examples, architecture |
Architecture at a Glance
MCP Client
│
▼
HTTP Transport ──→ Identity Resolution ──→ Gateway Runtime ──→ Plugin Chain ──→ Backend Execution
│ (OIDC/JWKS/Plugin) │ (gate/transform) (backend plugins)
│ │
├── SSE Streaming Session Management
│ (replay window) (4 store backends)
│
└── Prometheus + OpenTelemetry
Plugin System Crates
libs/
├── plugin-protocol/ — Trait contracts + FFI ABI types (ToolGatePlugin, BackendPlugin, etc.)
├── plugin-host/ — Registry, chain evaluation, Wasm hosting, artifact verification
├── plugin-sdk/ — SDK for building plugins (testing helpers, MockGateway)
├── sdk/ — `mcpg-sdk` umbrella crate plugin authors depend on
└── plugins/ — the production catalog: 92 shipping plugins across 14
categories (backend, security, identity, transform,
observability, payment, credential, …), cdylib + a few Wasm
Design Decisions
Key architectural decisions:
- ADR-0001: Single-deployment, backend-driven runtime (no multi-tenancy)
- ADR-0004: Canonical backend execution contract (gateway as protocol authority)
- ADR-0005: Multi-node lease fencing with CAS semantics
- ADR-0007: OIDC/OAuth multi-provider authentication
License
The gateway core is Apache-2.0 (see LICENSE). Enterprise plugins and the fleet platform (Kubernetes operator, control plane) ship under BUSL-1.1, each release auto-converting to Apache-2.0 three years later. To license production use of the BUSL-1.1 components, email agent@mcpg.dev or use the managed service at mcpg.cloud. The canonical component map is at mcpg.dev/license.
Backend governance integrates with the policy layer. Each backend's minimum_trust and allow_if are injected as per-tool policy rules at startup. CEL expressions are compiled and validated during bootstrap.
Debug Tools
The debug capability model is intentionally narrow:
- the top-level
debug.enabled: truegate must be set before any debug capabilities exist - command probes, network probes, and the debug HTTP JSON call use named execution profiles (under
debug.tools.command_profiles/debug.tools.network_profiles) with bounded timeout and size limits - built-in debug tools, prompt, and resource capabilities can be exposed or hidden independently via
debug.tools.exposure.* - debug tools emit structured logs with
backend_kind: debug_toolto distinguish from operator backends
Execution Contract
All downstream execution paths produce structured result envelopes with:
- tool name, profile, and request kind classification
- request and response details
- structured error objects with category, retry hints, idempotency, and suggested actions
- execution duration, status codes, and truncation indicators
Execution logs include backend_kind (operator_backend or debug_tool) on all call sites.
MCPG MCPのよくある質問
MCPG MCPをClaude Codeに追加するには
ターミナルでclaude mcp add mcpg -- npx -y model-context-protocol-gatewayを実行します。すべてのプロジェクトで利用するには--scope userを追加します。
MCPG MCPをCursorに追加するには
~/.cursor/mcp.jsonを開き、上記のインストールセクションに示すCursor設定を使ってmcpServersの下にサーバーを追加します。
MCPG MCPが提供するツールは
1個のツールを提供しており、builtなどがあります。
MCPGは何を行いますか?
MCPクライアントとバックエンドシステムの間のゲートウェイとして機能し、プロトコルの処理、セッションのライフサイクル、アイデンティティ、認可、およびオブザーバビリティを管理します。
KubernetesにMCPGをデプロイするにはどうすればよいですか?
Helmチャートを使用してデプロイできます。単一インスタンス、またはNATSバックエンドを使用した高可用性構成のオプションがあります。