fix: load mcp auth at tool call time
This commit is contained in:
@@ -34,6 +34,7 @@ def specs_from_discovered_tools(
|
||||
*,
|
||||
connection: ConnectionConfig,
|
||||
auth: AuthRecord | None,
|
||||
auth_loader: Callable[[], AuthRecord | None] | None = None,
|
||||
executor: ToolExecutor,
|
||||
tools: list[DiscoveredTool],
|
||||
emit_event: Callable[[McpEvent], None] | None = None,
|
||||
@@ -50,6 +51,7 @@ def specs_from_discovered_tools(
|
||||
return source_specs_from_discovered_tools(
|
||||
connection=source_connection,
|
||||
auth=auth,
|
||||
auth_loader=auth_loader,
|
||||
executor=executor,
|
||||
tools=tools,
|
||||
emit_event=emit_tool_event if emit_event is not None else None,
|
||||
|
||||
@@ -273,6 +273,7 @@ class UpstreamTransportService:
|
||||
specs = specs_from_discovered_tools(
|
||||
connection=connection,
|
||||
auth=auth,
|
||||
auth_loader=lambda: self.load_connection_auth(connection),
|
||||
executor=self.tool_executor_for(connection),
|
||||
tools=capabilities.tools,
|
||||
emit_event=self.event_sink,
|
||||
|
||||
Reference in New Issue
Block a user