@procedures/mcp-server 0.27.6 → 0.27.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @procedures/mcp-server
2
2
 
3
+ ## 0.27.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 72718d7: The stop of the intake of `mcpFace()` and of the HTTP face of `createMcpHost()` ends the idle GET streams of the MCP sessions (roadmap CLI-72).
8
+
9
+ PATCH: a fix with no API change.
10
+
11
+ - This fix applies to both Streamable HTTP faces: `mcpFace()` on a procedures host, and `faces.http` of `createMcpHost()` under `declare(svc)`.
12
+ - Before, each session kept its GET stream open until the close of the face. The drain of the listener counted each open stream as work in progress. Thus a host with connected MCP clients waited for the full cap of the drain at each stop, also with no call in progress. On the fleet site, six idle clients made each stop wait for its 4 s cap.
13
+ - With this fix, the stop of the intake ends the GET stream of each session without a task in progress. The SDK ends the response in its protocol, so a client of the MCP SDK connects again, to the next server. Thus the drain waits only for the calls and the tasks.
14
+ - A session with a task in progress keeps its GET stream, because the progress and the end of the task go on it. The stream ends with the work of the task.
15
+ - After the stop of the intake, a new session and a new GET stream get 503 with `UNAVAILABLE` and `Retry-After`, as on the other faces. A POST or a DELETE of a session goes on, so a call in progress completes with its answer stream.
16
+ - The test `mcp-stop.test.ts` of `@procedures/peer` measures the stop of `mcpFace()` on the fake clock of the host. The test `runner.test.ts` of this package measures the stop of `createMcpHost()` on the fake clock of its service.
17
+ - @procedures/client@0.27.7
18
+ - @procedures/mcp@0.27.7
19
+
3
20
  ## 0.27.6
4
21
 
5
22
  ### Patch Changes
package/README.md CHANGED
@@ -142,6 +142,7 @@ The server of the face checks the credentials of each request one time (CLI-2b,
142
142
  - The server of the host is the transport part `mcp`. Each storage of the server is a dependency.
143
143
  - A host with a stdio face declares the trigger `stdin-close`. The end of the input starts the stop in stages, and the face does not stop the host by itself.
144
144
  - The HTTP face has no listener. Mount `host.handleHttp` on an `httpTransport` of `@mark1russell7/service/http`, and declare that transport on the service.
145
+ - At the stop of the intake, the HTTP face ends the idle GET streams, as `mcpFace()` does (CLI-72). Thus the drain of the listener waits only for the calls and the tasks. Refer to [The face of a procedures host](#the-face-of-a-procedures-host).
145
146
 
146
147
  ```typescript
147
148
  import { createServer } from "node:http";
@@ -391,6 +392,14 @@ The face adds `narrowing` to each call as one more source of the narrowing key (
391
392
  - The face lists only the tools that the narrowed capability permits. The time of a narrowing limits each call, not the tools.
392
393
  - A narrowing that is not valid stops the factory with an error. Examples are an unknown field and a clearance outside the order of the policy.
393
394
 
395
+ The face stops with the host (CLI-72). At the stop of the intake, the face does these steps:
396
+
397
+ - It ends the GET stream of each session without a task in progress. The response ends in the protocol, so a client of the MCP SDK connects again, to the next server.
398
+ - It keeps the GET stream of a session with a task in progress. The progress and the end of the task go on that stream. The stream ends with the work of the task.
399
+ - It refuses a new session and a new GET stream with the status 503 and a `Retry-After` header. The other faces refuse new work in the same way. A POST or a DELETE of a session goes on, so a call in progress completes.
400
+
401
+ Thus the drain of the listener waits only for the calls and the tasks. Before, each GET stream stayed open until the close of the face. Thus each stop with a connected client waited for the full cap of the drain.
402
+
394
403
  ## The procedures of this package
395
404
 
396
405
  | Procedure | Function |