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
I am working on a Cloudflare Worker-based MCP which natively provides authentication context through it's own McpAgent this.props. This is obviously super useful for implementing user-based logic in tool calls.
What I want is a clean way to access this info during tool calls, I have read the docs but could find anything remotely relevant in this regard
RequestHandlerExtra has a conveniently named AuthInfo which is empty (perhaps it's not set by the workers oauth provider and should be set manually (?)
Question:
Is there an intended clean way to pass auth context to tool calls?
How would you recommend this is done?
I am currently passing the props directly into tool handler which obviously breaks it interface
Hi @alexander-zuev, did you manage to make Cloudflare McpAgent work with authInfo? I'm using this.props too, and after looking at the McpAgent source code, it seems there's no way to hook into the invocation of the tool callback to set authInfo 😢
If I recall I modified the extra interface which is passed with every tool call, but since I did this recently I distinctly remember that I've seen somewhere in SDK notes that there is a more natural way to do that
My approach is not ideal since I had to modify the types which led to a lot of mortal kombat with TS errors
Hi,
Context
RequestHandlerExtra
has a conveniently named AuthInfo which is empty (perhaps it's not set by the workers oauth provider and should be set manually (?)Question:
I am currently passing the props directly into tool handler which obviously breaks it interface
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: