Skip to content

Commit d40b46f

Browse files
fix: @deprecated on RequestHandlerExtra; changeset frontmatter client+server + qualifier
1 parent 3bab1dd commit d40b46f

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
'@modelcontextprotocol/core': patch
2+
'@modelcontextprotocol/client': patch
3+
'@modelcontextprotocol/server': patch
34
---
45

5-
v1-compat: add flat fields (`signal`, `requestId`, `_meta`, `authInfo`, `sendNotification`, `sendRequest`, `taskStore`, `taskId`, `taskRequestedTtl`) on the handler context (`ClientContext`/`ServerContext`) mirroring the nested `ctx.mcpReq` / `ctx.http` / `ctx.task` fields, plus the `RequestHandlerExtra` type alias. Allows v1 handler signatures to compile and run unchanged.
6+
v1-compat: add `@deprecated` flat fields (`signal`, `requestId`, `_meta`, `authInfo`, `sendNotification`, `sendRequest`, `taskStore`, `taskId`, `taskRequestedTtl`) on the handler context (`ClientContext`/`ServerContext`) mirroring the nested `ctx.mcpReq` / `ctx.http` / `ctx.task` fields, plus the `RequestHandlerExtra` type alias. Covers the common v1 `extra.*` accesses; HTTP-transport-specific fields (`requestInfo`, `closeSSEStream`, `closeStandaloneSSEStream`) are not shimmed and require migration to `ctx.http?.req` / `ctx.http?.closeSSE`.

packages/core/src/shared/protocol.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ export type ServerContext = BaseContext & {
306306
export type ClientContext = BaseContext & LegacyContextFields;
307307

308308
/**
309+
* @deprecated Use {@linkcode ServerContext} (server side) or {@linkcode ClientContext} (client side).
310+
*
309311
* v1 name for the handler context. v2 also exposes the same data under
310312
* `ctx.mcpReq` / `ctx.http`; the flat fields remain available so existing
311313
* handlers compile and run unchanged. See {@linkcode BaseContext}.

0 commit comments

Comments
 (0)