mcppool

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 New

func New(cfg *config.Config) *Pool

New creates a new connection pool.

func (*Pool) BeginCredentialTransition added in v1.1.0

func (p *Pool) BeginCredentialTransition(servers []string, token string) error

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) Close

func (p *Pool) Close(server string)

Close disconnects a specific 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

func (p *Pool) CredentialTransitionPending(server string) bool

CredentialTransitionPending reports whether server is fenced by a current credential mutation.

func (*Pool) Diagnose added in v1.1.0

func (p *Pool) Diagnose(ctx context.Context, server string) (Diagnostics, error)

Diagnose connects to a server, verifies tool discovery, and returns only redacted protocol and transport metadata.

func (*Pool) EndCredentialTransition added in v1.1.0

func (p *Pool) EndCredentialTransition(token string)

EndCredentialTransition releases every server fence owned by token.

func (*Pool) HasCredentialTransitions added in v1.1.0

func (p *Pool) HasCredentialTransitions() bool

HasCredentialTransitions reports whether any credential mutation currently owns a server fence in this daemon.

func (*Pool) ListTools

func (p *Pool) ListTools(ctx context.Context, server string) ([]ToolInfo, error)

ListTools returns the tools available on a server.

func (*Pool) Reset added in v0.1.6

func (p *Pool) Reset(cfg *config.Config)

Reset swaps the underlying config and drops all active connections.

func (*Pool) SetConfig added in v1.0.0

func (p *Pool) SetConfig(cfg *config.Config)

SetConfig swaps the underlying config without dropping active connections.

func (*Pool) ToolInfoByName

func (p *Pool) ToolInfoByName(ctx context.Context, server, tool string) (*ToolInfo, error)

ToolInfoByName returns metadata and schemas for a specific tool.

func (*Pool) ToolSchema

func (p *Pool) ToolSchema(ctx context.Context, server, tool string) (json.RawMessage, error)

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.

Jump to

Keyboard shortcuts

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