Forward MCP app session metadata in tool calls - #269
Conversation
MCP App native tools now implement `IToolWithContext` and include `_meta.sessionId`/`_meta.userId` on `tools/call` requests. Metadata prefers explicit `ToolExecutionContext.Session` and falls back to an ambient session bridged from `AgentExecutionContext` through a new Core `ToolSessionContextScope` AsyncLocal scope. The tool call path was switched to explicit `SendRequestAsync` params so metadata can be attached without changing tool arguments. Tests and MCPAPP docs were updated to cover forwarding behavior, no-session behavior, and scope restoration.
This patch adds XML documentation comments throughout McpAppTests and its helper fixtures to describe the purpose of each test, helper, and MCP server abstraction. The changes improve IDE IntelliSense and make the behavior of discovery, manifest validation, lifecycle transitions, tool registration, and server setup easier to follow without altering runtime behavior.
Forward MCP app session metadata in tool calls
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
MCP App native tools now implement IToolWithContext and include _meta.sessionId/_meta.userId on tools/call requests.