@jadchene/mcp-gateway-service 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/README_zh.md +9 -7
- package/dist/mcp/versions.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,17 +4,17 @@ English | [简体中文](./README_zh.md)
|
|
|
4
4
|
|
|
5
5
|
MCP Gateway is a token-efficient Model Context Protocol gateway. It exposes six stable routing tools instead of flattening every downstream tool into each client's startup context.
|
|
6
6
|
|
|
7
|
-
MCP Gateway v0.6.
|
|
7
|
+
MCP Gateway v0.6.2 uses the official TypeScript SDK v2.
|
|
8
8
|
|
|
9
9
|
> [!IMPORTANT]
|
|
10
|
-
> v0.6.
|
|
10
|
+
> MCP Gateway v0.6.2 and later accept only MCP `2026-07-28`, `2025-11-25`, and `2025-06-18`, using standard newline-delimited stdio or single-endpoint Streamable HTTP. Standalone HTTP+SSE (`/sse`), `Content-Length` framing, and other protocol revisions are not supported.
|
|
11
11
|
|
|
12
12
|
## Capabilities
|
|
13
13
|
|
|
14
14
|
- Inbound MCP server over stdio and stateless Streamable HTTP.
|
|
15
15
|
- Outbound MCP client over standard stdio and Streamable HTTP.
|
|
16
|
-
- Automatic negotiation
|
|
17
|
-
-
|
|
16
|
+
- Automatic negotiation among MCP `2026-07-28`, `2025-11-25`, and `2025-06-18`.
|
|
17
|
+
- All three standard revisions are served automatically on inbound transports.
|
|
18
18
|
- Full downstream tool metadata and JSON Schema 2020-12 preservation.
|
|
19
19
|
- MRTR elicitation forwarding, opaque `requestState` forwarding, arbitrary JSON `structuredContent`, cancellation, and `x-mcp-header` handling through the SDK.
|
|
20
20
|
- SDK-managed response cache hints and client-local private caches.
|
|
@@ -41,7 +41,9 @@ When HTTP is enabled, the process serves both stdio and HTTP. Use `--version` or
|
|
|
41
41
|
|
|
42
42
|
## Protocol Negotiation
|
|
43
43
|
|
|
44
|
-
Protocol selection is automatic. The gateway and its downstream clients
|
|
44
|
+
Protocol selection is automatic. The gateway and its downstream clients prefer MCP `2026-07-28`, then negotiate `2025-11-25` or `2025-06-18` when required by the peer. These are the only accepted protocol revisions. Inbound Streamable HTTP response shaping is selected automatically by the official SDK.
|
|
45
|
+
|
|
46
|
+
For MCP `2025-11-25`, the gateway negotiates only capabilities it implements. Experimental Tasks, URL-mode elicitation, and sampling tool calls are not advertised.
|
|
45
47
|
|
|
46
48
|
## Service Configuration
|
|
47
49
|
|
|
@@ -93,7 +95,7 @@ Common fields:
|
|
|
93
95
|
|
|
94
96
|
MCP `2026-07-28` HTTP is stateless: each request is an independent `POST /mcp`. The gateway does not create `Mcp-Session-Id` sessions, and `GET`/`DELETE` return `405`. The SDK validates `MCP-Protocol-Version`, `Mcp-Method`, `Mcp-Name`, request metadata, and protocol errors.
|
|
95
97
|
|
|
96
|
-
The same endpoint serves MCP `2025-06-18` through
|
|
98
|
+
The same endpoint serves MCP `2025-11-25` and `2025-06-18` through their standard stateless Streamable HTTP form. As a downstream client, the gateway preserves a session for either revision when a server issues `Mcp-Session-Id`.
|
|
97
99
|
|
|
98
100
|
The default bind address is `127.0.0.1`. Host and Origin checks protect the local endpoint from DNS rebinding. Do not expose it beyond a trusted local network without an authentication layer.
|
|
99
101
|
|
|
@@ -115,7 +117,7 @@ Recommended flow:
|
|
|
115
117
|
3. Reuse schemas returned by `includeSchema: true`, or batch exact names with `gateway_get_tool_schema`.
|
|
116
118
|
4. Call `gateway_call_tool`; always provide `arguments`, using `{}` for a no-argument tool.
|
|
117
119
|
|
|
118
|
-
`gateway_call_tool` intentionally has no fixed output schema because downstream `structuredContent` may be any JSON value.
|
|
120
|
+
`gateway_call_tool` intentionally has no fixed output schema because downstream `structuredContent` may be any JSON value. MCP `2026-07-28` MRTR `input_required` results are forwarded without automatic approval; the upstream client must declare the required capability and retry with `inputResponses` and the opaque `requestState`.
|
|
119
121
|
|
|
120
122
|
## Client Examples
|
|
121
123
|
|
package/README_zh.md
CHANGED
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
MCP Gateway 是一个节省 token 的 Model Context Protocol 网关。它不把所有下游工具展开到每个客户端的启动上下文,而是通过 6 个稳定工具完成发现、管理和转发。
|
|
6
6
|
|
|
7
|
-
MCP Gateway v0.6.
|
|
7
|
+
MCP Gateway v0.6.2 使用官方 TypeScript SDK v2。
|
|
8
8
|
|
|
9
9
|
> [!IMPORTANT]
|
|
10
|
-
> v0.6.
|
|
10
|
+
> MCP Gateway v0.6.2 及后续版本仅接受 MCP `2026-07-28`、`2025-11-25` 和 `2025-06-18`,传输方式仅支持标准换行分隔 stdio 和单端点 Streamable HTTP。不支持独立 HTTP+SSE(`/sse`)、`Content-Length` framing 和其他协议版本。
|
|
11
11
|
|
|
12
12
|
## 能力
|
|
13
13
|
|
|
14
14
|
- 上游同时支持 stdio 和无状态 Streamable HTTP。
|
|
15
15
|
- 下游支持标准 stdio 和 Streamable HTTP。
|
|
16
|
-
- 在 MCP `2026-07-28` 与 `2025-06-18` 之间自动协商。
|
|
17
|
-
-
|
|
16
|
+
- 在 MCP `2026-07-28`、`2025-11-25` 与 `2025-06-18` 之间自动协商。
|
|
17
|
+
- 入站传输自动服务这三个标准版本。
|
|
18
18
|
- 完整转发下游工具元数据和 JSON Schema 2020-12。
|
|
19
19
|
- 由 SDK 处理 MRTR elicitation、opaque `requestState`、任意 JSON `structuredContent`、取消传播和 `x-mcp-header`。
|
|
20
20
|
- 遵守 SDK 缓存提示,private 缓存按客户端实例隔离。
|
|
@@ -41,7 +41,9 @@ mcp-gateway-service --config ./config.json --http --host 127.0.0.1 --port 3100 -
|
|
|
41
41
|
|
|
42
42
|
## 协议协商
|
|
43
43
|
|
|
44
|
-
协议选择完全自动:网关及其下游客户端优先协商 MCP `2026-07-28
|
|
44
|
+
协议选择完全自动:网关及其下游客户端优先协商 MCP `2026-07-28`,并根据对端能力协商 `2025-11-25` 或 `2025-06-18`。只接受这三个协议版本。入站 Streamable HTTP 的响应形态由官方 SDK 自动选择。
|
|
45
|
+
|
|
46
|
+
对于 MCP `2025-11-25`,网关只协商已实现的能力,不声明实验性 Tasks、URL 模式 elicitation 和 sampling 工具调用。
|
|
45
47
|
|
|
46
48
|
## 服务配置
|
|
47
49
|
|
|
@@ -93,7 +95,7 @@ mcp-gateway-service --config ./config.json --http --host 127.0.0.1 --port 3100 -
|
|
|
93
95
|
|
|
94
96
|
MCP `2026-07-28` HTTP 是无状态的:每个请求都是独立的 `POST /mcp`。网关不创建 `Mcp-Session-Id`,`GET` 和 `DELETE` 返回 `405`。标准版本头、方法头、名称头、每请求 metadata 和协议错误由 SDK 校验。
|
|
95
97
|
|
|
96
|
-
同一 endpoint 通过标准无状态 Streamable HTTP 服务 MCP `2025-
|
|
98
|
+
同一 endpoint 通过标准无状态 Streamable HTTP 服务 MCP `2025-11-25` 和 `2025-06-18`。作为下游客户端,如果任一版本的服务端签发 `Mcp-Session-Id`,网关会按标准维持该 session。
|
|
97
99
|
|
|
98
100
|
默认只绑定 `127.0.0.1`。Host 和 Origin 校验用于防护 DNS rebinding;没有额外认证层时,不应把端口暴露到不可信网络。
|
|
99
101
|
|
|
@@ -115,7 +117,7 @@ MCP `2026-07-28` HTTP 是无状态的:每个请求都是独立的 `POST /mcp`
|
|
|
115
117
|
3. 复用 `includeSchema: true` 返回的 schema;已知准确名称时用 `gateway_get_tool_schema` 一次批量查询。
|
|
116
118
|
4. 使用 `gateway_call_tool` 调用;`arguments` 始终必填,无参数工具传 `{}`。
|
|
117
119
|
|
|
118
|
-
`gateway_call_tool` 不声明固定输出 schema,因为下游 `structuredContent` 可以是任意 JSON。
|
|
120
|
+
`gateway_call_tool` 不声明固定输出 schema,因为下游 `structuredContent` 可以是任意 JSON。MCP `2026-07-28` MRTR 的 `input_required` 不会被自动同意;上游必须声明所需能力,并使用 `inputResponses` 和 opaque `requestState` 重试。
|
|
119
121
|
|
|
120
122
|
## 客户端示例
|
|
121
123
|
|
package/dist/mcp/versions.js
CHANGED
package/package.json
CHANGED