Open
Description
Hi,
Context
- 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
for (const tool of allTools) {
console.log(`Registering tool: ${tool.name}`);
this.server.tool(tool.name, tool.description, tool.paramsSchema, (params, extra) => {
return tool.handler(params, extra, this.props);
});
Am I doing something wrong?
Metadata
Metadata
Assignees
Labels
No labels