Documentation
¶
Index ¶
- Variables
- func VerifyHTTPAuthorization(ctx context.Context, scfg config.ServerConfig, oauthHandler auth.OAuthHandler) error
- type Diagnostics
- type Pool
- func (p *Pool) BeginCredentialTransition(servers []string, token string) error
- func (p *Pool) CallTool(ctx context.Context, server, tool string, argsJSON json.RawMessage) (*mcp.CallToolResult, error)
- func (p *Pool) CallToolWithInfo(ctx context.Context, server string, info *ToolInfo, argsJSON json.RawMessage) (*mcp.CallToolResult, error)
- func (p *Pool) CallToolWithInfoAndInput(ctx context.Context, server string, info *ToolInfo, ...) (*mcp.CallToolResult, error)
- func (p *Pool) Close(server string)
- func (p *Pool) CloseAll()
- func (p *Pool) CredentialTransitionPending(server string) bool
- func (p *Pool) Diagnose(ctx context.Context, server string) (Diagnostics, error)
- func (p *Pool) EndCredentialTransition(token string)
- func (p *Pool) HasCredentialTransitions() bool
- func (p *Pool) ListTools(ctx context.Context, server string) ([]ToolInfo, error)
- func (p *Pool) Reset(cfg *config.Config)
- func (p *Pool) SetConfig(cfg *config.Config)
- func (p *Pool) ToolInfoByName(ctx context.Context, server, tool string) (*ToolInfo, error)
- func (p *Pool) ToolSchema(ctx context.Context, server, tool string) (json.RawMessage, error)
- type ToolInfo
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidParams = errors.New("invalid params")
ErrInvalidParams marks client-side argument validation failures so callers can preserve mcpx's usage-error exit contract independently of the MCP SDK.
Functions ¶
func VerifyHTTPAuthorization ¶ added in v1.1.0
func VerifyHTTPAuthorization(ctx context.Context, scfg config.ServerConfig, oauthHandler auth.OAuthHandler) error
VerifyHTTPAuthorization exercises discovery and tool listing with an explicitly constructed OAuth handler, then closes the temporary connection.
Types ¶
type Diagnostics ¶ added in v1.1.0
type Diagnostics struct {
Transport string `json:"transport"`
ProtocolVersion string `json:"protocol_version,omitempty"`
AuthSource string `json:"auth_source"`
ToolCount int `json:"tool_count"`
}
Diagnostics is a redacted snapshot of an established MCP connection.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool manages MCP server connections, creating them on demand.
func (*Pool) BeginCredentialTransition ¶ added in v1.1.0
BeginCredentialTransition prevents new connections for the named servers, then waits for every existing request and connection to finish. Returning successfully is the daemon's proof that no old OAuth token writer remains.
func (*Pool) CallTool ¶
func (p *Pool) CallTool(ctx context.Context, server, tool string, argsJSON json.RawMessage) (*mcp.CallToolResult, error)
CallTool invokes a tool on a server.
func (*Pool) CallToolWithInfo ¶ added in v0.1.12
func (p *Pool) CallToolWithInfo(ctx context.Context, server string, info *ToolInfo, argsJSON json.RawMessage) (*mcp.CallToolResult, error)
CallToolWithInfo invokes a resolved tool on a server.
func (*Pool) CallToolWithInfoAndInput ¶ added in v1.1.0
func (p *Pool) CallToolWithInfoAndInput(ctx context.Context, server string, info *ToolInfo, argsJSON, inputResponsesJSON json.RawMessage, requestState string) (*mcp.CallToolResult, error)
CallToolWithInfoAndInput invokes a tool retry with MCP multi-round-trip input responses and the opaque request state returned by the server.
func (*Pool) CloseAll ¶
func (p *Pool) CloseAll()
CloseAll disconnects all servers and waits for every pending retirement.
func (*Pool) CredentialTransitionPending ¶ added in v1.1.0
CredentialTransitionPending reports whether server is fenced by a current credential mutation.
func (*Pool) Diagnose ¶ added in v1.1.0
Diagnose connects to a server, verifies tool discovery, and returns only redacted protocol and transport metadata.
func (*Pool) EndCredentialTransition ¶ added in v1.1.0
EndCredentialTransition releases every server fence owned by token.
func (*Pool) HasCredentialTransitions ¶ added in v1.1.0
HasCredentialTransitions reports whether any credential mutation currently owns a server fence in this daemon.
func (*Pool) Reset ¶ added in v0.1.6
Reset swaps the underlying config and drops all active connections.
func (*Pool) SetConfig ¶ added in v1.0.0
SetConfig swaps the underlying config without dropping active connections.
func (*Pool) ToolInfoByName ¶
ToolInfoByName returns metadata and schemas for a specific tool.
func (*Pool) ToolSchema ¶
ToolSchema returns the input schema for a specific tool.
type ToolInfo ¶
type ToolInfo struct {
Name string
Title string
Description string
InputSchema json.RawMessage
OutputSchema json.RawMessage
Annotations json.RawMessage
// contains filtered or unexported fields
}
ToolInfo is a simplified tool descriptor returned by ListTools.