Documentation
¶
Overview ¶
Package mcpauthtool provides a per-server pseudo-tool that triggers the OAuth flow for an MCP server in the StatusNeedsAuth state. Mirrors src/tools/McpAuthTool/McpAuthTool.ts (createMcpAuthTool): the tool is registered with the name "mcp__<serverName>__authenticate" so it shows up in the model's tool list under the same prefix as the server's real tools (which are absent until auth completes).
On call, the tool kicks off PerformOAuthFlow synchronously with a generous timeout, persists the token bundle, and asks the manager to reconnect the server. Returns a short status string suitable for the LLM to relay to the user.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates a pseudo-tool for one server. The manager must have a SecureStore configured — otherwise the tool can't persist the bundle and Execute returns an error.
func RegisterPending ¶
RegisterPending walks manager.PendingNeedsAuth() and registers a pseudo-tool for each. Idempotent — calling twice for the same server just overwrites the previous registration via tool.Registry semantics. Caller passes a name→URL mapping for HTTP/SSE servers.
Types ¶
This section is empty.