MCP Gateway
MCPゲートウェイ
MCP(モデルコンテキストプロトコル)ゲートウェイは、MCPツールの呼び出しを従来のHTTP APIリクエストに変換します。既存のHTTP APIをMCP領域に取り込むための設定可能な方法を提供します。
はじめる
config.example.yamlから設定ファイルを作成します。
$ cp config.example.yaml config.yamlconfig.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=stdiostdioトランスポートでゲートウェイを手動で起動するのは意味がありません。CursorまたはClineで以下のように設定できます。
{
"mcpServers": {
"mcp-gateway": {
"command": "uv",
"args": ["run", "mcp-gateway", "--transport=stdio"]
}
}
}またはフォーム値を持つ MCP インスペクター:
アイテム | 価値 |
輸送タイプ | 標準入出力 |
指示 | 紫外線 |
議論 | mcp-gateway --transport=stdio を実行する |
設定ファイル
構成 YAML には、 serverとtoolsの 2 つの部分があります。 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 |
ツール
tools MCPツールマッピングのリストです。個々のツールプロパティは以下のように定義されます。
アイテム | 説明 |
名前 | LLM に提供されるツール名 (関数名)。 |
説明 | LLM がツールの機能を理解するために役立つツールの説明。 |
引数 | ツールの引数(関数の引数)。 |
リクエストテンプレート | ターゲット HTTP API へのマッピングを要求します。 |
レスポンステンプレート | ターゲット HTTP API のレスポンスのレスポンス マッピング。 |
単一引数のプロパティは次のように定義されます。
アイテム | タイプ | 説明 |
名前 | LLM に提供される引数名。 | |
説明 | LLM が理解し、どの値を入力すべきかを決定するための引数の説明。 | |
必須 | ブール値 | 必須の引数かどうか。 |
リクエスト テンプレートのプロパティは次のように定義されます。
アイテム | 説明 |
方法 | HTTPメソッド |
URL | ターゲットHTTP API URLテンプレート |
ヘッダー | HTTPヘッダー |
HTTP ヘッダーは次のように定義されます。
アイテム | 説明 |
鍵 | ヘッダーキー |
価値 | ヘッダー値テンプレート |
レスポンス テンプレートのプロパティは次のように定義されます。
アイテム | 説明 |
体 | レスポンス本文テンプレート |
貢献
あらゆる種類の貢献を歓迎します。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that exposes HTTP methods defined in an OpenAPI specification as tools, enabling interaction with APIs via the Model Context Protocol.8MIT
- -licenseNot gradedqualityNot gradedmaintenanceA unified HTTP/HTTPS service that exposes Model Context Protocol (MCP) functionality over HTTP endpoints, allowing clients to list available tools and call them through a standardized API.11
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables AI assistants to make HTTP requests (GET, POST, PUT, DELETE) to external APIs through standardized MCP tools.42MIT
- AlicenseNot gradedqualityDmaintenanceA 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.2816MIT
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Timandes/mcp-gateway'
If you have feedback or need assistance with the MCP directory API, please join our Discord server