IM

igrigorik/mcproxy

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

21 stars 5 forks 품질 61 트렌드 0MIT

MCP 프록시 : 도구 집계, 검색, 필터링, 보안

개요

Rust-based MCP (Model-Context-Protocol) 프록시는 여러 업스트림 서버에서 도구로 구성하고 단일 스트림 가능한 HTTP 인터페이스를 통해 노출합니다. - : 여러 업스트림 MCP 서버에 연결 (스트로디 또는 http를 통해) 모든 도구의 집계 된 목록을 노출합니다. - : 업스트림 서버에서 toolListChanged 알림을 수신하고 동적으로 통합된 도구 목록을 업데이트합니다. - : 많은 도구가 사용할 수 있을 때, 프록시는 초기 목록을 자동으로 제한할 수 있으며, 필요한 검색/업데이트 노출 도구를 제공합니다. - : 위탁 및 수정을 위한 유연한 미들웨어 시스템 / 응답 : - : 개별 서버 통화 (로그, 도구 필터링, 보안용 페이로드 검사 등)에 Operates - : 서버의 집계 도구 / 프롬프트 / 리소스에 Operates (도메인, 도구 검색 등) (docs/MIDDLEWARE 참조).

개요(AI 번역)

Rust-based MCP (Model-Context-Protocol) 프록시는 여러 업스트림 서버에서 도구로 구성하고 단일 스트림 가능한 HTTP 인터페이스를 통해 노출합니다.

  • **도구 집계 **: 여러 업스트림 MCP 서버에 연결 ([T0]] 또는 http]) 모든 도구의 집계 된 목록을 노출.
  • Dynamic 도구 업데이트: toolListChanged] 상류 서버의 알림 및 동적으로 통합된 도구 목록을 업데이트합니다. -Tool 검색: 많은 도구가 사용할 수 있을 때, 프록시는 초기 목록을 자동으로 제한할 수 있으며, 필요한 검색/업데이트 노출 도구를 제공합니다.
  • Middleware System: 요청/responses를 가로지르고 수정하기 위한 유연한 미들웨어 시스템:
  • ClientMiddleware: 개별 서버 통화 (로그인, 도구 필터링, 보안용 페이로드 검사 등)
  • ProxyMiddleware: 서버의 집계 도구/prompt/resources에 Operates (문서 enrichment, 공구 검색, 등)

** 내장 미들웨어 ** (docs/MIDDLEWARE.md 참조):

  • **로깅 **: 서버별 타이밍 정보로 모든 작업을 로그
  • 도구 필터링: configurable regex 패턴을 기반으로 필터 도구 (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": [ "*" ] } }