@frontmcp/protocol 1.5.7 → 1.6.1
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 +71 -0
- package/esm/index.mjs +67 -2
- package/index.d.ts +1 -0
- package/index.js +67 -2
- package/package.json +1 -1
- package/types-20260728.d.ts +197 -0
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# @frontmcp/protocol
|
|
2
|
+
|
|
3
|
+
The single boundary between FrontMCP and the upstream
|
|
4
|
+
[`@modelcontextprotocol/sdk`](https://www.npmjs.com/package/@modelcontextprotocol/sdk).
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/@frontmcp/protocol)
|
|
7
|
+
|
|
8
|
+
> **Internal package.** It is published so the other `@frontmcp/*` packages can
|
|
9
|
+
> resolve it — you should not import it from application code. Import MCP types
|
|
10
|
+
> from [`@frontmcp/sdk`](https://www.npmjs.com/package/@frontmcp/sdk) instead,
|
|
11
|
+
> and use `McpClient` from `@frontmcp/testing` for a raw client in tests.
|
|
12
|
+
|
|
13
|
+
## Why it exists
|
|
14
|
+
|
|
15
|
+
`libs/protocol/src/types.ts` is the **only** file in the whole monorepo that
|
|
16
|
+
transitively imports `@modelcontextprotocol/sdk`. Everything else — SDK,
|
|
17
|
+
adapters, plugins, auth, tests — imports from `@frontmcp/protocol`.
|
|
18
|
+
|
|
19
|
+
That indirection means swapping, pinning, or dropping the upstream package is a
|
|
20
|
+
one-file change instead of a repo-wide refactor. The
|
|
21
|
+
[`@nx/dependency-checks`](https://nx.dev) lint rule enforces it: adding a direct
|
|
22
|
+
upstream import anywhere else fails the build.
|
|
23
|
+
|
|
24
|
+
✅ Route through the boundary:
|
|
25
|
+
|
|
26
|
+
<!-- prettier-ignore -->
|
|
27
|
+
```ts
|
|
28
|
+
import { CallToolRequestSchema, McpError, type Tool } from '@frontmcp/protocol';
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
❌ Never import the upstream package directly — that locks every call site to it:
|
|
32
|
+
|
|
33
|
+
<!-- prettier-ignore -->
|
|
34
|
+
```ts
|
|
35
|
+
import { McpError } from '@modelcontextprotocol/sdk/types.js';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
If a type you need is not reachable from `@frontmcp/protocol`, re-export it from
|
|
39
|
+
`libs/protocol/src/types.ts` rather than reaching around the boundary.
|
|
40
|
+
|
|
41
|
+
## What it exports
|
|
42
|
+
|
|
43
|
+
| Area | Contents |
|
|
44
|
+
| ------------------- | ---------------------------------------------------------------------------------------- |
|
|
45
|
+
| Protocol types | Requests, results, notifications, schemas, `McpError`, capabilities |
|
|
46
|
+
| Protocol 2026-07-28 | Types the upstream SDK does not ship yet — see below |
|
|
47
|
+
| Server | `McpServer`, `StreamableHTTPServerTransport`, `WebStandardStreamableHTTPServerTransport` |
|
|
48
|
+
| Client | `Client`, `StreamableHTTPClientTransport`, `SSEClientTransport` |
|
|
49
|
+
| Transports | stdio (Node + browser), in-memory |
|
|
50
|
+
| Auth types | `AuthInfo` and friends |
|
|
51
|
+
|
|
52
|
+
Node and browser/worker variants are selected automatically through package
|
|
53
|
+
[subpath imports](https://nodejs.org/api/packages.html#subpath-imports), so the
|
|
54
|
+
same import works in every runtime FrontMCP targets.
|
|
55
|
+
|
|
56
|
+
## Protocol 2026-07-28
|
|
57
|
+
|
|
58
|
+
The upstream SDK tops out at `2025-11-25`. Revision `2026-07-28` is therefore
|
|
59
|
+
defined here — `MCP_20260728_META`, `MCP_20260728_ERROR_CODES`, `CacheableResult`,
|
|
60
|
+
`DiscoverResult`, `InputRequiredResult`, `SubscriptionFilter`, and the rest.
|
|
61
|
+
|
|
62
|
+
Everything is **additive**: the 2025-and-earlier types are untouched, because a
|
|
63
|
+
FrontMCP server serves both eras on the same endpoint. When upstream catches up,
|
|
64
|
+
`types-20260728.ts` is the only file that has to change.
|
|
65
|
+
|
|
66
|
+
See the [protocol versions guide](https://docs.agentfront.dev/frontmcp/fundamentals/protocol-versions)
|
|
67
|
+
for what the revision changed and how FrontMCP selects one per request.
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
Apache-2.0
|
package/esm/index.mjs
CHANGED
|
@@ -23,13 +23,22 @@ __export(index_exports, {
|
|
|
23
23
|
HttpServerResponse: () => HttpServerResponse,
|
|
24
24
|
InMemoryTransport: () => InMemoryTransport,
|
|
25
25
|
IncomingMessage: () => IncomingMessage,
|
|
26
|
+
MCP_20260728_ADDED_METHODS: () => MCP_20260728_ADDED_METHODS,
|
|
27
|
+
MCP_20260728_ERROR_CODES: () => MCP_20260728_ERROR_CODES,
|
|
28
|
+
MCP_20260728_META: () => MCP_20260728_META,
|
|
29
|
+
MCP_20260728_REMOVED_METHODS: () => MCP_20260728_REMOVED_METHODS,
|
|
30
|
+
MCP_20260728_RETIRED_ERROR_CODES: () => MCP_20260728_RETIRED_ERROR_CODES,
|
|
26
31
|
McpServer: () => Server,
|
|
32
|
+
PROTOCOL_2026_07_28: () => PROTOCOL_2026_07_28,
|
|
27
33
|
SSEClientTransport: () => SSEClientTransport,
|
|
34
|
+
SUBSCRIPTIONS_ACKNOWLEDGED_METHOD: () => SUBSCRIPTIONS_ACKNOWLEDGED_METHOD,
|
|
28
35
|
StdioClientTransport: () => StdioClientTransport,
|
|
29
36
|
StdioServerTransport: () => StdioServerTransport,
|
|
30
37
|
StreamableHTTPClientTransport: () => StreamableHTTPClientTransport,
|
|
31
38
|
StreamableHTTPServerTransport: () => StreamableHTTPServerTransport,
|
|
32
|
-
WebStandardStreamableHTTPServerTransport: () => WebStandardStreamableHTTPServerTransport
|
|
39
|
+
WebStandardStreamableHTTPServerTransport: () => WebStandardStreamableHTTPServerTransport,
|
|
40
|
+
isProtocol20260728: () => isProtocol20260728,
|
|
41
|
+
readDeclaredProtocolVersion: () => readDeclaredProtocolVersion
|
|
33
42
|
});
|
|
34
43
|
|
|
35
44
|
// libs/protocol/src/types.ts
|
|
@@ -40,6 +49,53 @@ import * as types_star from "@modelcontextprotocol/sdk/types.js";
|
|
|
40
49
|
// libs/protocol/src/index.ts
|
|
41
50
|
__reExport(index_exports, types_exports);
|
|
42
51
|
|
|
52
|
+
// libs/protocol/src/types-20260728.ts
|
|
53
|
+
var PROTOCOL_2026_07_28 = "2026-07-28";
|
|
54
|
+
var MCP_20260728_META = {
|
|
55
|
+
/** Request: protocol version; MUST match the `MCP-Protocol-Version` header. */
|
|
56
|
+
protocolVersion: "io.modelcontextprotocol/protocolVersion",
|
|
57
|
+
/** Request: self-reported client identity. */
|
|
58
|
+
clientInfo: "io.modelcontextprotocol/clientInfo",
|
|
59
|
+
/** Request: capabilities for THIS request only — never inferred from prior ones. */
|
|
60
|
+
clientCapabilities: "io.modelcontextprotocol/clientCapabilities",
|
|
61
|
+
/** Request: opt-in log level; absent means "send me no `notifications/message`". */
|
|
62
|
+
logLevel: "io.modelcontextprotocol/logLevel",
|
|
63
|
+
/** Result: self-reported server identity. */
|
|
64
|
+
serverInfo: "io.modelcontextprotocol/serverInfo",
|
|
65
|
+
/** Notification/result: id of the `subscriptions/listen` stream it belongs to. */
|
|
66
|
+
subscriptionId: "io.modelcontextprotocol/subscriptionId"
|
|
67
|
+
};
|
|
68
|
+
var MCP_20260728_ERROR_CODES = {
|
|
69
|
+
/** Headers disagree with the body, or a required header is missing/malformed. */
|
|
70
|
+
headerMismatch: -32020,
|
|
71
|
+
/** The request needs a client capability that was not declared. */
|
|
72
|
+
missingRequiredClientCapability: -32021,
|
|
73
|
+
/** The requested protocol version is not supported by this server. */
|
|
74
|
+
unsupportedProtocolVersion: -32022
|
|
75
|
+
};
|
|
76
|
+
var MCP_20260728_RETIRED_ERROR_CODES = [-32002, -32042];
|
|
77
|
+
var MCP_20260728_REMOVED_METHODS = [
|
|
78
|
+
"initialize",
|
|
79
|
+
"notifications/initialized",
|
|
80
|
+
"ping",
|
|
81
|
+
"logging/setLevel",
|
|
82
|
+
"notifications/roots/list_changed",
|
|
83
|
+
"resources/subscribe",
|
|
84
|
+
"resources/unsubscribe",
|
|
85
|
+
"tasks/list",
|
|
86
|
+
"tasks/result"
|
|
87
|
+
];
|
|
88
|
+
var MCP_20260728_ADDED_METHODS = ["server/discover", "subscriptions/listen"];
|
|
89
|
+
var SUBSCRIPTIONS_ACKNOWLEDGED_METHOD = "notifications/subscriptions/acknowledged";
|
|
90
|
+
function isProtocol20260728(version) {
|
|
91
|
+
return version === PROTOCOL_2026_07_28;
|
|
92
|
+
}
|
|
93
|
+
function readDeclaredProtocolVersion(body) {
|
|
94
|
+
const params = body?.params;
|
|
95
|
+
const declared = params?._meta?.[MCP_20260728_META.protocolVersion];
|
|
96
|
+
return typeof declared === "string" ? declared : void 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
43
99
|
// libs/protocol/src/client.ts
|
|
44
100
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
45
101
|
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
@@ -66,13 +122,22 @@ export {
|
|
|
66
122
|
HttpServerResponse,
|
|
67
123
|
InMemoryTransport,
|
|
68
124
|
IncomingMessage,
|
|
125
|
+
MCP_20260728_ADDED_METHODS,
|
|
126
|
+
MCP_20260728_ERROR_CODES,
|
|
127
|
+
MCP_20260728_META,
|
|
128
|
+
MCP_20260728_REMOVED_METHODS,
|
|
129
|
+
MCP_20260728_RETIRED_ERROR_CODES,
|
|
69
130
|
Server as McpServer,
|
|
131
|
+
PROTOCOL_2026_07_28,
|
|
70
132
|
SSEClientTransport,
|
|
133
|
+
SUBSCRIPTIONS_ACKNOWLEDGED_METHOD,
|
|
71
134
|
StdioClientTransport,
|
|
72
135
|
StdioServerTransport,
|
|
73
136
|
StreamableHTTPClientTransport,
|
|
74
137
|
StreamableHTTPServerTransport,
|
|
75
|
-
WebStandardStreamableHTTPServerTransport
|
|
138
|
+
WebStandardStreamableHTTPServerTransport,
|
|
139
|
+
isProtocol20260728,
|
|
140
|
+
readDeclaredProtocolVersion
|
|
76
141
|
};
|
|
77
142
|
|
|
78
143
|
export * from "@modelcontextprotocol/sdk/types.js";
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -25,13 +25,22 @@ __export(index_exports, {
|
|
|
25
25
|
HttpServerResponse: () => import_server_types.HttpServerResponse,
|
|
26
26
|
InMemoryTransport: () => import_inMemory.InMemoryTransport,
|
|
27
27
|
IncomingMessage: () => import_server_types.IncomingMessage,
|
|
28
|
+
MCP_20260728_ADDED_METHODS: () => MCP_20260728_ADDED_METHODS,
|
|
29
|
+
MCP_20260728_ERROR_CODES: () => MCP_20260728_ERROR_CODES,
|
|
30
|
+
MCP_20260728_META: () => MCP_20260728_META,
|
|
31
|
+
MCP_20260728_REMOVED_METHODS: () => MCP_20260728_REMOVED_METHODS,
|
|
32
|
+
MCP_20260728_RETIRED_ERROR_CODES: () => MCP_20260728_RETIRED_ERROR_CODES,
|
|
28
33
|
McpServer: () => import_mcp_server.Server,
|
|
34
|
+
PROTOCOL_2026_07_28: () => PROTOCOL_2026_07_28,
|
|
29
35
|
SSEClientTransport: () => import_sse.SSEClientTransport,
|
|
36
|
+
SUBSCRIPTIONS_ACKNOWLEDGED_METHOD: () => SUBSCRIPTIONS_ACKNOWLEDGED_METHOD,
|
|
30
37
|
StdioClientTransport: () => import_stdio.StdioClientTransport,
|
|
31
38
|
StdioServerTransport: () => import_stdio2.StdioServerTransport,
|
|
32
39
|
StreamableHTTPClientTransport: () => import_streamableHttp.StreamableHTTPClientTransport,
|
|
33
40
|
StreamableHTTPServerTransport: () => import_mcp_streamable_http.StreamableHTTPServerTransport,
|
|
34
|
-
WebStandardStreamableHTTPServerTransport: () => import_mcp_streamable_http.WebStandardStreamableHTTPServerTransport
|
|
41
|
+
WebStandardStreamableHTTPServerTransport: () => import_mcp_streamable_http.WebStandardStreamableHTTPServerTransport,
|
|
42
|
+
isProtocol20260728: () => isProtocol20260728,
|
|
43
|
+
readDeclaredProtocolVersion: () => readDeclaredProtocolVersion
|
|
35
44
|
});
|
|
36
45
|
module.exports = __toCommonJS(index_exports);
|
|
37
46
|
|
|
@@ -42,6 +51,53 @@ __reExport(types_exports, require("@modelcontextprotocol/sdk/types.js"));
|
|
|
42
51
|
// libs/protocol/src/index.ts
|
|
43
52
|
__reExport(index_exports, types_exports, module.exports);
|
|
44
53
|
|
|
54
|
+
// libs/protocol/src/types-20260728.ts
|
|
55
|
+
var PROTOCOL_2026_07_28 = "2026-07-28";
|
|
56
|
+
var MCP_20260728_META = {
|
|
57
|
+
/** Request: protocol version; MUST match the `MCP-Protocol-Version` header. */
|
|
58
|
+
protocolVersion: "io.modelcontextprotocol/protocolVersion",
|
|
59
|
+
/** Request: self-reported client identity. */
|
|
60
|
+
clientInfo: "io.modelcontextprotocol/clientInfo",
|
|
61
|
+
/** Request: capabilities for THIS request only — never inferred from prior ones. */
|
|
62
|
+
clientCapabilities: "io.modelcontextprotocol/clientCapabilities",
|
|
63
|
+
/** Request: opt-in log level; absent means "send me no `notifications/message`". */
|
|
64
|
+
logLevel: "io.modelcontextprotocol/logLevel",
|
|
65
|
+
/** Result: self-reported server identity. */
|
|
66
|
+
serverInfo: "io.modelcontextprotocol/serverInfo",
|
|
67
|
+
/** Notification/result: id of the `subscriptions/listen` stream it belongs to. */
|
|
68
|
+
subscriptionId: "io.modelcontextprotocol/subscriptionId"
|
|
69
|
+
};
|
|
70
|
+
var MCP_20260728_ERROR_CODES = {
|
|
71
|
+
/** Headers disagree with the body, or a required header is missing/malformed. */
|
|
72
|
+
headerMismatch: -32020,
|
|
73
|
+
/** The request needs a client capability that was not declared. */
|
|
74
|
+
missingRequiredClientCapability: -32021,
|
|
75
|
+
/** The requested protocol version is not supported by this server. */
|
|
76
|
+
unsupportedProtocolVersion: -32022
|
|
77
|
+
};
|
|
78
|
+
var MCP_20260728_RETIRED_ERROR_CODES = [-32002, -32042];
|
|
79
|
+
var MCP_20260728_REMOVED_METHODS = [
|
|
80
|
+
"initialize",
|
|
81
|
+
"notifications/initialized",
|
|
82
|
+
"ping",
|
|
83
|
+
"logging/setLevel",
|
|
84
|
+
"notifications/roots/list_changed",
|
|
85
|
+
"resources/subscribe",
|
|
86
|
+
"resources/unsubscribe",
|
|
87
|
+
"tasks/list",
|
|
88
|
+
"tasks/result"
|
|
89
|
+
];
|
|
90
|
+
var MCP_20260728_ADDED_METHODS = ["server/discover", "subscriptions/listen"];
|
|
91
|
+
var SUBSCRIPTIONS_ACKNOWLEDGED_METHOD = "notifications/subscriptions/acknowledged";
|
|
92
|
+
function isProtocol20260728(version) {
|
|
93
|
+
return version === PROTOCOL_2026_07_28;
|
|
94
|
+
}
|
|
95
|
+
function readDeclaredProtocolVersion(body) {
|
|
96
|
+
const params = body?.params;
|
|
97
|
+
const declared = params?._meta?.[MCP_20260728_META.protocolVersion];
|
|
98
|
+
return typeof declared === "string" ? declared : void 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
45
101
|
// libs/protocol/src/client.ts
|
|
46
102
|
var import_client = require("@modelcontextprotocol/sdk/client/index.js");
|
|
47
103
|
var import_streamableHttp = require("@modelcontextprotocol/sdk/client/streamableHttp.js");
|
|
@@ -66,11 +122,20 @@ var import_server_types = require("#server-types");
|
|
|
66
122
|
HttpServerResponse,
|
|
67
123
|
InMemoryTransport,
|
|
68
124
|
IncomingMessage,
|
|
125
|
+
MCP_20260728_ADDED_METHODS,
|
|
126
|
+
MCP_20260728_ERROR_CODES,
|
|
127
|
+
MCP_20260728_META,
|
|
128
|
+
MCP_20260728_REMOVED_METHODS,
|
|
129
|
+
MCP_20260728_RETIRED_ERROR_CODES,
|
|
69
130
|
McpServer,
|
|
131
|
+
PROTOCOL_2026_07_28,
|
|
70
132
|
SSEClientTransport,
|
|
133
|
+
SUBSCRIPTIONS_ACKNOWLEDGED_METHOD,
|
|
71
134
|
StdioClientTransport,
|
|
72
135
|
StdioServerTransport,
|
|
73
136
|
StreamableHTTPClientTransport,
|
|
74
137
|
StreamableHTTPServerTransport,
|
|
75
|
-
WebStandardStreamableHTTPServerTransport
|
|
138
|
+
WebStandardStreamableHTTPServerTransport,
|
|
139
|
+
isProtocol20260728,
|
|
140
|
+
readDeclaredProtocolVersion
|
|
76
141
|
});
|
package/package.json
CHANGED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP protocol revision **2026-07-28**.
|
|
3
|
+
*
|
|
4
|
+
* The upstream `@modelcontextprotocol/sdk` (1.30.0 at time of writing) only
|
|
5
|
+
* ships schemas up to `2025-11-25`, so this revision is defined here — inside
|
|
6
|
+
* the single boundary module that owns protocol types — rather than reached for
|
|
7
|
+
* from every call site. When upstream catches up, this file is the only place
|
|
8
|
+
* that has to change.
|
|
9
|
+
*
|
|
10
|
+
* Everything here is ADDITIVE. The 2025-and-earlier types re-exported from
|
|
11
|
+
* `./types` are untouched, because a server must keep serving both eras.
|
|
12
|
+
*
|
|
13
|
+
* @see https://modelcontextprotocol.io/specification/2026-07-28/changelog
|
|
14
|
+
*/
|
|
15
|
+
import type { Implementation, LoggingLevel, RequestId } from './types';
|
|
16
|
+
/** The protocol revision this module implements. */
|
|
17
|
+
export declare const PROTOCOL_2026_07_28: "2026-07-28";
|
|
18
|
+
export type Protocol20260728Version = typeof PROTOCOL_2026_07_28;
|
|
19
|
+
/**
|
|
20
|
+
* Reserved `_meta` keys introduced by 2026-07-28.
|
|
21
|
+
*
|
|
22
|
+
* Statelessness means the handshake's payload now rides on every request, so
|
|
23
|
+
* these keys carry what `initialize` used to negotiate once.
|
|
24
|
+
*/
|
|
25
|
+
export declare const MCP_20260728_META: {
|
|
26
|
+
/** Request: protocol version; MUST match the `MCP-Protocol-Version` header. */
|
|
27
|
+
readonly protocolVersion: "io.modelcontextprotocol/protocolVersion";
|
|
28
|
+
/** Request: self-reported client identity. */
|
|
29
|
+
readonly clientInfo: "io.modelcontextprotocol/clientInfo";
|
|
30
|
+
/** Request: capabilities for THIS request only — never inferred from prior ones. */
|
|
31
|
+
readonly clientCapabilities: "io.modelcontextprotocol/clientCapabilities";
|
|
32
|
+
/** Request: opt-in log level; absent means "send me no `notifications/message`". */
|
|
33
|
+
readonly logLevel: "io.modelcontextprotocol/logLevel";
|
|
34
|
+
/** Result: self-reported server identity. */
|
|
35
|
+
readonly serverInfo: "io.modelcontextprotocol/serverInfo";
|
|
36
|
+
/** Notification/result: id of the `subscriptions/listen` stream it belongs to. */
|
|
37
|
+
readonly subscriptionId: "io.modelcontextprotocol/subscriptionId";
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* JSON-RPC error codes allocated to the MCP specification.
|
|
41
|
+
*
|
|
42
|
+
* 2026-07-28 partitions the server-error range: `-32000`…`-32019` stays
|
|
43
|
+
* implementation-defined, `-32020`…`-32099` is reserved for the spec. The three
|
|
44
|
+
* codes below were renumbered into that block from their draft values.
|
|
45
|
+
*/
|
|
46
|
+
export declare const MCP_20260728_ERROR_CODES: {
|
|
47
|
+
/** Headers disagree with the body, or a required header is missing/malformed. */
|
|
48
|
+
readonly headerMismatch: -32020;
|
|
49
|
+
/** The request needs a client capability that was not declared. */
|
|
50
|
+
readonly missingRequiredClientCapability: -32021;
|
|
51
|
+
/** The requested protocol version is not supported by this server. */
|
|
52
|
+
readonly unsupportedProtocolVersion: -32022;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Codes retired by this revision. Kept as documentation so they are never
|
|
56
|
+
* reallocated: `-32002` was resource-not-found (now `-32602`) and `-32042` was
|
|
57
|
+
* URL-elicitation-required (2025-11-25 only).
|
|
58
|
+
*/
|
|
59
|
+
export declare const MCP_20260728_RETIRED_ERROR_CODES: readonly [-32002, -32042];
|
|
60
|
+
/** Methods this revision removed from the core protocol. */
|
|
61
|
+
export declare const MCP_20260728_REMOVED_METHODS: readonly ["initialize", "notifications/initialized", "ping", "logging/setLevel", "notifications/roots/list_changed", "resources/subscribe", "resources/unsubscribe", "tasks/list", "tasks/result"];
|
|
62
|
+
/** Methods this revision introduced. */
|
|
63
|
+
export declare const MCP_20260728_ADDED_METHODS: readonly ["server/discover", "subscriptions/listen"];
|
|
64
|
+
/**
|
|
65
|
+
* Discriminates a final result from an interim one.
|
|
66
|
+
*
|
|
67
|
+
* Left open (`| string`) exactly as the spec does, so a future result type does
|
|
68
|
+
* not become a parse error.
|
|
69
|
+
*/
|
|
70
|
+
export type ResultType = 'complete' | 'input_required' | (string & {});
|
|
71
|
+
export interface RequestMeta20260728 {
|
|
72
|
+
progressToken?: string | number;
|
|
73
|
+
[MCP_20260728_META.protocolVersion]: string;
|
|
74
|
+
[MCP_20260728_META.clientInfo]?: Implementation;
|
|
75
|
+
[MCP_20260728_META.clientCapabilities]: ClientCapabilities20260728;
|
|
76
|
+
[MCP_20260728_META.logLevel]?: LoggingLevel;
|
|
77
|
+
[key: string]: unknown;
|
|
78
|
+
}
|
|
79
|
+
export interface ResultMeta20260728 {
|
|
80
|
+
[MCP_20260728_META.serverInfo]?: Implementation;
|
|
81
|
+
[key: string]: unknown;
|
|
82
|
+
}
|
|
83
|
+
export interface NotificationMeta20260728 {
|
|
84
|
+
[MCP_20260728_META.subscriptionId]?: RequestId;
|
|
85
|
+
[key: string]: unknown;
|
|
86
|
+
}
|
|
87
|
+
export interface Result20260728 {
|
|
88
|
+
_meta?: ResultMeta20260728;
|
|
89
|
+
resultType: ResultType;
|
|
90
|
+
[key: string]: unknown;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* A result carrying client-side caching hints.
|
|
94
|
+
*
|
|
95
|
+
* REQUIRED on `tools/list`, `prompts/list`, `resources/list`,
|
|
96
|
+
* `resources/templates/list`, `resources/read`, and `server/discover`.
|
|
97
|
+
*/
|
|
98
|
+
export interface CacheableResult extends Result20260728 {
|
|
99
|
+
/** Freshness hint in milliseconds; `0` means "always revalidate". */
|
|
100
|
+
ttlMs: number;
|
|
101
|
+
/** `public` = safe to share across authorization contexts; `private` = not. */
|
|
102
|
+
cacheScope: 'public' | 'private';
|
|
103
|
+
}
|
|
104
|
+
export interface ClientCapabilities20260728 {
|
|
105
|
+
experimental?: Record<string, Record<string, unknown>>;
|
|
106
|
+
/** @deprecated Deprecated in 2026-07-28 (SEP-2577). */
|
|
107
|
+
roots?: Record<string, unknown>;
|
|
108
|
+
/** @deprecated Deprecated in 2026-07-28 (SEP-2577). */
|
|
109
|
+
sampling?: {
|
|
110
|
+
context?: Record<string, unknown>;
|
|
111
|
+
tools?: Record<string, unknown>;
|
|
112
|
+
};
|
|
113
|
+
elicitation?: {
|
|
114
|
+
form?: Record<string, unknown>;
|
|
115
|
+
url?: Record<string, unknown>;
|
|
116
|
+
};
|
|
117
|
+
/** Optional MCP extensions; keys are prefixed identifiers. */
|
|
118
|
+
extensions?: Record<string, Record<string, unknown>>;
|
|
119
|
+
}
|
|
120
|
+
export interface ServerCapabilities20260728 {
|
|
121
|
+
experimental?: Record<string, Record<string, unknown>>;
|
|
122
|
+
/** @deprecated Deprecated in 2026-07-28 (SEP-2577). */
|
|
123
|
+
logging?: Record<string, unknown>;
|
|
124
|
+
completions?: Record<string, unknown>;
|
|
125
|
+
prompts?: {
|
|
126
|
+
listChanged?: boolean;
|
|
127
|
+
};
|
|
128
|
+
resources?: {
|
|
129
|
+
subscribe?: boolean;
|
|
130
|
+
listChanged?: boolean;
|
|
131
|
+
};
|
|
132
|
+
tools?: {
|
|
133
|
+
listChanged?: boolean;
|
|
134
|
+
};
|
|
135
|
+
/** Optional MCP extensions; keys are prefixed identifiers. */
|
|
136
|
+
extensions?: Record<string, Record<string, unknown>>;
|
|
137
|
+
}
|
|
138
|
+
export interface DiscoverResult extends CacheableResult {
|
|
139
|
+
/** Versions the client may choose from for subsequent requests. */
|
|
140
|
+
supportedVersions: string[];
|
|
141
|
+
capabilities: ServerCapabilities20260728;
|
|
142
|
+
instructions?: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* The notification types a client opts in to. Every type is opt-in: the server
|
|
146
|
+
* MUST NOT push a type the client did not ask for.
|
|
147
|
+
*/
|
|
148
|
+
export interface SubscriptionFilter {
|
|
149
|
+
toolsListChanged?: boolean;
|
|
150
|
+
promptsListChanged?: boolean;
|
|
151
|
+
resourcesListChanged?: boolean;
|
|
152
|
+
/** Replaces the removed `resources/subscribe` RPC. */
|
|
153
|
+
resourceSubscriptions?: string[];
|
|
154
|
+
}
|
|
155
|
+
export interface SubscriptionsListenParams {
|
|
156
|
+
notifications: SubscriptionFilter;
|
|
157
|
+
_meta: RequestMeta20260728;
|
|
158
|
+
}
|
|
159
|
+
export interface SubscriptionsAcknowledgedParams {
|
|
160
|
+
/** The subset of requested types the server actually agreed to honor. */
|
|
161
|
+
notifications: SubscriptionFilter;
|
|
162
|
+
_meta?: NotificationMeta20260728;
|
|
163
|
+
}
|
|
164
|
+
export declare const SUBSCRIPTIONS_ACKNOWLEDGED_METHOD: "notifications/subscriptions/acknowledged";
|
|
165
|
+
/**
|
|
166
|
+
* A server-initiated request embedded in a result rather than sent on the wire.
|
|
167
|
+
*
|
|
168
|
+
* 2026-07-28 removed the server→client request direction, so sampling,
|
|
169
|
+
* elicitation, and roots all travel this way.
|
|
170
|
+
*/
|
|
171
|
+
export interface InputRequest {
|
|
172
|
+
method: 'elicitation/create' | 'sampling/createMessage' | 'roots/list' | (string & {});
|
|
173
|
+
params?: Record<string, unknown>;
|
|
174
|
+
}
|
|
175
|
+
export type InputRequests = Record<string, InputRequest>;
|
|
176
|
+
export type InputResponses = Record<string, Record<string, unknown>>;
|
|
177
|
+
/**
|
|
178
|
+
* The interim result that asks the client for more input.
|
|
179
|
+
*
|
|
180
|
+
* At least one of `inputRequests` / `requestState` MUST be present. The client
|
|
181
|
+
* retries the ORIGINAL request with `inputResponses` and the echoed
|
|
182
|
+
* `requestState`; it must treat `requestState` as opaque.
|
|
183
|
+
*/
|
|
184
|
+
export interface InputRequiredResult extends Result20260728 {
|
|
185
|
+
resultType: 'input_required';
|
|
186
|
+
inputRequests?: InputRequests;
|
|
187
|
+
requestState?: string;
|
|
188
|
+
}
|
|
189
|
+
/** Params any client request may carry when resuming an MRTR exchange. */
|
|
190
|
+
export interface InputResponseParams {
|
|
191
|
+
inputResponses?: InputResponses;
|
|
192
|
+
requestState?: string;
|
|
193
|
+
}
|
|
194
|
+
/** True when `version` is the 2026-07-28 revision. */
|
|
195
|
+
export declare function isProtocol20260728(version: unknown): version is Protocol20260728Version;
|
|
196
|
+
/** Reads the protocol version a request declares in its `_meta`, if any. */
|
|
197
|
+
export declare function readDeclaredProtocolVersion(body: unknown): string | undefined;
|