Commit fdb400a
committed
Add automatic _meta parameter extraction support
The MCP protocol specification includes a _meta parameter that allows
clients to pass request-specific metadata. This commit adds automatic
extraction of this parameter and makes it available to tools and prompts
as a nested field within server_context.
Key changes:
- Extract _meta from request params in call_tool and get_prompt methods
- Pass _meta as a nested field in server_context (server_context[:_meta])
- Only create context when there's either server_context or _meta present
- Add comprehensive tests for _meta extraction and nesting
- Update documentation with _meta usage examples and link to spec
This maintains compatibility with TypeScript and Python SDKs which also
nest _meta within the context rather than merging it at the top level.1 parent cdf5b1c commit fdb400a
File tree
3 files changed
+530
-243
lines changed- lib/mcp
- test/mcp
3 files changed
+530
-243
lines changed
0 commit comments