mcpauthtool

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: MIT Imports: 6 Imported by: 0

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

func New(manager *mcp.Manager, serverName, serverURL string) tool.Tool

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

func RegisterPending(reg *tool.Registry, manager *mcp.Manager, urls map[string]string)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL