@jadchene/mcp-gateway-service 0.6.0 → 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 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.0 uses the official TypeScript SDK v2.
7
+ MCP Gateway v0.6.2 uses the official TypeScript SDK v2.
8
8
 
9
9
  > [!IMPORTANT]
10
- > v0.6.0 and later support only MCP `2026-07-28` and `2025-06-18`, using standard newline-delimited stdio or single-endpoint Streamable HTTP. Compatibility with older protocol revisions, standalone HTTP+SSE (`/sse`), and `Content-Length` framing has been removed.
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 between MCP `2026-07-28` and `2025-06-18`.
17
- - Both standard revisions are served automatically on inbound transports.
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 negotiate MCP `2026-07-28` first and use `2025-06-18` when the peer supports only that standard revision. These are the only accepted protocol revisions. `--json-response` selects the standard inbound Streamable HTTP response shape; it does not create protocol sessions.
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 its standard stateless Streamable HTTP form. As a downstream client, the gateway also preserves a `2025-06-18` session when a server issues `Mcp-Session-Id`.
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. Modern 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`.
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.0 使用官方 TypeScript SDK v2。
7
+ MCP Gateway v0.6.2 使用官方 TypeScript SDK v2。
8
8
 
9
9
  > [!IMPORTANT]
10
- > v0.6.0 及后续版本仅支持 MCP `2026-07-28` 和 `2025-06-18`,传输方式仅支持标准换行分隔 stdio 和单端点 Streamable HTTP。已移除对更早协议版本、独立 HTTP+SSE(`/sse`)和 `Content-Length` framing 的兼容支持。
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`,对端仅支持 `2025-06-18` 时使用该标准版本。只接受这两个协议版本。`--json-response` 只选择标准入站 Streamable HTTP 的响应形态,不会创建协议 session。
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-06-18`。作为下游客户端,如果 `2025-06-18` 服务端签发 `Mcp-Session-Id`,网关会按标准维持该 session。
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。modern MRTR 的 `input_required` 不会被自动同意;上游必须声明所需能力,并使用 `inputResponses` 和 opaque `requestState` 重试。
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/config.js CHANGED
@@ -134,9 +134,6 @@ function validateHttpTransportConfig(serviceId, input) {
134
134
  if (input.mode !== undefined) {
135
135
  throw new Error(`Service '${serviceId}' transport.mode is no longer supported; HTTP always uses Streamable HTTP.`);
136
136
  }
137
- if (input.enableJsonResponse !== undefined) {
138
- throw new Error(`Service '${serviceId}' transport.enableJsonResponse is no longer supported.`);
139
- }
140
137
  if (input.protocolMode !== undefined) {
141
138
  throw new Error(`Service '${serviceId}' transport.protocolMode is no longer supported; protocol negotiation is automatic.`);
142
139
  }
@@ -26,7 +26,6 @@ export class StreamableHttpGatewayServer {
26
26
  this.logger = logger;
27
27
  this.handler = createMcpHandler(() => createGatewayMcpServer(engine), {
28
28
  legacy: "stateless",
29
- responseMode: config.enableJsonResponse ? "json" : "auto",
30
29
  onerror: (error) => {
31
30
  this.logger.error("gateway.http_protocol_error", { message: error.message });
32
31
  }
@@ -66,8 +65,7 @@ export class StreamableHttpGatewayServer {
66
65
  this.logger.info("gateway.http_started", {
67
66
  host: this.config.host,
68
67
  port: this.config.port,
69
- path: this.config.path,
70
- responseMode: this.config.enableJsonResponse ? "json" : "auto"
68
+ path: this.config.path
71
69
  });
72
70
  }
73
71
  /**
package/dist/index.js CHANGED
@@ -123,7 +123,6 @@ export function parseCliArgs(args) {
123
123
  const host = readOption(args, "--host");
124
124
  const path = readHttpPathOption(args);
125
125
  const enableHttp = args.includes("--http");
126
- const enableJsonResponse = args.includes("--json-response");
127
126
  return {
128
127
  configPath,
129
128
  server: enableHttp
@@ -131,8 +130,7 @@ export function parseCliArgs(args) {
131
130
  enable: true,
132
131
  host: host ?? "127.0.0.1",
133
132
  port: port ?? 3000,
134
- path: path ?? "/mcp",
135
- enableJsonResponse
133
+ path: path ?? "/mcp"
136
134
  }
137
135
  : undefined
138
136
  };
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Lists the only MCP protocol revisions accepted by the gateway.
3
3
  */
4
- export const SUPPORTED_MCP_PROTOCOL_VERSIONS = ["2026-07-28", "2025-06-18"];
4
+ export const SUPPORTED_MCP_PROTOCOL_VERSIONS = ["2026-07-28", "2025-11-25", "2025-06-18"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jadchene/mcp-gateway-service",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "A token-efficient MCP gateway that provides one unified entry point for multiple downstream MCP services.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",