Documentation
¶
Index ¶
- func ConnectAndUseHttp(overrides *mcp_config.OverrideT, workspace, server, serverURL string, ...) error
- func DefaultClientURI() string
- func DefaultRedirectURI() string
- func DefaultTokenFile(workspace, serverName, rawURL string) string
- func IsAuthorizationFailure(err error) bool
- func NewFilePersistingTokenSource(path string, base oauth2.TokenSource) oauth2.TokenSource
- type Client
- func ConnectCmdLine(overrides *mcp_config.OverrideT, envvars []string, command string, ...) (*Client, error)
- func ConnectHttp(overrides *mcp_config.OverrideT, url string) (*Client, error)
- func ConnectHttpOAuthInteractive(overrides *mcp_config.OverrideT, serverURL string, oauthCfg OAuthConfig, ...) (*Client, error)
- type FileTokenStore
- type GoSDKClient
- type OAuthCallbackResult
- type OAuthCallbackServer
- type OAuthConfig
- type OAuthUIHooks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectAndUseHttp ¶
func ConnectAndUseHttp(overrides *mcp_config.OverrideT, workspace, server, serverURL string, oauth *mcp_config.OAuthT, hooks OAuthUIHooks, onOAuthRequired func(), useClient func(*Client) error) error
func DefaultClientURI ¶
func DefaultClientURI() string
func DefaultRedirectURI ¶
func DefaultRedirectURI() string
func DefaultTokenFile ¶
func IsAuthorizationFailure ¶
func NewFilePersistingTokenSource ¶
func NewFilePersistingTokenSource(path string, base oauth2.TokenSource) oauth2.TokenSource
NewFilePersistingTokenSource returns an oauth2.TokenSource that attempts to read an existing token from `path` when `base` is nil, otherwise delegates to `base` and persists tokens returned by it to `path`.
Types ¶
type Client ¶
type Client struct {
Tools *mcp_sdk.ListToolsResult
// contains filtered or unexported fields
}
func ConnectCmdLine ¶
func ConnectHttp ¶
func ConnectHttp(overrides *mcp_config.OverrideT, url string) (*Client, error)
func ConnectHttpOAuthInteractive ¶
func ConnectHttpOAuthInteractive(overrides *mcp_config.OverrideT, serverURL string, oauthCfg OAuthConfig, hooks OAuthUIHooks) (*Client, error)
type FileTokenStore ¶
type FileTokenStore struct {
// contains filtered or unexported fields
}
func NewFileTokenStore ¶
func NewFileTokenStore(path string) *FileTokenStore
func (*FileTokenStore) StoreToken ¶
type GoSDKClient ¶
type GoSDKClient struct {
Tools *mcp_sdk.ListToolsResult
// contains filtered or unexported fields
}
GoSDKClient is a thin adapter around github.com/modelcontextprotocol/go-sdk's ClientSession.
func ConnectCmdLineGoSDK ¶
func ConnectCmdLineGoSDK(overrides *mcp_config.OverrideT, envvars []string, command string, args ...string) (*GoSDKClient, error)
ConnectCmdLineGoSDK connects to a local MCP server process using the Go SDK transports.
func ConnectHttpGoSDK ¶
func ConnectHttpGoSDK(overrides *mcp_config.OverrideT, endpoint string, oauth authsdk.OAuthHandler) (*GoSDKClient, error)
ConnectHttpGoSDK connects to a streamable HTTP MCP endpoint. oauth may be nil.
func (*GoSDKClient) Call ¶
Call invokes a tool with retry logic for temporary connection failures. It uses exponential backoff with jitter to handle transient network issues.
func (*GoSDKClient) ListTools ¶
func (c *GoSDKClient) ListTools() error
ListTools calls ListTools on the underlying session and caches the result.
type OAuthCallbackResult ¶
type OAuthCallbackServer ¶
type OAuthCallbackServer struct {
// contains filtered or unexported fields
}
func StartOAuthCallbackServer ¶
func StartOAuthCallbackServer(redirectURI string) (*OAuthCallbackServer, error)
func (*OAuthCallbackServer) Close ¶
func (s *OAuthCallbackServer) Close()
func (*OAuthCallbackServer) Wait ¶
func (s *OAuthCallbackServer) Wait(timeout time.Duration) (*OAuthCallbackResult, error)
type OAuthConfig ¶
type OAuthConfig struct {
ClientID string
ClientURI string
ClientSecret string
RedirectURI string
Scopes []string
AuthServerMetadataURL string
TokenFile string
}
func BuildOAuthConfig ¶
func BuildOAuthConfig(workspace, server, serverURL string, oauth *mcp_config.OAuthT) OAuthConfig