@acid-cat/mcp-handshake 0.14.0 → 0.16.0

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.
Files changed (2) hide show
  1. package/README.md +13 -9
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @acid-cat/mcp-handshake
2
2
 
3
- The [`initialize` handshake of earlier MCP revisions](../../spec/bindings/mcp.md#earlier-revisions-through-http) in front of an MCP server through HTTP. npm package: `@acid-cat/mcp-handshake`.
3
+ `@acid-cat/mcp-handshake` lets an MCP server that speaks only revision `2026-07-28` also serve clients that open with the [`initialize` handshake of earlier revisions](../../spec/bindings/mcp.md#earlier-revisions-through-http) (`2025-11-25` and `2025-06-18`). Many MCP clients still use that handshake.
4
4
 
5
- An MCP server of the [MCP binding](../../spec/bindings/mcp.md#http) through HTTP serves revision `2026-07-28`. Many MCP clients open the session with the `initialize` handshake of revision `2025-11-25` or `2025-06-18`. `mcpHandshake(handler)` gives a web handler that serves these clients too. It keeps no state.
5
+ `mcpHandshake(handler)` wraps a web handler of the [MCP binding through HTTP](../../spec/bindings/mcp.md#http) and returns a new web handler. The wrapper keeps no state. It works in front of any web handler that serves revision `2026-07-28`.
6
6
 
7
- This package is part of the TypeScript reference implementation. [`@acid-cat/core-ts`](../core-ts) gives it as `mcpHandshake`, and [`@acid-cat/core-effect`](../core-effect) gives it as `Mcp.withHandshake`. It works in front of any web handler that serves MCP revision `2026-07-28`.
7
+ The package is part of the TypeScript reference implementation. You usually get it through a core: [`@acid-cat/core-ts`](../core-ts) re-exports it as `mcpHandshake`, and [`@acid-cat/core-effect`](../core-effect) as `Mcp.withHandshake`.
8
8
 
9
9
  ```sh
10
10
  pnpm add @acid-cat/mcp-handshake
@@ -12,12 +12,16 @@ pnpm add @acid-cat/mcp-handshake
12
12
 
13
13
  ## Use
14
14
 
15
+ With `@acid-cat/core-ts`:
16
+
15
17
  ```ts
16
18
  import { mcpHandler, mcpHandshake } from "@acid-cat/core-ts";
17
19
 
18
20
  const mcp = mcpHandshake(mcpHandler(app, options));
19
21
  ```
20
22
 
23
+ With `@acid-cat/core-effect`:
24
+
21
25
  ```ts
22
26
  import { Mcp } from "@acid-cat/core-effect";
23
27
 
@@ -26,14 +30,14 @@ const mcp = Mcp.withHandshake(Mcp.toWebHandler(app, layer, options));
26
30
 
27
31
  | Option | Default | Use |
28
32
  | --- | --- | --- |
29
- | `maximumBytes` | 1 MiB | The longest body that the wrapper reads. The wrapper sends a longer body to the handler unchanged, and the handler rejects it |
33
+ | `maximumBytes` | 1 MiB | The largest body that the wrapper reads. The wrapper passes a larger body to the handler unchanged, and the handler rejects it |
30
34
 
31
35
  ## How it works
32
36
 
33
- - A request of revision `2026-07-28`, and a request that is not `POST`, go to the handler unchanged.
34
- - The wrapper sends each request of a handshake to the handler as a request of revision `2026-07-28`: `tools/list` and `tools/call` as they are, and each other method as `server/discover`. So the handler screens the origin, the media type and the size of each request.
37
+ - A request of revision `2026-07-28`, and any request that is not `POST`, goes to the handler unchanged.
38
+ - The wrapper turns each handshake request into a revision `2026-07-28` request for the handler: `tools/list` and `tools/call` pass as they are, and every other method becomes `server/discover`. The handler therefore still screens each request's origin, media type and size.
35
39
  - A response that is not 2xx comes back unchanged.
36
- - `initialize` gives the result of `server/discover` in the form of the handshake. `ping` gives an empty result. A notification gets 202. Another method gets the JSON-RPC error `-32601`.
37
- - A result has no `_meta`, `resultType`, `ttlMs` or `cacheScope` member. A JSON-RPC error has the HTTP status 200.
40
+ - `initialize` returns the result of `server/discover` in the handshake's shape. `ping` returns an empty result. A notification gets 202. Any other method gets the JSON-RPC error `-32601`.
41
+ - Results carry no `_meta`, `resultType`, `ttlMs` or `cacheScope` member. A JSON-RPC error has HTTP status 200.
38
42
 
39
- The wrapper keeps no session, so it does not send `notifications/tools/list_changed`. Its capabilities are `"tools": { "listChanged": false }`. A client that must see the changes of the tools uses revision `2026-07-28`, or MCP through stdio.
43
+ Because the wrapper keeps no session, it never sends `notifications/tools/list_changed`, and it declares `"tools": { "listChanged": false }`. A client that needs to see tool changes must use revision `2026-07-28` or MCP through stdio.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acid-cat/mcp-handshake",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "description": "Serve MCP clients of the revisions with an initialize handshake from an AcidCat MCP server through HTTP, with no state. Part of the TypeScript reference implementation.",
5
5
  "keywords": [
6
6
  "acidcat",
@@ -31,7 +31,7 @@
31
31
  "access": "public"
32
32
  },
33
33
  "dependencies": {
34
- "@acid-cat/spec-ts": "0.14.0"
34
+ "@acid-cat/spec-ts": "0.16.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "26.6.6",