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
`ServerContext` convenience methods (new in v2, no v1 equivalent):
392
+
393
+
| Method | Description | Replaces |
394
+
|--------|-------------|----------|
395
+
|`ctx.mcpReq.log(level, data, logger?)`| Send log notification (respects client's level filter) |`server.sendLoggingMessage(...)` from within handler |
396
+
|`ctx.mcpReq.elicitInput(params, options?)`| Elicit user input (form or URL) |`server.elicitInput(...)` from within handler |
397
+
|`ctx.mcpReq.requestSampling(params, options?)`| Request LLM sampling from client |`server.createMessage(...)` from within handler |
398
+
399
+
## 11. Client Behavioral Changes
370
400
371
401
`Client.listPrompts()`, `listResources()`, `listResourceTemplates()`, `listTools()` now return empty results when the server lacks the corresponding capability (instead of sending the request). Set `enforceStrictCapabilities: true` in `ClientOptions` to throw an error instead.
2. Replace all imports from `@modelcontextprotocol/sdk/...` using the import mapping tables (sections 3-4), including `StreamableHTTPServerTransport` → `NodeStreamableHTTPServerTransport`
`BaseContext` is the common base type shared by both `ServerContext` and `ClientContext`. `ServerContext` extends each group with server-specific additions via type intersection.
435
+
436
+
`ServerContext` also provides convenience methods for common server→client operations:
0 commit comments