MCPゲートウェイ
MCP(モデルコンテキストプロトコル)ゲートウェイは、MCPツールの呼び出しを従来のHTTP APIリクエストに変換します。既存のHTTP APIをMCP領域に取り込むための設定可能な方法を提供します。
はじめる
config.example.yaml
から設定ファイルを作成します。
config.yaml
ファイルを編集し、すべての API を MCP ツールにマップします。
次に、SSE トランスポートを使用して起動します。
デフォルトは 3001 です。
サーバー制御
ポートの変更
コマンドラインでパラメータ--port=<port_no>
を指定すると、ポートが SSE トランスポートに変更されます。
ポート 3002 でゲートウェイを起動します。
stdioトランスポート
コマンドラインでパラメータ--transport=stdio
指定すると、トランスポートが stdio に変更されます。
例えば:
stdioトランスポートでゲートウェイを手動で起動するのは意味がありません。CursorまたはClineで以下のように設定できます。
またはフォーム値を持つ MCP インスペクター:
アイテム | 価値 |
---|---|
輸送タイプ | 標準入出力 |
指示 | 紫外線 |
議論 | mcp-gateway --transport=stdio を実行する |
設定ファイル
構成 YAML には、 server
とtools
の 2 つの部分があります。 server
、ゲートウェイ サーバーの使用に関する基本情報を定義します。 tools
単一の MCP ツールから HTTP API 要求へのマッピングを定義します。
サーバ
アイテム | 説明 |
---|---|
名前 | サーバー名 |
設定 | テンプレート内のvar {{.config.xxx}} で参照できるキー/値のペア |
ツール
tools
MCPツールマッピングのリストです。個々のツールプロパティは以下のように定義されます。
アイテム | 説明 |
---|---|
名前 | LLM に提供されるツール名 (関数名)。 |
説明 | LLM がツールの機能を理解するために役立つツールの説明。 |
引数 | ツールの引数(関数の引数)。 |
リクエストテンプレート | ターゲット HTTP API へのマッピングを要求します。 |
レスポンステンプレート | ターゲット HTTP API のレスポンスのレスポンス マッピング。 |
単一引数のプロパティは次のように定義されます。
アイテム | タイプ | 説明 |
---|---|---|
名前 | LLM に提供される引数名。 | |
説明 | LLM が理解し、どの値を入力すべきかを決定するための引数の説明。 | |
必須 | ブール値 | 必須の引数かどうか。 |
リクエスト テンプレートのプロパティは次のように定義されます。
アイテム | 説明 |
---|---|
方法 | HTTPメソッド |
URL | ターゲットHTTP API URLテンプレート |
ヘッダー | HTTPヘッダー |
HTTP ヘッダーは次のように定義されます。
アイテム | 説明 |
---|---|
鍵 | ヘッダーキー |
価値 | ヘッダー値テンプレート |
レスポンス テンプレートのプロパティは次のように定義されます。
アイテム | 説明 |
---|---|
体 | レスポンス本文テンプレート |
貢献
あらゆる種類の貢献を歓迎します。
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
モデル コンテキスト プロトコル (MCP) ツール呼び出しを従来の HTTP API 要求に変換するサーバー。これにより、構成可能なマッピングを通じて既存の HTTP API を MCP 領域に統合できるようになります。
Related MCP Servers
- -securityAlicense-qualityMCP 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 -43TypeScriptMIT License
- -securityAlicense-qualityMCP 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 -132TypeScriptMIT License
- -securityAlicense-qualityAn MCP server that exposes HTTP methods defined in an OpenAPI specification as tools, enabling interaction with APIs via the Model Context Protocol.Last updated -2PythonMIT License
- -securityAlicense-qualityA 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 -PythonMIT License