Skip to content

Commit 8064c37

Browse files
address deletion-audit findings: scrub planning vocabulary, fix phantom spec-type entries, restore collateral cancellation test
1 parent 65dcf1e commit 8064c37

7 files changed

Lines changed: 63 additions & 13 deletions

File tree

docs/migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ The 2025-11 experimental tasks side-channel woven through `Protocol` has been re
894894

895895
**Also removed:** the storage layer (`TaskStore`, `InMemoryTaskStore`, `CreateTaskOptions`, `isTerminal`) and `TaskCreationParams`. They will return as part of the SEP-2663 server-directed plugin in a follow-up.
896896

897-
There is no migration path for the removed surface; it was always `@experimental`. Under SEP-2663, tasks reattach via a `DispatchMiddleware` (`mcp.use(tasksPlugin({ store }))`) and handlers read task context from `ctx.ext.task` instead of `ctx.task`.
897+
There is no migration path for the removed surface; it was always `@experimental`. Task support is planned to return as an opt-in extension plugin per SEP-2663.
898898

899899
## Enhancements
900900

examples/client/src/simpleOAuthClient.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class InteractiveOAuthClient {
209209
console.log('Commands:');
210210
console.log(' list - List available tools');
211211
console.log(' call <tool_name> [args] - Call a tool');
212-
console.log(' stream <tool_name> [args] - (disabled pending SEP-2663 tasksPlugin)');
212+
console.log(' stream <tool_name> [args] - (disabled; returns when the SEP-2663 tasks extension lands)');
213213
console.log(' quit - Exit the client');
214214
console.log();
215215

@@ -358,12 +358,11 @@ class InteractiveOAuthClient {
358358
return;
359359
}
360360

361-
// TODO(F3): re-enable streaming-tool demo via tasksPlugin (SEP-2663).
362-
// The 2025-11 callToolStream API is removed by R0; this command is disabled
363-
// until the F3 rewrite.
361+
// The streaming-tool demo (callToolStream) was removed with the 2025-11
362+
// experimental tasks (SEP-2663); it returns when the tasks extension lands.
364363
void toolName;
365364
void toolArgs;
366-
console.log('Streaming tool demo disabled pending tasksPlugin (SEP-2663). See TODO(F3).');
365+
console.log('Streaming tool demo removed with the 2025-11 experimental tasks (SEP-2663); returns when the tasks extension lands.');
367366
}
368367

369368
close(): void {

examples/server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pnpm tsx src/simpleStreamableHttp.ts
2727

2828
| Scenario | Description | File |
2929
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
30-
| Streamable HTTP server (stateful) | Feature-rich server with tools/resources/prompts, logging, tasks, sampling, and optional OAuth. | [`src/simpleStreamableHttp.ts`](src/simpleStreamableHttp.ts) |
30+
| Streamable HTTP server (stateful) | Feature-rich server with tools/resources/prompts, logging, sampling, and optional OAuth. | [`src/simpleStreamableHttp.ts`](src/simpleStreamableHttp.ts) |
3131
| Streamable HTTP server (stateless) | No session tracking; good for simple API-style servers. | [`src/simpleStatelessStreamableHttp.ts`](src/simpleStatelessStreamableHttp.ts) |
3232
| Resource-Server-only auth | Minimal OAuth RS using `mcpAuthMetadataRouter` + `requireBearerAuth` from `@modelcontextprotocol/express` (no better-auth). | [`src/resourceServerOnly.ts`](src/resourceServerOnly.ts) |
3333
| JSON response mode (no SSE) | Streamable HTTP with JSON-only responses and limited notifications. | [`src/jsonResponseStreamableHttp.ts`](src/jsonResponseStreamableHttp.ts) |

packages/core/src/types/schemas.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,14 @@ export const ToolAnnotationsSchema = z.object({
10521052
* Execution-related properties for a tool.
10531053
*/
10541054
export const ToolExecutionSchema = z.object({
1055-
// taskSupport field removed in P0.2 alongside spec.types.ts regen (kept here only while spec.types.ts still declares it).
1055+
/**
1056+
* Indicates the tool's preference for task-augmented execution
1057+
* (`"required"`, `"optional"`, or `"forbidden"`; defaults to `"forbidden"`).
1058+
*
1059+
* The SDK no longer implements task-augmented execution (SEP-2663). The field is
1060+
* kept for parity with the spec schema's `ToolExecution` type and will be removed
1061+
* when the generated spec types next sync.
1062+
*/
10561063
taskSupport: z.enum(['required', 'optional', 'forbidden']).optional()
10571064
});
10581065

packages/core/test/shared/protocol.test.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,53 @@ describe('protocol tests', () => {
771771
expect(sendSpy).toHaveBeenCalledTimes(2);
772772
});
773773
});
774+
775+
describe('notifications/cancelled behavior', () => {
776+
test('should abort request handler when notifications/cancelled is received', async () => {
777+
await protocol.connect(transport);
778+
779+
// Set up a request handler that checks if it was aborted
780+
let wasAborted = false;
781+
protocol.setRequestHandler('ping', async (_request, ctx) => {
782+
// Simulate a long-running operation
783+
await new Promise(resolve => setTimeout(resolve, 100));
784+
wasAborted = ctx.mcpReq.signal.aborted;
785+
return {};
786+
});
787+
788+
// Simulate an incoming request
789+
const requestId = 123;
790+
if (transport.onmessage) {
791+
transport.onmessage({
792+
jsonrpc: '2.0',
793+
id: requestId,
794+
method: 'ping',
795+
params: {}
796+
});
797+
}
798+
799+
// Wait a bit for the handler to start
800+
await new Promise(resolve => setTimeout(resolve, 10));
801+
802+
// Send cancellation notification
803+
if (transport.onmessage) {
804+
transport.onmessage({
805+
jsonrpc: '2.0',
806+
method: 'notifications/cancelled',
807+
params: {
808+
requestId: requestId,
809+
reason: 'User cancelled'
810+
}
811+
});
812+
}
813+
814+
// Wait for the handler to complete
815+
await new Promise(resolve => setTimeout(resolve, 150));
816+
817+
// Verify the request was aborted
818+
expect(wasAborted).toBe(true);
819+
});
820+
});
774821
});
775822

776823
// (2025-11 experimental test suites removed under SEP-2663; see git history.)

packages/core/test/spec.types.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,6 @@ const MISSING_SDK_TYPES = [
962962
'Task',
963963
'TaskStatus',
964964
'TaskMetadata',
965-
'TaskCreationParams',
966965
'TaskAugmentedRequestParams',
967966
'RelatedTaskMetadata',
968967
'CreateTaskResult',
@@ -980,9 +979,7 @@ const MISSING_SDK_TYPES = [
980979
'CancelTaskResult',
981980
'CancelTaskResultResponse',
982981
'TaskStatusNotification',
983-
'TaskStatusNotificationParams',
984-
'ClientTasksCapability',
985-
'ServerTasksCapability'
982+
'TaskStatusNotificationParams'
986983
];
987984

988985
function extractExportedTypes(source: string): string[] {

test/integration/test/server.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,7 @@ describe('createMessage validation', () => {
18211821
});
18221822

18231823
// SEP-2663 removes the client-hosted task store these tests relied on (server polls
1824-
// the client's tasks/* for async sampling). That direction becomes MRTR (S3/F4),
1824+
// the client's tasks/* for async sampling). That direction becomes MRTR,
18251825
// not tasks. The remaining sampling.tools capability assertions are covered by
18261826
// `_createMessageVia` tests; the `createMessageStream` wrapper has no equivalent and is
18271827
// removed.

0 commit comments

Comments
 (0)