fix: update the draft wire version to 2026-07-28 (#331)
* chore: sync spec-types to modelcontextprotocol@0168c57f Refreshes the vendored schema copies via npm run sync-schema. The draft schema now declares LATEST_PROTOCOL_VERSION = "2026-07-28" (previously the DRAFT-2026-v1 placeholder) and picks up the latest draft doc-comment and type updates. The dated schemas are unchanged. * fix: update the draft wire version to 2026-07-28 The spec repo's draft schema now declares LATEST_PROTOCOL_VERSION = "2026-07-28", but the harness still asserted the old DRAFT-2026-v1 placeholder, so an SDK that sends the version the draft spec actually declares cannot pass the draft suite. - bump DRAFT_PROTOCOL_VERSION in src/types.ts to 2026-07-28 - update the hard-coded literals in tests, example servers, and README - add src/types.test.ts pinning DRAFT_PROTOCOL_VERSION to the vendored draft schema's LATEST_PROTOCOL_VERSION so the two cannot drift, and asserting the draft identifier stays distinct from the dated versions
This commit is contained in:
parent
25fd44323f
commit
6f83abf786
14 changed files with 167 additions and 43 deletions
|
|
@ -64,13 +64,13 @@ npx @modelcontextprotocol/conformance client --command "<client-command>" --scen
|
||||||
- `--command` - The command to run your MCP client (can include flags)
|
- `--command` - The command to run your MCP client (can include flags)
|
||||||
- `--scenario` - The test scenario to run (e.g., "initialize")
|
- `--scenario` - The test scenario to run (e.g., "initialize")
|
||||||
- `--suite` - Run a suite of tests in parallel: `all`, `core`, `extensions`, `backcompat`, `auth`, `metadata`, `draft` (scenarios targeting the in-progress draft spec), or `sep-835`
|
- `--suite` - Run a suite of tests in parallel: `all`, `core`, `extensions`, `backcompat`, `auth`, `metadata`, `draft` (scenarios targeting the in-progress draft spec), or `sep-835`
|
||||||
- `--spec-version <version>` - Filter scenarios by spec version (e.g., `2025-11-25`, `DRAFT-2026-v1`; `draft` is accepted as an alias for the current draft identifier). The draft version selects the latest dated release plus any draft-only scenarios. When omitted, the version is inferred from the scenario's spec applicability (draft-only scenarios run at the draft version, everything else at the latest dated release); an explicitly requested version outside a scenario's applicability window skips the scenario (exit 0) unless `--force` is passed
|
- `--spec-version <version>` - Filter scenarios by spec version (e.g., `2025-11-25`, `2026-07-28`; `draft` is accepted as an alias for the current draft identifier). The draft version selects the latest dated release plus any draft-only scenarios. When omitted, the version is inferred from the scenario's spec applicability (draft-only scenarios run at the draft version, everything else at the latest dated release); an explicitly requested version outside a scenario's applicability window skips the scenario (exit 0) unless `--force` is passed
|
||||||
- `--force` - Run a scenario even if it is not applicable at the requested `--spec-version`
|
- `--force` - Run a scenario even if it is not applicable at the requested `--spec-version`
|
||||||
- `--expected-failures <path>` - Path to YAML baseline file of known failures (see [Expected Failures](#expected-failures))
|
- `--expected-failures <path>` - Path to YAML baseline file of known failures (see [Expected Failures](#expected-failures))
|
||||||
- `--timeout` - Timeout in milliseconds (default: 30000)
|
- `--timeout` - Timeout in milliseconds (default: 30000)
|
||||||
- `--verbose` - Show verbose output
|
- `--verbose` - Show verbose output
|
||||||
|
|
||||||
The framework appends `<server-url>` as an argument to your command and sets the `MCP_CONFORMANCE_SCENARIO` environment variable to the scenario name. For scenarios that require additional context (e.g., client credentials), the `MCP_CONFORMANCE_CONTEXT` environment variable contains a JSON object with scenario-specific data. When `--spec-version` is passed, its resolved value is forwarded to the client process as `MCP_CONFORMANCE_PROTOCOL_VERSION`; example clients can use this value directly as their `protocolVersion`. SDKs that hard-code their protocol version can ignore it. Clients under test must derive the lifecycle from the protocol version they are asked to run: dated versions through `2025-11-25` use the stateful lifecycle (initialize handshake), while the 2026 draft (`DRAFT-2026-v1`) uses the stateless lifecycle (per-request `_meta`).
|
The framework appends `<server-url>` as an argument to your command and sets the `MCP_CONFORMANCE_SCENARIO` environment variable to the scenario name. For scenarios that require additional context (e.g., client credentials), the `MCP_CONFORMANCE_CONTEXT` environment variable contains a JSON object with scenario-specific data. When `--spec-version` is passed, its resolved value is forwarded to the client process as `MCP_CONFORMANCE_PROTOCOL_VERSION`; example clients can use this value directly as their `protocolVersion`. SDKs that hard-code their protocol version can ignore it. Clients under test must derive the lifecycle from the protocol version they are asked to run: dated versions through `2025-11-25` use the stateful lifecycle (initialize handshake), while the 2026 draft (`2026-07-28`) uses the stateless lifecycle (per-request `_meta`).
|
||||||
|
|
||||||
### Server Testing
|
### Server Testing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1276,7 +1276,7 @@ app.post('/mcp', async (req, res) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Protocol Version Negotiation Matrix (-32004, HTTP 400)
|
// Protocol Version Negotiation Matrix (-32004, HTTP 400)
|
||||||
if (metaVersion !== 'DRAFT-2026-v1') {
|
if (metaVersion !== '2026-07-28') {
|
||||||
return res.status(400).json({
|
return res.status(400).json({
|
||||||
jsonrpc: '2.0',
|
jsonrpc: '2.0',
|
||||||
id,
|
id,
|
||||||
|
|
@ -1284,7 +1284,7 @@ app.post('/mcp', async (req, res) => {
|
||||||
code: -32004,
|
code: -32004,
|
||||||
message: 'UnsupportedProtocolVersionError',
|
message: 'UnsupportedProtocolVersionError',
|
||||||
data: {
|
data: {
|
||||||
supported: ['DRAFT-2026-v1'],
|
supported: ['2026-07-28'],
|
||||||
requested: String(metaVersion)
|
requested: String(metaVersion)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1344,7 +1344,7 @@ app.post('/mcp', async (req, res) => {
|
||||||
jsonrpc: '2.0',
|
jsonrpc: '2.0',
|
||||||
id,
|
id,
|
||||||
result: {
|
result: {
|
||||||
supportedVersions: ['DRAFT-2026-v1'],
|
supportedVersions: ['2026-07-28'],
|
||||||
capabilities: {
|
capabilities: {
|
||||||
tools: { listChanged: true }, // Explicitly announce dynamic capabilities matching Section 7 expectations
|
tools: { listChanged: true }, // Explicitly announce dynamic capabilities matching Section 7 expectations
|
||||||
prompts: { listChanged: true },
|
prompts: { listChanged: true },
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ app.post('/mcp', (req, res) => {
|
||||||
jsonrpc: '2.0',
|
jsonrpc: '2.0',
|
||||||
id,
|
id,
|
||||||
result: {
|
result: {
|
||||||
supportedVersions: ['DRAFT-2026-v1'],
|
supportedVersions: ['2026-07-28'],
|
||||||
capabilities: { resources: {} },
|
capabilities: { resources: {} },
|
||||||
serverInfo: { name: 'sep-2164-empty-contents', version: '1.0.0' }
|
serverInfo: { name: 'sep-2164-empty-contents', version: '1.0.0' }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ type Handler = (params: Record<string, unknown>) => unknown;
|
||||||
const handlers: Record<string, Handler> = {};
|
const handlers: Record<string, Handler> = {};
|
||||||
|
|
||||||
handlers['server/discover'] = () => ({
|
handlers['server/discover'] = () => ({
|
||||||
supportedVersions: ['DRAFT-2026-v1'],
|
supportedVersions: ['2026-07-28'],
|
||||||
capabilities: {
|
capabilities: {
|
||||||
tools: {},
|
tools: {},
|
||||||
prompts: {},
|
prompts: {},
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ app.post('/mcp', (req, res) => {
|
||||||
jsonrpc: '2.0',
|
jsonrpc: '2.0',
|
||||||
id,
|
id,
|
||||||
result: {
|
result: {
|
||||||
supportedVersions: ['DRAFT-2026-v1'],
|
supportedVersions: ['2026-07-28'],
|
||||||
capabilities: { tools: {}, resources: {}, prompts: {} },
|
capabilities: { tools: {}, resources: {}, prompts: {} },
|
||||||
serverInfo: { name: 'sep-2549-no-caching-hints', version: '1.0.0' }
|
serverInfo: { name: 'sep-2549-no-caching-hints', version: '1.0.0' }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ describe('connectFor', () => {
|
||||||
// version through), so identity with connectStateless no longer holds;
|
// version through), so identity with connectStateless no longer holds;
|
||||||
// assert it did not select the stateful implementation. The wire-level
|
// assert it did not select the stateful implementation. The wire-level
|
||||||
// behaviour of the wrapper is covered in stateless.test.ts.
|
// behaviour of the wrapper is covered in stateless.test.ts.
|
||||||
expect(connectFor('DRAFT-2026-v1')).not.toBe(connectStateful);
|
expect(connectFor('2026-07-28')).not.toBe(connectStateful);
|
||||||
expect(connectFor('DRAFT-2026-v1')).not.toBe(connectStateless);
|
expect(connectFor('2026-07-28')).not.toBe(connectStateless);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -64,10 +64,10 @@ describe('connectStateless', () => {
|
||||||
await conn.request('tools/list');
|
await conn.request('tools/list');
|
||||||
|
|
||||||
const [, init] = mockFetch.mock.calls[0];
|
const [, init] = mockFetch.mock.calls[0];
|
||||||
expect(init.headers['MCP-Protocol-Version']).toBe('DRAFT-2026-v1');
|
expect(init.headers['MCP-Protocol-Version']).toBe('2026-07-28');
|
||||||
const sent = JSON.parse(init.body);
|
const sent = JSON.parse(init.body);
|
||||||
expect(sent.params._meta['io.modelcontextprotocol/protocolVersion']).toBe(
|
expect(sent.params._meta['io.modelcontextprotocol/protocolVersion']).toBe(
|
||||||
'DRAFT-2026-v1'
|
'2026-07-28'
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
sent.params._meta['io.modelcontextprotocol/clientInfo']
|
sent.params._meta['io.modelcontextprotocol/clientInfo']
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ describe('HttpStandardHeadersScenario (SEP-2243) — negative', () => {
|
||||||
id: 1,
|
id: 1,
|
||||||
method: 'initialize',
|
method: 'initialize',
|
||||||
params: {
|
params: {
|
||||||
protocolVersion: 'DRAFT-2026-v1',
|
protocolVersion: '2026-07-28',
|
||||||
clientInfo: { name: 'neg-test', version: '0' },
|
clientInfo: { name: 'neg-test', version: '0' },
|
||||||
capabilities: {}
|
capabilities: {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ async function badClient(serverUrl: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const goodMeta = {
|
const goodMeta = {
|
||||||
'io.modelcontextprotocol/protocolVersion': 'DRAFT-2026-v1',
|
'io.modelcontextprotocol/protocolVersion': '2026-07-28',
|
||||||
'io.modelcontextprotocol/clientInfo': { name: 'test', version: '1.0' },
|
'io.modelcontextprotocol/clientInfo': { name: 'test', version: '1.0' },
|
||||||
'io.modelcontextprotocol/clientCapabilities': {}
|
'io.modelcontextprotocol/clientCapabilities': {}
|
||||||
};
|
};
|
||||||
|
|
@ -70,7 +70,7 @@ async function nonRetryingClient(serverUrl: string) {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'MCP-Protocol-Version': 'DRAFT-2026-v1'
|
'MCP-Protocol-Version': '2026-07-28'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
jsonrpc: '2.0',
|
jsonrpc: '2.0',
|
||||||
|
|
@ -118,7 +118,7 @@ async function malformedCapabilitiesClient(serverUrl: string) {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'MCP-Protocol-Version': 'DRAFT-2026-v1'
|
'MCP-Protocol-Version': '2026-07-28'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
jsonrpc: '2.0',
|
jsonrpc: '2.0',
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ Servers MUST include \`ttlMs\` (integer >= 0) and \`cacheScope\` ("public" or "p
|
||||||
// SEP-2549 only exists in the draft spec, so each cacheable endpoint is
|
// SEP-2549 only exists in the draft spec, so each cacheable endpoint is
|
||||||
// queried over the version-appropriate connection. Under --spec-version
|
// queried over the version-appropriate connection. Under --spec-version
|
||||||
// draft that resolves to the stateless impl (SEP-2575): protocolVersion
|
// draft that resolves to the stateless impl (SEP-2575): protocolVersion
|
||||||
// DRAFT-2026-v1 plus the cross-cutting _meta and standard headers
|
// 2026-07-28 plus the cross-cutting _meta and standard headers
|
||||||
// (issue #315).
|
// (issue #315).
|
||||||
let conn: Connection;
|
let conn: Connection;
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ describe('Stateless Server Scenario Negative Tests', () => {
|
||||||
jsonrpc: '2.0',
|
jsonrpc: '2.0',
|
||||||
id: reqBody.id,
|
id: reqBody.id,
|
||||||
result: {
|
result: {
|
||||||
supportedVersions: ['DRAFT-2026-v1'],
|
supportedVersions: ['2026-07-28'],
|
||||||
capabilities: {},
|
capabilities: {},
|
||||||
serverInfo: { name: 'bad-meta-server', version: '1.0.0' }
|
serverInfo: { name: 'bad-meta-server', version: '1.0.0' }
|
||||||
}
|
}
|
||||||
|
|
@ -341,7 +341,7 @@ describe('Stateless Server Scenario Negative Tests', () => {
|
||||||
jsonrpc: '2.0',
|
jsonrpc: '2.0',
|
||||||
id: reqBody.id,
|
id: reqBody.id,
|
||||||
result: {
|
result: {
|
||||||
supportedVersions: ['DRAFT-2026-v1'],
|
supportedVersions: ['2026-07-28'],
|
||||||
capabilities: {
|
capabilities: {
|
||||||
tools: { listChanged: true },
|
tools: { listChanged: true },
|
||||||
prompts: { listChanged: true }
|
prompts: { listChanged: true }
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
modelcontextprotocol@33c3724972e6a87a8ad153e3f8a0d4714b0b9536
|
modelcontextprotocol@0168c57fc74aba6e6dcf8f0b7191db3caaa5ad65
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ export type JSONRPCMessage =
|
||||||
| JSONRPCResponse;
|
| JSONRPCResponse;
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const LATEST_PROTOCOL_VERSION = "DRAFT-2026-v1";
|
export const LATEST_PROTOCOL_VERSION = "2026-07-28";
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export const JSONRPC_VERSION = "2.0";
|
export const JSONRPC_VERSION = "2.0";
|
||||||
|
|
||||||
|
|
@ -102,6 +102,10 @@ export interface RequestMetaObject extends MetaObject {
|
||||||
* If absent, the server MUST NOT send any {@link LoggingMessageNotification | notifications/message}
|
* If absent, the server MUST NOT send any {@link LoggingMessageNotification | notifications/message}
|
||||||
* notifications for this request. The client opts in to log messages by
|
* notifications for this request. The client opts in to log messages by
|
||||||
* explicitly setting a level. Replaces the former `logging/setLevel` RPC.
|
* explicitly setting a level. Replaces the former `logging/setLevel` RPC.
|
||||||
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
*/
|
*/
|
||||||
"io.modelcontextprotocol/logLevel"?: LoggingLevel;
|
"io.modelcontextprotocol/logLevel"?: LoggingLevel;
|
||||||
}
|
}
|
||||||
|
|
@ -162,7 +166,7 @@ export interface Notification {
|
||||||
* input_required - the request requires additional input and the result contains an {@link InputRequiredResult} object with instructions for the client to provide additional input before retrying the original request.
|
* input_required - the request requires additional input and the result contains an {@link InputRequiredResult} object with instructions for the client to provide additional input before retrying the original request.
|
||||||
* @category Common Types
|
* @category Common Types
|
||||||
*/
|
*/
|
||||||
export type ResultType = "complete" | "input_required";
|
export type ResultType = "complete" | "input_required" | string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common result fields.
|
* Common result fields.
|
||||||
|
|
@ -292,15 +296,14 @@ export interface InvalidRequestError extends Error {
|
||||||
/**
|
/**
|
||||||
* A JSON-RPC error indicating that the requested method does not exist or is not available.
|
* A JSON-RPC error indicating that the requested method does not exist or is not available.
|
||||||
*
|
*
|
||||||
* In MCP, this error is returned when a request is made for a method that requires a capability that has not been declared. This can occur in either direction:
|
* In MCP, a server returns this error when a client invokes a method the server does not implement — either a genuinely unknown method, or one gated behind a server capability the server did not advertise (e.g., calling `prompts/list` when the `prompts` capability was not advertised).
|
||||||
*
|
*
|
||||||
* - A server returning this error when the client requests a capability it doesn't support (e.g., requesting completions when the `completions` capability was not advertised)
|
* A request that requires a client capability the client did not declare is signalled instead by {@link MissingRequiredClientCapabilityError} (`-32003`).
|
||||||
* - A client returning this error when the server requests a capability it doesn't support (e.g., requesting roots when the client did not declare the `roots` capability)
|
|
||||||
*
|
*
|
||||||
* @see {@link https://www.jsonrpc.org/specification#error_object | JSON-RPC 2.0 Error Object}
|
* @see {@link https://www.jsonrpc.org/specification#error_object | JSON-RPC 2.0 Error Object}
|
||||||
*
|
*
|
||||||
* @example Roots not supported
|
* @example Prompts not supported
|
||||||
* {@includeCode ./examples/MethodNotFoundError/roots-not-supported.json}
|
* {@includeCode ./examples/MethodNotFoundError/prompts-not-supported.json}
|
||||||
*
|
*
|
||||||
* @category Errors
|
* @category Errors
|
||||||
*/
|
*/
|
||||||
|
|
@ -578,7 +581,7 @@ export interface DiscoverRequest extends JSONRPCRequest {
|
||||||
*
|
*
|
||||||
* @category `server/discover`
|
* @category `server/discover`
|
||||||
*/
|
*/
|
||||||
export interface DiscoverResult extends Result {
|
export interface DiscoverResult extends CacheableResult {
|
||||||
/**
|
/**
|
||||||
* MCP Protocol Versions this server supports. The client should choose a
|
* MCP Protocol Versions this server supports. The client should choose a
|
||||||
* version from this list for use in subsequent requests.
|
* version from this list for use in subsequent requests.
|
||||||
|
|
@ -628,6 +631,10 @@ export interface ClientCapabilities {
|
||||||
/**
|
/**
|
||||||
* Present if the client supports listing roots.
|
* Present if the client supports listing roots.
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @example Roots — minimum baseline support
|
* @example Roots — minimum baseline support
|
||||||
* {@includeCode ./examples/ClientCapabilities/roots-minimum-baseline-support.json}
|
* {@includeCode ./examples/ClientCapabilities/roots-minimum-baseline-support.json}
|
||||||
*/
|
*/
|
||||||
|
|
@ -636,14 +643,18 @@ export interface ClientCapabilities {
|
||||||
/**
|
/**
|
||||||
* Present if the client supports sampling from an LLM.
|
* Present if the client supports sampling from an LLM.
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @example Sampling — minimum baseline support
|
* @example Sampling — minimum baseline support
|
||||||
* {@includeCode ./examples/ClientCapabilities/sampling-minimum-baseline-support.json}
|
* {@includeCode ./examples/ClientCapabilities/sampling-minimum-baseline-support.json}
|
||||||
*
|
*
|
||||||
* @example Sampling — tool use support
|
* @example Sampling — tool use support
|
||||||
* {@includeCode ./examples/ClientCapabilities/sampling-tool-use-support.json}
|
* {@includeCode ./examples/ClientCapabilities/sampling-tool-use-support.json}
|
||||||
*
|
*
|
||||||
* @example Sampling — context inclusion support (soft-deprecated)
|
* @example Sampling — context inclusion support (deprecated)
|
||||||
* {@includeCode ./examples/ClientCapabilities/sampling-context-inclusion-support-soft-deprecated.json}
|
* {@includeCode ./examples/ClientCapabilities/sampling-context-inclusion-support-deprecated.json}
|
||||||
*/
|
*/
|
||||||
sampling?: {
|
sampling?: {
|
||||||
/**
|
/**
|
||||||
|
|
@ -675,7 +686,10 @@ export interface ClientCapabilities {
|
||||||
* (e.g., "io.modelcontextprotocol/oauth-client-credentials"), and values are
|
* (e.g., "io.modelcontextprotocol/oauth-client-credentials"), and values are
|
||||||
* per-extension settings objects. An empty object indicates support with no settings.
|
* per-extension settings objects. An empty object indicates support with no settings.
|
||||||
*
|
*
|
||||||
* @example Extensions — UI extension with MIME type support
|
* Keys MUST follow the {@link MetaObject | `_meta` key naming rules}, with a
|
||||||
|
* mandatory prefix.
|
||||||
|
*
|
||||||
|
* @example Extensions — MCP Apps (UI) extension with MIME type support
|
||||||
* {@includeCode ./examples/ClientCapabilities/extensions-ui-mime-types.json}
|
* {@includeCode ./examples/ClientCapabilities/extensions-ui-mime-types.json}
|
||||||
*/
|
*/
|
||||||
extensions?: { [key: string]: JSONObject };
|
extensions?: { [key: string]: JSONObject };
|
||||||
|
|
@ -694,6 +708,10 @@ export interface ServerCapabilities {
|
||||||
/**
|
/**
|
||||||
* Present if the server supports sending log messages to the client.
|
* Present if the server supports sending log messages to the client.
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @example Logging — minimum baseline support
|
* @example Logging — minimum baseline support
|
||||||
* {@includeCode ./examples/ServerCapabilities/logging-minimum-baseline-support.json}
|
* {@includeCode ./examples/ServerCapabilities/logging-minimum-baseline-support.json}
|
||||||
*/
|
*/
|
||||||
|
|
@ -762,11 +780,14 @@ export interface ServerCapabilities {
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* Optional MCP extensions that the server supports. Keys are extension identifiers
|
* Optional MCP extensions that the server supports. Keys are extension identifiers
|
||||||
* (e.g., "io.modelcontextprotocol/apps"), and values are per-extension settings
|
* (e.g., "io.modelcontextprotocol/tasks"), and values are per-extension settings
|
||||||
* objects. An empty object indicates support with no settings.
|
* objects. An empty object indicates support with no settings.
|
||||||
*
|
*
|
||||||
* @example Extensions — UI extension support
|
* Keys MUST follow the {@link MetaObject | `_meta` key naming rules}, with a
|
||||||
* {@includeCode ./examples/ServerCapabilities/extensions-ui.json}
|
* mandatory prefix.
|
||||||
|
*
|
||||||
|
* @example Extensions — Tasks extension support
|
||||||
|
* {@includeCode ./examples/ServerCapabilities/extensions-tasks.json}
|
||||||
*/
|
*/
|
||||||
extensions?: { [key: string]: JSONObject };
|
extensions?: { [key: string]: JSONObject };
|
||||||
}
|
}
|
||||||
|
|
@ -1848,6 +1869,10 @@ export interface Tool extends BaseMetadata, Icons {
|
||||||
/**
|
/**
|
||||||
* Parameters for a `notifications/message` notification.
|
* Parameters for a `notifications/message` notification.
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @example Log database connection failed
|
* @example Log database connection failed
|
||||||
* {@includeCode ./examples/LoggingMessageNotificationParams/log-database-connection-failed.json}
|
* {@includeCode ./examples/LoggingMessageNotificationParams/log-database-connection-failed.json}
|
||||||
*
|
*
|
||||||
|
|
@ -1871,6 +1896,10 @@ export interface LoggingMessageNotificationParams extends NotificationParams {
|
||||||
/**
|
/**
|
||||||
* JSONRPCNotification of a log message passed from server to client. The client opts in by setting `"io.modelcontextprotocol/logLevel"` in a request's `_meta`.
|
* JSONRPCNotification of a log message passed from server to client. The client opts in by setting `"io.modelcontextprotocol/logLevel"` in a request's `_meta`.
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @example Log database connection failed
|
* @example Log database connection failed
|
||||||
* {@includeCode ./examples/LoggingMessageNotification/log-database-connection-failed.json}
|
* {@includeCode ./examples/LoggingMessageNotification/log-database-connection-failed.json}
|
||||||
*
|
*
|
||||||
|
|
@ -1887,6 +1916,10 @@ export interface LoggingMessageNotification extends JSONRPCNotification {
|
||||||
* These map to syslog message severities, as specified in RFC-5424:
|
* These map to syslog message severities, as specified in RFC-5424:
|
||||||
* https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1
|
* https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @category Common Types
|
* @category Common Types
|
||||||
*/
|
*/
|
||||||
export type LoggingLevel =
|
export type LoggingLevel =
|
||||||
|
|
@ -1912,6 +1945,10 @@ export type LoggingLevel =
|
||||||
* @example Follow-up request with tool results
|
* @example Follow-up request with tool results
|
||||||
* {@includeCode ./examples/CreateMessageRequestParams/follow-up-with-tool-results.json}
|
* {@includeCode ./examples/CreateMessageRequestParams/follow-up-with-tool-results.json}
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @category `sampling/createMessage`
|
* @category `sampling/createMessage`
|
||||||
*/
|
*/
|
||||||
export interface CreateMessageRequestParams {
|
export interface CreateMessageRequestParams {
|
||||||
|
|
@ -1928,8 +1965,12 @@ export interface CreateMessageRequestParams {
|
||||||
* A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
|
* A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
|
||||||
* The client MAY ignore this request.
|
* The client MAY ignore this request.
|
||||||
*
|
*
|
||||||
* Default is `"none"`. Values `"thisServer"` and `"allServers"` are soft-deprecated. Servers SHOULD only use these values if the client
|
* Default is `"none"`. The values `"thisServer"` and `"allServers"` are deprecated (SEP-2596): servers SHOULD
|
||||||
* declares {@link ClientCapabilities.sampling.context}. These values may be removed in future spec releases.
|
* omit this field or use `"none"`, and SHOULD only use the deprecated values if the client declares
|
||||||
|
* {@link ClientCapabilities.sampling.context}.
|
||||||
|
*
|
||||||
|
* @deprecated The `"thisServer"` and `"allServers"` values are deprecated as of protocol version 2025-11-25
|
||||||
|
* (SEP-2596) and will be removed no later than the Sampling feature itself (SEP-2577). Omit this field or use `"none"`.
|
||||||
*/
|
*/
|
||||||
includeContext?: "none" | "thisServer" | "allServers";
|
includeContext?: "none" | "thisServer" | "allServers";
|
||||||
/**
|
/**
|
||||||
|
|
@ -1963,6 +2004,10 @@ export interface CreateMessageRequestParams {
|
||||||
/**
|
/**
|
||||||
* Controls tool selection behavior for sampling requests.
|
* Controls tool selection behavior for sampling requests.
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @category `sampling/createMessage`
|
* @category `sampling/createMessage`
|
||||||
*/
|
*/
|
||||||
export interface ToolChoice {
|
export interface ToolChoice {
|
||||||
|
|
@ -1981,6 +2026,10 @@ export interface ToolChoice {
|
||||||
* @example Sampling request
|
* @example Sampling request
|
||||||
* {@includeCode ./examples/CreateMessageRequest/sampling-request.json}
|
* {@includeCode ./examples/CreateMessageRequest/sampling-request.json}
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @category `sampling/createMessage`
|
* @category `sampling/createMessage`
|
||||||
*/
|
*/
|
||||||
export interface CreateMessageRequest {
|
export interface CreateMessageRequest {
|
||||||
|
|
@ -2002,6 +2051,10 @@ export interface CreateMessageRequest {
|
||||||
* @example Final response after tool use
|
* @example Final response after tool use
|
||||||
* {@includeCode ./examples/CreateMessageResult/final-response.json}
|
* {@includeCode ./examples/CreateMessageResult/final-response.json}
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @category `sampling/createMessage`
|
* @category `sampling/createMessage`
|
||||||
*/
|
*/
|
||||||
export interface CreateMessageResult extends SamplingMessage {
|
export interface CreateMessageResult extends SamplingMessage {
|
||||||
|
|
@ -2033,6 +2086,10 @@ export interface CreateMessageResult extends SamplingMessage {
|
||||||
* @example Multiple content blocks
|
* @example Multiple content blocks
|
||||||
* {@includeCode ./examples/SamplingMessage/multiple-content-blocks.json}
|
* {@includeCode ./examples/SamplingMessage/multiple-content-blocks.json}
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @category `sampling/createMessage`
|
* @category `sampling/createMessage`
|
||||||
*/
|
*/
|
||||||
export interface SamplingMessage {
|
export interface SamplingMessage {
|
||||||
|
|
@ -2042,6 +2099,10 @@ export interface SamplingMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @category `sampling/createMessage`
|
* @category `sampling/createMessage`
|
||||||
*/
|
*/
|
||||||
export type SamplingMessageContentBlock =
|
export type SamplingMessageContentBlock =
|
||||||
|
|
@ -2190,6 +2251,10 @@ export interface AudioContent {
|
||||||
* @example `get_weather` tool use
|
* @example `get_weather` tool use
|
||||||
* {@includeCode ./examples/ToolUseContent/get-weather-tool-use.json}
|
* {@includeCode ./examples/ToolUseContent/get-weather-tool-use.json}
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @category `sampling/createMessage`
|
* @category `sampling/createMessage`
|
||||||
*/
|
*/
|
||||||
export interface ToolUseContent {
|
export interface ToolUseContent {
|
||||||
|
|
@ -2225,6 +2290,10 @@ export interface ToolUseContent {
|
||||||
* @example `get_weather` tool result
|
* @example `get_weather` tool result
|
||||||
* {@includeCode ./examples/ToolResultContent/get-weather-tool-result.json}
|
* {@includeCode ./examples/ToolResultContent/get-weather-tool-result.json}
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @category `sampling/createMessage`
|
* @category `sampling/createMessage`
|
||||||
*/
|
*/
|
||||||
export interface ToolResultContent {
|
export interface ToolResultContent {
|
||||||
|
|
@ -2284,6 +2353,10 @@ export interface ToolResultContent {
|
||||||
* @example With hints and priorities
|
* @example With hints and priorities
|
||||||
* {@includeCode ./examples/ModelPreferences/with-hints-and-priorities.json}
|
* {@includeCode ./examples/ModelPreferences/with-hints-and-priorities.json}
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @category `sampling/createMessage`
|
* @category `sampling/createMessage`
|
||||||
*/
|
*/
|
||||||
export interface ModelPreferences {
|
export interface ModelPreferences {
|
||||||
|
|
@ -2338,6 +2411,10 @@ export interface ModelPreferences {
|
||||||
* Keys not declared here are currently left unspecified by the spec and are up
|
* Keys not declared here are currently left unspecified by the spec and are up
|
||||||
* to the client to interpret.
|
* to the client to interpret.
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @category `sampling/createMessage`
|
* @category `sampling/createMessage`
|
||||||
*/
|
*/
|
||||||
export interface ModelHint {
|
export interface ModelHint {
|
||||||
|
|
@ -2486,6 +2563,10 @@ export interface PromptReference extends BaseMetadata {
|
||||||
* @example List roots request
|
* @example List roots request
|
||||||
* {@includeCode ./examples/ListRootsRequest/list-roots-request.json}
|
* {@includeCode ./examples/ListRootsRequest/list-roots-request.json}
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @category `roots/list`
|
* @category `roots/list`
|
||||||
*/
|
*/
|
||||||
export interface ListRootsRequest {
|
export interface ListRootsRequest {
|
||||||
|
|
@ -2504,6 +2585,10 @@ export interface ListRootsRequest {
|
||||||
* @example Multiple root directories
|
* @example Multiple root directories
|
||||||
* {@includeCode ./examples/ListRootsResult/multiple-root-directories.json}
|
* {@includeCode ./examples/ListRootsResult/multiple-root-directories.json}
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @category `roots/list`
|
* @category `roots/list`
|
||||||
*/
|
*/
|
||||||
export interface ListRootsResult {
|
export interface ListRootsResult {
|
||||||
|
|
@ -2516,6 +2601,10 @@ export interface ListRootsResult {
|
||||||
* @example Project directory root
|
* @example Project directory root
|
||||||
* {@includeCode ./examples/Root/project-directory.json}
|
* {@includeCode ./examples/Root/project-directory.json}
|
||||||
*
|
*
|
||||||
|
* @deprecated Deprecated as of protocol version 2026-07-28 (SEP-2577).
|
||||||
|
* Remains in the specification for at least twelve months; see the
|
||||||
|
* deprecated features registry.
|
||||||
|
*
|
||||||
* @category `roots/list`
|
* @category `roots/list`
|
||||||
*/
|
*/
|
||||||
export interface Root {
|
export interface Root {
|
||||||
|
|
@ -2666,8 +2755,17 @@ export interface NumberSchema {
|
||||||
type: "number" | "integer";
|
type: "number" | "integer";
|
||||||
title?: string;
|
title?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
|
/**
|
||||||
|
* @TJS-type number
|
||||||
|
*/
|
||||||
minimum?: number;
|
minimum?: number;
|
||||||
|
/**
|
||||||
|
* @TJS-type number
|
||||||
|
*/
|
||||||
maximum?: number;
|
maximum?: number;
|
||||||
|
/**
|
||||||
|
* @TJS-type number
|
||||||
|
*/
|
||||||
default?: number;
|
default?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2916,6 +3014,18 @@ export interface ElicitResult {
|
||||||
content?: { [key: string]: string | number | boolean | string[] };
|
content?: { [key: string]: string | number | boolean | string[] };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parameters for a {@link ElicitationCompleteNotification | notifications/elicitation/complete} notification.
|
||||||
|
*
|
||||||
|
* @category `notifications/elicitation/complete`
|
||||||
|
*/
|
||||||
|
export interface ElicitationCompleteNotificationParams extends NotificationParams {
|
||||||
|
/**
|
||||||
|
* The ID of the elicitation that completed.
|
||||||
|
*/
|
||||||
|
elicitationId: string;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An optional notification from the server to the client, informing it of a completion of a out-of-band elicitation request.
|
* An optional notification from the server to the client, informing it of a completion of a out-of-band elicitation request.
|
||||||
*
|
*
|
||||||
|
|
@ -2926,12 +3036,7 @@ export interface ElicitResult {
|
||||||
*/
|
*/
|
||||||
export interface ElicitationCompleteNotification extends JSONRPCNotification {
|
export interface ElicitationCompleteNotification extends JSONRPCNotification {
|
||||||
method: "notifications/elicitation/complete";
|
method: "notifications/elicitation/complete";
|
||||||
params: {
|
params: ElicitationCompleteNotificationParams;
|
||||||
/**
|
|
||||||
* The ID of the elicitation that completed.
|
|
||||||
*/
|
|
||||||
elicitationId: string;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Client messages */
|
/* Client messages */
|
||||||
|
|
|
||||||
19
src/types.test.ts
Normal file
19
src/types.test.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { describe, it, expect } from 'vitest';
|
||||||
|
import { LATEST_PROTOCOL_VERSION } from './spec-types/draft';
|
||||||
|
import { DATED_SPEC_VERSIONS, DRAFT_PROTOCOL_VERSION } from './types';
|
||||||
|
|
||||||
|
describe('DRAFT_PROTOCOL_VERSION', () => {
|
||||||
|
it('mirrors LATEST_PROTOCOL_VERSION from the vendored draft schema', () => {
|
||||||
|
// DRAFT_PROTOCOL_VERSION is the wire protocolVersion the harness asserts
|
||||||
|
// for draft-spec scenarios. It must match what the spec's draft schema
|
||||||
|
// declares, or SDKs implementing the draft cannot pass the draft suite.
|
||||||
|
expect(DRAFT_PROTOCOL_VERSION).toBe(LATEST_PROTOCOL_VERSION);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('is distinct from every dated spec version', () => {
|
||||||
|
// Scenario applicability (introducedIn/removedIn) and --spec-version
|
||||||
|
// resolution rely on the draft identifier not colliding with a released
|
||||||
|
// version.
|
||||||
|
expect(DATED_SPEC_VERSIONS).not.toContain(DRAFT_PROTOCOL_VERSION);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -41,7 +41,7 @@ export const LATEST_SPEC_VERSION: DatedSpecVersion = '2025-11-25';
|
||||||
* `LATEST_PROTOCOL_VERSION` in the spec repo's `schema/draft/schema.ts`;
|
* `LATEST_PROTOCOL_VERSION` in the spec repo's `schema/draft/schema.ts`;
|
||||||
* bump when that constant changes.
|
* bump when that constant changes.
|
||||||
*/
|
*/
|
||||||
export const DRAFT_PROTOCOL_VERSION = 'DRAFT-2026-v1';
|
export const DRAFT_PROTOCOL_VERSION = '2026-07-28';
|
||||||
|
|
||||||
// Wire protocolVersion strings the mock server will negotiate on initialize.
|
// Wire protocolVersion strings the mock server will negotiate on initialize.
|
||||||
export const NEGOTIABLE_PROTOCOL_VERSIONS: readonly string[] = [
|
export const NEGOTIABLE_PROTOCOL_VERSIONS: readonly string[] = [
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue