Documentation
¶
Index ¶
- Constants
- func NewToolServer(runtime ToolRuntime) *sdk.Server
- func ResultContent(result *sdk.CallToolResult) string
- func RunStdioServer(ctx context.Context, runtime ToolRuntime) error
- func SanitizeToolPart(value string) string
- func ToolID(prefix string, remoteName string) string
- type Config
- type ServerConfig
- type Session
- type ToolRuntime
Constants ¶
const ( TransportStdio = "stdio" TransportHTTP = "http" )
Variables ¶
This section is empty.
Functions ¶
func NewToolServer ¶
func NewToolServer(runtime ToolRuntime) *sdk.Server
func ResultContent ¶
func ResultContent(result *sdk.CallToolResult) string
func RunStdioServer ¶
func RunStdioServer(ctx context.Context, runtime ToolRuntime) error
func SanitizeToolPart ¶
Types ¶
type ServerConfig ¶
type ServerConfig struct {
ID string
Name string
Enabled bool
Transport string
Command string
Args []string
Env map[string]string
// Environ is the environment of a stdio server before Env; nil inherits
// the daemon's.
Environ []string
Endpoint string
ToolPrefix string
ReadOnly bool
Timeout time.Duration
}
type Session ¶ added in v0.2.0
type Session struct {
// contains filtered or unexported fields
}
Session is a connection to one MCP server and the tools it offers. A server that stopped is started again on the next call.
func Connect ¶ added in v0.2.0
func Connect(ctx context.Context, cfg ServerConfig) (*Session, error)
Connect starts or reaches the server and lists its tools.
func (*Session) Alive ¶ added in v0.2.0
Alive reports whether the connection to the server is still open.