You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e13d7b3
Browse filesBrowse the repository at this point in the historyBrowse files
feat(client)!: support stateful streamable-HTTP servers
mcpInitialize now sends notifications/initialized and returns an McpSession
whose Mcp-Session-Id and MCP-Protocol-Version later requests carry. Discovery,
mcpTools and the sidecar bundle pass it on, and reopen it after a failed
call. A protocolVersion that is not printable ASCII is refused before it is
echoed into a header, and a timed-out notification is an McpError. Non-JSON
data frames are skipped, and only a message with result or error and no
method counts as the response. e2e covers the official SDK's stateless and
stateful server transports; the SDK is a devDependency only.
BREAKING CHANGE: mcpInitialize returns McpSession instead of McpServerInfo.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,10 @@
5
5
```sh
6
6
bun install
7
7
bun run check
8
+
bun run test:e2e
8
9
```
9
10
10
-
`bun run check` runs typecheck, lint, format check and unit tests. `bun run format` rewrites the tree.
11
+
`bun run check` runs typecheck, lint, format check and unit tests. `bun run test:e2e` runs the client against the official SDK's server transports. `bun run format` rewrites the tree.
11
12
12
13
Contributors sign the [CLA](CLA.md) on their first PR; the CLA bot explains how.
Copy file name to clipboardExpand all lines: README.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ A Corbits tool pack for the Interchange sidecar that turns each tool on a remote
8
8
2.**The agent never holds the server's token.** Calls go through a mediated credential: a fetch pinned to the server's origin that adds the bearer per request.
9
9
3.**Destructive tools stay behind approval.** Every generated tool starts `ask`-marked, and a tool the server flags `destructiveHint: true` cannot be lowered to `allow`.
10
10
11
-
It supports `initialize`, `tools/list` and `tools/call` only. It does not send `Mcp-Session-Id`, so servers that require a session are not supported.
11
+
It supports `initialize`, `tools/list` and `tools/call` only, against stateless and stateful (`Mcp-Session-Id`) servers.
12
12
13
13
## Install
14
14
@@ -32,13 +32,13 @@ Lists the tools on a public MCP server:
Every client call takes `{ fetch, timeoutMs, signal }` as its last argument, for example a fetch that adds an `Authorization` header. `timeoutMs` covers the request and reading its body, and `signal` cancels both. `mcpTools` and `mcpServers` take a `timeoutMs` option, 60 seconds by default, and pass each tool call's abort signal through, so a stalling server fails that call instead of hanging it. A response body or event-stream frame over 4 MiB is refused and the stream cancelled.
41
+
Every client call takes `{ fetch, timeoutMs, signal, session }` as its last argument, for example a fetch that adds an `Authorization` header. `timeoutMs` covers the request and reading its body, and `signal` cancels both. `mcpTools` and `mcpServers` take a `timeoutMs` option, 60 seconds by default, and pass each tool call's abort signal through, so a stalling server fails that call instead of hanging it. A response body or event-stream frame over 4 MiB is refused and the stream cancelled.
42
42
43
43
## Where it fits
44
44
@@ -52,7 +52,7 @@ Every client call takes `{ fetch, timeoutMs, signal }` as its last argument, for
|`mcpTools(options, env?)`|`@corbits/mcp`| Discover each server live, then build tools. For hosts that can await; servers use `name` and `credentialHandle`. |
@@ -174,6 +174,7 @@ Grant the agent's principal `tool:deepwiki.*` for the whole server, or `tool:dee
174
174
-`@intx/db`, `@intx/hub-api`, `drizzle-orm`, `hono` and `@corbits/credential-http` are optional peers. Install them if you use `@corbits/mcp/hub`. `@corbits/credential-http` replaces `@corbits/credential-mcp`.
175
175
- Discovery with a credential pins to the credential's provider `apiBaseUrl` origin, not to the requested URL's origin. A credential with a secret whose provider has no `apiBaseUrl` is refused, and a URL on another origin needs `extraOrigins`. No origin is allowed by default.
176
176
-`readCredentialSecret` is now `readCredential`, which returns `{ secret, origin? }`. `discoverMcpServer` takes `credential: { secret, origin? }` instead of `secret`.
177
+
-`mcpInitialize` returns an `McpSession` (`protocolVersion`, `sessionId?`, `serverInfo?`) and sends `notifications/initialized`. Pass it as `{ session }` to `mcpListTools` and `mcpCallTool`; a stateful server needs it.
177
178
-`@intx/agent` and `@intx/harness` peers are `^0.4.0`.
178
179
- Discovery rejects authorization-server metadata whose `issuer` differs from the one the protected resource names.
0 commit comments