MCP Gateway

by Timandes
Apache 2.0

Integrations

  • Provides a configuration format for defining MCP tool mappings to HTTP APIs, allowing users to specify server settings and tool definitions through structured YAML files.

MCP 게이트웨이

MCP(Model Context Protocol) 게이트웨이는 MCP 도구 호출을 기존 HTTP API 요청으로 변환할 수 있습니다. 기존 HTTP API를 MCP 영역으로 가져오는 구성 가능한 방법을 제공할 수 있습니다.

시작하기

config.example.yaml 에서 구성 파일을 만듭니다.

지엑스피1

config.yaml 파일을 편집하여 모든 API를 MCP 도구에 매핑합니다.

그런 다음 SSE 전송으로 시작하세요.

$ uv run mcp-gateway INFO: Started server process [15400] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:3001 (Press CTRL+C to quit)

기본값은 3001입니다.

서버 제어

포트 변경

명령줄에 --port=<port_no> 매개변수를 제공하면 포트가 SSE 전송으로 변경됩니다.

포트 3002로 게이트웨이 시작:

$ uv run mcp-gateway --port=3002 INFO: Started server process [15400] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:3002 (Press CTRL+C to quit)

stdio 전송

명령줄에 --transport=stdio 매개변수를 제공하면 전송이 stdio로 변경됩니다.

예:

$ uv run mcp-gateway --transport=stdio

stdio 전송에서 게이트웨이를 수동으로 실행하는 것은 의미가 없습니다. Cursor 또는 Cline에서 다음과 같이 설정할 수 있습니다.

{ "mcpServers": { "mcp-gateway": { "command": "uv", "args": ["run", "mcp-gateway", "--transport=stdio"] } } }

또는 양식 값이 있는 MCP 검사기:

운송 유형스튜디오
명령자외선
인수mcp-gateway --transport=stdio를 실행하세요

구성 파일

구성 YAML에는 servertools 의 두 부분이 있습니다. server 게이트웨이 서버 사용을 위한 기본 정보를 정의합니다. tools 단일 MCP 도구에서 HTTP API 요청으로의 매핑을 정의합니다.

server: name: rest-amap-server config: apiKey: foo tools: - name: maps-geo description: "将详细的结构化地址转换为经纬度坐标。支持对地标性名胜景区、建筑物名称解析为经纬度坐标" args: - name: address description: "待解析的结构化地址信息" required: true - name: city description: "指定查询的城市" required: false requestTemplate: url: "https://restapi.amap.com/v3/geocode/geo?key={{.config.apiKey}}&address={{.args.address}}&city={{.args.city}}&source=ts_mcp" method: GET headers: - key: x-api-key value: "{{.config.apiKey}}" - key: Content-Type value: application/json responseTemplate: body: | # 地理编码信息 {{- range $index, $geo := .Geocodes }} ## 地点 {{add $index 1}} - **国家**: {{ $geo.Country }} - **省份**: {{ $geo.Province }} - **城市**: {{ $geo.City }} - **城市代码**: {{ $geo.Citycode }} - **区/县**: {{ $geo.District }} - **街道**: {{ $geo.Street }} - **门牌号**: {{ $geo.Number }} - **行政编码**: {{ $geo.Adcode }} - **坐标**: {{ $geo.Location }} - **级别**: {{ $geo.Level }} {{- end }}

섬기는 사람

설명
이름서버 이름
설정템플릿에서 var {{.config.xxx}} 로 참조할 수 있는 키/값 쌍

도구

tools 는 MCP 도구 매핑 목록입니다. 단일 도구 속성은 다음과 같이 정의됩니다.

설명
이름LLM에 제공되는 도구 이름(함수 이름)입니다.
설명LLM이 도구가 무엇을 할 수 있는지 이해할 수 있는 도구 설명입니다.
인수도구의 인수(함수 인수).
요청 템플릿대상 HTTP API에 대한 요청 매핑.
응답 템플릿대상 HTTP API의 응답에 대한 응답 매핑입니다.

단일 인수 props는 다음과 같이 정의됩니다.

유형설명
이름LLM에 제공되는 인수 이름입니다.
설명LLM이 이해하고 어떤 값을 채워야 할지 결정할 수 있는 논증 설명입니다.
필수의부울필수 인수인지 여부.

요청 템플릿 속성은 다음과 같이 정의됩니다.

설명
방법HTTP 메서드
URL대상 HTTP API URL 템플릿
헤더HTTP 헤더

HTTP 헤더는 다음과 같이 정의됩니다.

설명
열쇠헤더 키
헤더 값 템플릿

응답 템플릿 속성은 다음과 같이 정의됩니다.

설명
응답 본문 템플릿

기부금

모든 종류의 기여를 환영합니다.

-
security - not tested
A
license - permissive license
-
quality - not tested

MCP(Model Context Protocol) 도구 호출을 기존 HTTP API 요청으로 변환하는 서버로, 구성 가능한 매핑을 통해 기존 HTTP API를 MCP 영역으로 통합할 수 있습니다.

  1. 시작하기
    1. 서버 제어
      1. 포트 변경
      2. stdio 전송
    2. 구성 파일
      1. 섬기는 사람
      2. 도구
    3. 기부금

      Related MCP Servers

      • -
        security
        A
        license
        -
        quality
        MCP Server simplifies the implementation of the Model Context Protocol by providing a user-friendly API to create custom tools and manage server workflows efficiently.
        Last updated 4 months ago
        4
        3
        TypeScript
        MIT License
      • -
        security
        A
        license
        -
        quality
        MCP Server provides a simpler API to interact with the Model Context Protocol by allowing users to define custom tools and services to streamline workflows and processes.
        Last updated 3 months ago
        13
        2
        TypeScript
        MIT License
      • -
        security
        A
        license
        -
        quality
        An MCP server that exposes HTTP methods defined in an OpenAPI specification as tools, enabling interaction with APIs via the Model Context Protocol.
        Last updated 2 months ago
        2
        Python
        MIT License
      • -
        security
        A
        license
        -
        quality
        A Model Context Protocol (MCP) server that enables Claude or other LLMs to fetch content from URLs, supporting HTML, JSON, text, and images with configurable request parameters.
        Last updated 2 months ago
        Python
        MIT License

      View all related MCP servers

      ID: fizi08hz6v