IM

igrigorik/mcproxy

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

21 stars 5 forks 品質 61 トレンド 0MIT

MCPプロキシ:ツール集計、検索、フィルタリング、セキュリティ

概要

Rust ベースの MCP (Model-Context-Protocol) プロキシは、複数の上流サーバーからツールを集約し、単一のストリーム可能な HTTP インターフェイスを介してそれらを露出します。 - : 複数の上流MCPサーバーに接続(stdioまたはhttp経由で)、すべてのツールの集計されたリストを公開します。 - : ツールListChanged 通知を上流サーバーから削除し、集計されたツールリストを動的に更新します。 - : 多数のツールが利用可能な場合、プロキシは初期リストを自動的に制限し、検索機能を提供して、オンデマンドで露出したツールを検索/更新することができます。 - : リクエスト/応答を傍受および変更するための柔軟なミドルウェアシステム: - : 個々のサーバー呼び出し(ログ、ツールのフィルタリング、セキュリティのペイロード検査など)を操作する - : サーバー(説明の濃縮、ツール検索など)から集計されたツール/プロンプト/リソースの操作 (docs/MIDDLEWAREを参照してください。).

概要(AI 翻訳)

Rust ベースの MCP (Model-Context-Protocol) プロキシは、複数の上流サーバーからツールを集約し、単一のストリーム可能な HTTP インターフェイスを介してそれらを露出します。

  • ツール集計:複数の上流MCPサーバーに接続します([stdio]またはhttp]]))。すべてのツールの集計されたリストを公開します。 -Dynamic Toolのアップデート: [toolListChanged]の通知を上流サーバーから受け取り、集計されたツールリストを動的に更新します。
  • ツール検索: 多数のツールが利用可能な場合、プロキシは初期リストを自動的に制限し、検索機能を提供して、オンデマンドで露出したツールを検索/更新することができます。 -ミドルウェアシステム:リクエスト/応答を傍受および変更するための柔軟なミドルウェアシステム:
  • クライアントミドルウェア: 個々のサーバー呼び出し(ログ、ツールフィルタリング、セキュリティのペイロード検査など)
  • プロキシミドルウェア**: サーバーから集約されたツール/コマンド/リソース(説明の充実、ツール検索など)を操作

ビルトインミドルウェア(docs/MIDDLEWARE.md参照) -ログイン: サーバ毎のタイミング情報で全ての操作をログ化

  • 用具のろ過: 設定可能な正規表現パターンに基づいてツールをフィルタリング(allow/disallow)

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

MCP Proxy

Rust-based MCP (Model-Context-Protocol) proxy that aggregates tools from multiple upstream servers and exposes them through a single streamable HTTP interface.

  • Tool aggregation: Connects to multiple upstream MCP servers (via stdio or http) and exposes an aggregated list of all their tools.
  • Dynamic tool updates: Listens for toolListChanged notifications from upstream servers and dynamically updates its aggregated tool list.
  • Tool search: When a large number of tools are available, proxy can automatically limit initial list and provide search functionality to search/update exposed tools on demand.
  • Middleware system: Flexible middleware system for intercepting and modifying requests/responses:
    • ClientMiddleware: Operates on individual server calls (logging, tool filtering, payload inspection for security, etc)
    • ProxyMiddleware: Operates on aggregated tool/prompt/resources from servers (description enrichment, tool search, etc)

Built-in middleware (see docs/MIDDLEWARE.md):

  • Logging: Logs all operations with timing information per server
  • Tool filtering: Filters tools based on configurable regex patterns (allow/disallow)
  • Tool security: Inspects tool call inputs and blocks calls that match security rules
  • Tool enrichment: Augments tool/prompt/resource descriptions (demo)
  • Tool search: Provides intelligent tool management with selective exposure and search functionality (see docs/SEARCH.md).
    • Disclaimer: cursor does not currently support dynamic tool refresh (1, 2), you have to manually toggle the tool.

Usage

  1. Build the project:

    cargo build --release
    
  2. Create a configuration file (e.g., mcp_servers.json) as described above.

  3. Run the proxy:

    ./target/release/mcproxy mcp_servers.json
    

    The proxy will start, connect to the configured servers, and listen for MCP messages on its stdio.

Configuration

The proxy is configured using a JSON file passed as a command-line argument. The file should contain the mcpServers key (MCP configuration you use for VSCode/Cursor/Claude/etc), plus httpServer key to configure the MCP proxy:

{
  "mcpServers": {
    "stdio-mcp-service": {
      "type": "stdio",
      "command": "node",
      "args": ["script.js"],
      "env": {
        "ENV_FOO_VAR": "BAR"
      }
    },
    "http-mcp-github": {
      "url": "https://api.githubcopilot.com/mcp/",
      "authorizationToken": "Bearer GitHUB_PAT_TOKEN"
    }
  },
  "httpServer": {
    "host": "127.0.0.1",
    "port": 8081,
    "corsEnabled": true,
    "corsOrigins": [
      "*"
    ]
  }
}
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "stdio-mcp-service": { "type": "stdio", "command": "node", "args": ["script.js"], "env": { "ENV_FOO_VAR": "BAR" } }, "http-mcp-github": { "url": "https://api.githubcopilot.com/mcp/", "authorizationToken": "Bearer GitHUB_PAT_TOKEN" } }, "httpServer": { "host": "127.0.0.1", "port": 8081, "corsEnabled": true, "corsOrigins": [ "*" ] } }