package envoy.extensions.filters.http.mcp_json_rest_bridge.v3

Mouse Melon logoGet desktop application:
View/edit binary Protocol Buffers messages

message HttpRule

mcp_json_rest_bridge.proto:175

Defines the schema of the JSON-RPC to REST mapping. It specifies how the "arguments" in a tools/call request are mapped to the URL path, query parameters, and HTTP request body. Mapping Rules: 1. Path: Fields defined in the path template (e.g., ``/v1/resources/{id}``) are extracted from arguments and placed in the URL. 2. Body: Determined by the ``body`` field. - If "*": All arguments not used in the path become the HTTP JSON body. - If specify a field: Only that specific argument becomes the HTTP JSON body. - If empty: No body is sent. 3. Query: Any leaf arguments not mapped to Path or Body are added as URL query parameters. [#next-free-field: 7]

Used in: ServerToolConfig, ToolConfig

message McpJsonRestBridge

mcp_json_rest_bridge.proto:93

Configuration for the MCP MCP JSON REST Bridge. This extension translates Model Context Protocol (MCP) JSON-RPC requests into standard JSON-REST HTTP requests. This enables existing REST backends to function as MCP servers without native MCP support. Main functionalities: 1. Transcoding: Converts JSON-RPC request payload to HTTP REST request, and maps JSON response back to JSON-RPC. 2. Session negotiation: Handles MCP connection prerequisites. The core logic transforms "tools/call" request into HTTP request following the ``HttpRule`` specification. Example 1: GET request with path and query parameters .. code-block:: text tools: { name: "getResource" http_rule: { get: "/v1/projects/{project_id}/resources/{resource_id}" // body is omitted for GET } } If tools/call params are: { "name": "getResource", "arguments": {"project_id": "foo", "resource_id": "res-789", "view": "FULL"} } Translation: - Method: GET - URL: /v1/projects/foo/resources/res-789?view=FULL (Arguments not matching path templates become query parameters.) Example 2: POST request with wildcard body .. code-block:: text tools: { name: "createResource" http_rule: { post: "/v1/projects/{project_id}/resources" body: "*" } } If tools/call params are: { "name": "createResource", "arguments": {"project_id": "foo", "resource_id": "res-456", "payload": { "data": "some value" }} } Translation: - Method: POST - URL: /v1/projects/foo/resources - Body: {"resource_id": "res-456", "payload": { "data": "some value" }} (Arguments not used in the path form the body, as per body: "*".) Example 3: PUT request with a specific field as body .. code-block:: text tools: { name: "updateResource" http_rule: { put: "/v1/projects/{project_id}" body: "payload" } } If tools/call params are: { "name": "updateResource", "arguments": {"project_id": "foo", "resource_id": "res-456", "payload": { "data": "updated value" }} } Translation: - Method: PUT - URL: /v1/projects/foo?resource_id=res-456 - Body: {"data": "updated value"} (Only the "payload" field from arguments is used as the body. Other arguments not in the path, like 'resource_id', become query parameters.)

message ServerInfo

mcp_json_rest_bridge.proto:102

Configuration for the server metadata.

Used in: McpJsonRestBridge

message ServerToolConfig

mcp_json_rest_bridge.proto:131

Configuration for the MCP tool capability of the server.

Used in: McpJsonRestBridge

message ToolConfig

mcp_json_rest_bridge.proto:154

Configuration for a specific MCP tool.

Used in: ServerToolConfig