mcppool

package
v0.8.56 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONRPCRequest

type JSONRPCRequest struct {
	JSONRPC string      `json:"jsonrpc"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params,omitempty"`
	ID      interface{} `json:"id,omitempty"`
}

type JSONRPCResponse

type JSONRPCResponse struct {
	JSONRPC string      `json:"jsonrpc"`
	Result  interface{} `json:"result,omitempty"`
	Error   interface{} `json:"error,omitempty"`
	ID      interface{} `json:"id,omitempty"`
}

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool(ctx context.Context, config *PoolConfig) (*Pool, error)

func (*Pool) DiscoverExistingSockets added in v0.8.1

func (p *Pool) DiscoverExistingSockets() int

DiscoverExistingSockets scans for existing pool sockets owned by another agent-deck instance and registers them so this instance can use them too. Returns count of discovered sockets.

func (*Pool) FallbackEnabled added in v0.8.1

func (p *Pool) FallbackEnabled() bool

FallbackEnabled returns whether stdio fallback is allowed when pool isn't working

func (*Pool) GetSocketPath

func (p *Pool) GetSocketPath(name string) string

func (*Pool) GetURL

func (p *Pool) GetURL(name string) string

func (*Pool) IsRunning

func (p *Pool) IsRunning(name string) bool

func (*Pool) ListServers

func (p *Pool) ListServers() []ProxyInfo

func (*Pool) RegisterExternalSocket added in v0.8.1

func (p *Pool) RegisterExternalSocket(name, socketPath string) error

RegisterExternalSocket registers an external socket owned by another agent-deck instance. This creates a proxy entry that points to the existing socket without starting a new process.

func (*Pool) RestartProxy added in v0.8.1

func (p *Pool) RestartProxy(name string) error

RestartProxy stops and restarts a proxy that has died

func (*Pool) RestartProxyWithRateLimit added in v0.8.5

func (p *Pool) RestartProxyWithRateLimit(name string) error

RestartProxyWithRateLimit restarts a proxy with rate limiting to prevent loops

func (*Pool) ShouldPool

func (p *Pool) ShouldPool(mcpName string) bool

func (*Pool) Shutdown

func (p *Pool) Shutdown() error

func (*Pool) Start

func (p *Pool) Start(name, command string, args []string, env map[string]string) error

func (*Pool) StartHealthMonitor added in v0.8.5

func (p *Pool) StartHealthMonitor()

StartHealthMonitor launches a background goroutine that checks for failed proxies every 10 seconds and restarts them automatically.

type PoolConfig

type PoolConfig struct {
	Enabled       bool
	PoolAll       bool
	ExcludeMCPs   []string
	PoolMCPs      []string
	FallbackStdio bool
}

type ProxyInfo

type ProxyInfo struct {
	Name       string
	SocketPath string
	Status     string
	Clients    int
}

type ServerStatus

type ServerStatus int

ServerStatus represents MCP server state

const (
	StatusStopped ServerStatus = iota
	StatusStarting
	StatusRunning
	StatusFailed
)

func (ServerStatus) String

func (s ServerStatus) String() string

type SocketProxy

type SocketProxy struct {
	Status ServerStatus
	// contains filtered or unexported fields
}

SocketProxy wraps a stdio MCP process with a Unix socket

func NewSocketProxy

func NewSocketProxy(ctx context.Context, name, command string, args []string, env map[string]string) (*SocketProxy, error)

func (*SocketProxy) GetClientCount

func (p *SocketProxy) GetClientCount() int

func (*SocketProxy) GetSocketPath

func (p *SocketProxy) GetSocketPath() string

func (*SocketProxy) GetStatus added in v0.8.5

func (p *SocketProxy) GetStatus() ServerStatus

GetStatus safely reads the proxy status

func (*SocketProxy) HealthCheck

func (p *SocketProxy) HealthCheck() error

func (*SocketProxy) SetStatus added in v0.8.5

func (p *SocketProxy) SetStatus(s ServerStatus)

SetStatus safely updates the proxy status

func (*SocketProxy) Start

func (p *SocketProxy) Start() error

func (*SocketProxy) Stop

func (p *SocketProxy) Stop() error

Jump to

Keyboard shortcuts

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