Skip to content

Forward MCP app session metadata in tool calls - #269

Merged
geffzhang merged 3 commits into
DirectoryPackagesPropsfrom
main
Sep 30, 2026
Merged

geffzhang merged 3 commits into
DirectoryPackagesPropsfrom
main

Conversation

@geffzhang

Copy link
Copy Markdown
Collaborator

MCP App native tools now implement IToolWithContext and include _meta.sessionId/_meta.userId on tools/call requests.

geffzhang and others added 3 commits September 30, 2026 13:31
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
@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 9424422f-a5d1-4d72-874c-a59167a3ccaf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@geffzhang
geffzhang merged commit a0da28a into DirectoryPackagesProps Sep 30, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants