Skip to main content
Glama
Timandes

MCP Gateway

by Timandes

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입니다.

Related MCP server: Hello Service MCP Server

서버 제어

포트 변경

명령줄에 --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 헤더는 다음과 같이 정의됩니다.

설명

열쇠

헤더 키

헤더 값 템플릿

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

설명

응답 본문 템플릿

기부금

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

Related MCP Connectors

  • The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.

  • Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server

  • The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.

  • An MCP server that provides an API to LLMs to manage their JumpCloud resources.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that exposes HTTP methods defined in an OpenAPI specification as tools, enabling interaction with APIs via the Model Context Protocol.
    8
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    A Model Context Protocol server that enables AI assistants to make HTTP requests (GET, POST, PUT, DELETE) to external APIs through standardized MCP tools.
    4
    2
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A standalone proxy that transforms any OpenAPI or Swagger-described REST API into an MCP server by mapping API operations to executable MCP tools. It enables AI clients to interact with existing web services through automated HTTP requests based on their official documentation.
    11 npm
    16
    MIT