mcpField
E
enterprise-mcp-gateway

enterprise-mcp-gateway

ローカル
github.com/BenjaminJセキュリティ12 週間前に更新

enterprise-mcp-gateway について

enterprise-mcp-gatewayは、MCPクライアントのリクエストを企業バックエンドへ中継するGo製ゲートウェイです。ロール別のツール権限、応答のマスキング、OpenAPIによるツール登録、構造化監査ログを備えています。

主な機能

  1. 01応答内の個人情報や秘密情報をマスキング
  2. 02ロール別にツールの表示と実行を制御
  3. 03OpenAPIまたはSwagger仕様からツールを登録
  4. 04構造化JSON監査ログの記録
  5. 05stdioとHTTP SSEのトランスポートに対応

活用シーン

  1. 01LLMに結果を渡す前に機密データを隠す
  2. 02呼び出し元のロールに応じて企業ツールを制限
  3. 03OpenAPI記述のサービスをMCPツールとして公開
  4. 04構造化監査記録でツール呼び出しを確認

MCP 対応

MCPクライアントと企業バックエンドの間に入り、設定したバックエンド操作をツールとして公開します。stdioおよびHTTP Server-Sent EventsでJSON-RPCを扱います。

設定

ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。

インストール方法は未掲載です

このサーバーのパッケージやリモートエンドポイントはまだ取得できていません。プロジェクトの README の手順に従ってください。

リポジトリ

ツール

ツール一覧はまだ取得されていません

ローカルサーバーのツールはマシン上で起動して初めて取得できます。メンテナーはまだツール一覧を提供していません。

詳細

Enterprise MCP Gateway

CI のステータス 最終コミット Go のバージョン MCP のバージョン Glama スコア セキュリティ ライセンス

Go で構築された、本番環境向けの高性能 Model Context Protocol(MCP)ゲートウェイです。
AI エージェント(Claude Desktop、Cursor、Antigravity、LangGraph)とエンタープライズバックエンド(OpenAPI、Java/Spring Boot、Go マイクロサービス、リレーショナルデータベース)をつなぐ、安全性が高く、監査に対応し、個人識別情報(PII)をサニタイズするブリッジです。

enterprise-mcp-gateway の Glama カード

Enterprise MCP Gateway のライブデモ
ライブデモ:AI エージェントが、処理中に PII とカード情報をマスキングしながら CRM に問い合わせる様子(左)と、ゲートウェイが構造化 JSON 監査ログをリアルタイムでストリーミングする様子(右)です。


🚀 主な機能

  • **⚡ 超高速かつ軽量:**単一の静的 Go バイナリです(常駐メモリ使用量 25MB 未満、ルーティングのオーバーヘッドはサブミリ秒、外部ランタイム依存関係は不要)。
  • **🛡️ 高性能な PII とシークレットのマスキング:**ツールの応答が LLM に届く前に、ストリームおよび JSON キーの値をリアルタイムでマスキングします(クレジットカード番号は Luhn チェックサムで検証し、SSN、メールアドレス、電話番号、AWS キー、JWT、GitHub PAT、カスタム正規表現ルールに対応)。
  • **🔐 ロールベースのツールガバナンス(RBAC):**トークンをロールに解決し、tools/list で表示されるツールを制限するとともに、tools/call の実行権限を適用します。
  • **🔌 動的な OpenAPI / Swagger コネクター:**OpenAPI 3.0/Swagger の YAML または JSON 仕様から、バックエンド連携コードを記述せずに、検証済みの MCP ツールを即座に登録します。
  • **📜 構造化 JSON 監査ログ:**呼び出し元の ID、呼び出されたツール、SHA-256 でハッシュ化されたパラメーター、実行時間、PII マスキングのメトリクスを含む、改ざん耐性のある構造化 JSON ログを出力します。
  • **🔄 デュアルトランスポート対応:**標準の stdio(Claude Desktop / Cursor 向け)と、分散マイクロサービス向けの HTTP Server-Sent Events(SSE)の両方をサポートする、完全準拠の JSON-RPC 2.0 エンジンです。

🏗️ アーキテクチャ

┌────────────────────────────────────────────────────────┐
│           AI Client (Claude / Cursor / Agent)          │
└──────────────────────────┬─────────────────────────────┘
                           │ JSON-RPC 2.0 (stdio or SSE)
                           ▼
┌────────────────────────────────────────────────────────┐
│           Enterprise MCP Gateway (Single Go Binary)    │
│                                                        │
│  1. Transport Layer (pkg/mcp/transport)                │
│     - Stdio & HTTP-SSE Transceivers                    │
│  2. Security & Auth Guard (pkg/governance/rbac)        │
│     - Token authentication & least-privilege filtering │
│  3. Router & Tool Registry (pkg/mcp/protocol)          │
│     - JSON-RPC 2.0 & MCP handshake engine              │
│  4. Backend Dispatcher (pkg/connector/openapi)         │
│     - Dynamic OpenAPI 3.0 path/query/body mapper       │
│  5. Sanitization Engine (pkg/sanitizer/pii)            │
│     - Zero-alloc PII, secret, & JSON key redactor      │
│  6. Structured Audit Logger (pkg/audit)                │
│     - Cryptographic JSON event trail for SIEM          │
└──────────────────────────┬─────────────────────────────┘
                           │ Authorized & Sanitized Calls
                           ▼
┌────────────────────────────────────────────────────────┐
│      Internal Enterprise Services (Java / Go / DBs)    │
└────────────────────────────────────────────────────────┘

📦 クイックスタート

1. ソースからビルドする

Go 1.24 以降がインストールされていることを確認してください。

# Clone the repository
git clone https://github.com/BenjaminJ/enterprise-mcp-gateway.git
cd enterprise-mcp-gateway

# Build gateway and mock backend server
go build -o bin/mcp-gateway ./cmd/gateway
go build -o bin/mockserver ./cmd/mockserver
2. モックのエンタープライズバックエンドを実行する(ターミナル 1)
./bin/mockserver --port 8081
3. サンプル設定でゲートウェイを実行する(ターミナル 2)
オプション A:Stdio モード(デフォルト)
./bin/mcp-gateway --config ./examples/config.yaml --token "agent-support-key"
オプション B:HTTP Server-Sent Events(SSE)モード
./bin/mcp-gateway --config ./examples/config.yaml --transport sse --port 8080
4. ライブ監査ログをリアルタイムでストリーミングする(ターミナル 3)

ツールの実行に合わせて、構造化監査レコードを追跡し、整形して表示します。

PowerShell(Windows):

Get-Content -Path .\audit.log -Wait -Tail 10 | ForEach-Object {
    if ($_ -match '^\s*\{') {
        $e = $_ | ConvertFrom-Json
        $time = ([DateTime]$e.timestamp).ToLocalTime().ToString("HH:mm:ss")
        $statusColor = if ($e.status -eq "SUCCESS") { "Green" } else { "Red" }
        $redactColor = if ($e.pii_redacted_count -gt 0) { "Yellow" } else { "DarkGray" }
        Write-Host "[$time] " -NoNewline -ForegroundColor DarkGray
        Write-Host "[$($e.status)] " -NoNewline -ForegroundColor $statusColor
        Write-Host "$($e.tool) " -NoNewline -ForegroundColor Cyan
        Write-Host "(Role: $($e.role), Latency: $($e.duration_ms)ms, Redacted: $($e.pii_redacted_count))" -ForegroundColor $redactColor
    }
}

Bash / Linux / macOS(jq):

tail -f audit.log | jq -c '{time: .timestamp, status: .status, tool: .tool, role: .role, latency_ms: .duration_ms, redacted: .pii_redacted_count}'

🔍 Anthropic 公式 MCP Inspector による検証

Anthropic 公式の @modelcontextprotocol/inspector を使用して、ゲートウェイをテストおよび検査できます。

Stdio 経由でテストする:
npx @modelcontextprotocol/inspector ./bin/mcp-gateway --config ./examples/config.yaml --token agent-support-key
SSE 経由でテストする:
  1. ゲートウェイを SSE モードで起動します。
    ./bin/mcp-gateway --config ./examples/config.yaml --transport sse --port 8080
    
  2. SSE エンドポイントを指定して Inspector を開きます。
    npx @modelcontextprotocol/inspector http://localhost:8080/sse
    

💻 Claude Desktop との統合

enterprise-mcp-gateway を通じて Claude Desktop をエンタープライズシステムに接続するには、次の手順に従います。

  1. Claude Desktop の設定ファイルを開きます。

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. mcpServers オブジェクトに enterprise-mcp-gateway を追加します。

{
  "mcpServers": {
    "enterprise-gateway": {
      "command": "/absolute/path/to/enterprise-mcp-gateway/bin/mcp-gateway",
      "args": [
        "--config",
        "/absolute/path/to/enterprise-mcp-gateway/examples/config.yaml",
        "--token",
        "agent-support-key"
      ]
    }
  }
}
  1. Claude Desktop を再起動します。エンタープライズツール(listCustomers、getCustomerDetails、createSupportTicket など)が、プロンプトインターフェースにハンマーアイコン付きで表示されます。

⚙️ 設定ガイド(config.yaml)

server:
  name: "enterprise-mcp-gateway"
  version: "1.0.0"
  transport: "stdio"       # "stdio" or "sse"
  host: "0.0.0.0"
  port: 8080

governance:
  enabled: true
  default_role: "support_agent"
  tokens:
    "agent-ro-secret": "readonly_agent"
    "agent-support-secret": "support_agent"
    "admin-master-secret": "admin"
  roles:
    readonly_agent:
      allowed_tools:
        - "list*"
        - "get*"
    support_agent:
      allowed_tools:
        - "list*"
        - "get*"
        - "createSupportTicket"
    admin:
      allowed_tools:
        - "*"

sanitizer:
  enabled: true
  mask_card_numbers: true  # Luhn-verified Credit Card masking
  mask_ssn: true           # US SSN masking
  mask_secrets: true       # Private keys, AWS keys, JWTs, PATs
  sensitive_keys:
    - "password"
    - "secret"
    - "token"
    - "apiKey"
    - "ssn"
    - "creditCard"
  custom_regex:
    - name: "Internal Employee ID"
      pattern: "\\bEMP-[0-9]{6}\\b"
      replacement: "[REDACTED-EMP-ID]"

audit:
  enabled: true
  log_path: "stdout"       # "stdout" or path to file e.g. "/var/log/mcp-audit.log"
  hash_inputs: true        # SHA-256 hashes tool arguments for compliance

connectors:
  - name: "enterprise-crm"
    type: "openapi"
    spec_file: "./examples/crm-openapi.yaml"
    base_url: "http://localhost:8081"
    headers:
      Authorization: "Bearer backend-secret-token"
      X-Gateway-Source: "enterprise-mcp-gateway"
    timeout_seconds: 15

🧪 テスト

すべてのユニットテストとエンドツーエンドの統合テストを実行します。

# Run all unit and integration tests
go test -v ./...

# Run tests with the Go race detector enabled
go test -race ./...

🐳 Docker によるデプロイ

# Build lightweight Docker image
docker build -t enterprise-mcp-gateway:latest .

# Run container in SSE mode
docker run -d -p 8080:8080 -p 8081:8081 enterprise-mcp-gateway:latest --transport sse --port 8080

📄 ライセンス

MIT ライセンス。

コメント

MCP は初めてですか?

プロトコルの概要から最初のサーバーの導入まで、よくある疑問にまとめて答えます。

AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。