Replies: 4 comments 1 reply
-
managed to get the "Mcp-Session-Id" from the request headers usign IHttpContextAccessor accessor. |
Beta Was this translation helpful? Give feedback.
-
Hi. Can you provide an example of how you achieved to get the mcp-session-id during tool exection please? |
Beta Was this translation helpful? Give feedback.
-
Hi, you can find an example below... For this to work, you have register HttpContextAccessor in your startup: and use the sse client not the streamable http client ... or configure streamable http to be stateless:
|
Beta Was this translation helpful? Give feedback.
-
Thank you very much @kaniosm
And in each tool i use this._httpContext to get the request headers |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-submission Checklist
Question Category
Your Question
Some of my tools are session dependent, how can I read the Mcp-Session-Id when the tool get executed?
Beta Was this translation helpful? Give feedback.
All reactions