Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBashServer ¶
NewBashServer creates a new MCP server that provides bash command execution capabilities. The server includes a single tool "run_shell_cmd" that executes shell commands with security restrictions, timeout controls, and output truncation. Returns an error if server initialization fails.
func NewFetchServer ¶
NewFetchServer creates a new MCP server that provides web content fetching capabilities. The server includes a single tool "fetch" that retrieves content from URLs and converts it to text, markdown, or HTML format. Returns an error if server initialization fails.
func NewHTTPServer ¶ added in v0.22.0
func NewHTTPServer(llmModel model.ToolCallingChatModel) (*server.MCPServer, error)
NewHTTPServer creates a new MCP server providing advanced HTTP fetching capabilities. The server includes tools for fetching web content, summarizing pages, extracting specific information, and filtering JSON responses. If an LLM model is provided, AI-powered summarization and extraction tools are enabled. Returns an error if server initialization fails.
func NewTodoServer ¶
NewTodoServer creates a new MCP server that provides todo list management capabilities. The server includes two tools: "todowrite" for updating the todo list and "todoread" for retrieving the current list. Todos are stored in memory and not persisted. Returns an error if server initialization fails.
Types ¶
type BuiltinServerWrapper ¶
type BuiltinServerWrapper struct {
// contains filtered or unexported fields
}
BuiltinServerWrapper wraps an external MCP server for builtin use, providing a consistent interface for all builtin servers regardless of their implementation.
func (*BuiltinServerWrapper) GetServer ¶
func (w *BuiltinServerWrapper) GetServer() *server.MCPServer
GetServer returns the wrapped MCP server instance that can be used to handle tool calls and other MCP protocol operations.
func (*BuiltinServerWrapper) Initialize ¶
func (w *BuiltinServerWrapper) Initialize() error
Initialize initializes the wrapped server. For builtin servers, this is typically a no-op as the server is initialized during creation. Returns an error if initialization fails.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds all available builtin servers and their factory functions. It provides a centralized registry for creating instances of builtin MCP servers with their respective configurations.
func NewRegistry ¶
func NewRegistry() *Registry
NewRegistry creates a new builtin server registry with all available builtin servers registered. The registry includes filesystem (fs), bash, todo, fetch, and HTTP servers.
func (*Registry) CreateServer ¶
func (r *Registry) CreateServer(name string, options map[string]any, model model.ToolCallingChatModel) (*BuiltinServerWrapper, error)
CreateServer creates a new instance of a builtin server by name. The options parameter provides server-specific configuration, and the model parameter provides an optional LLM for AI-powered features. Returns an error if the server name is unknown or if creation fails.
func (*Registry) ListServers ¶
ListServers returns a list of all available builtin server names that can be created using CreateServer. The order of names is not guaranteed.
type TodoInfo ¶
type TodoInfo struct {
Content string `json:"content"`
Status string `json:"status"`
Priority string `json:"priority"`
ID string `json:"id"`
}
TodoInfo represents a single todo item with content, status, priority, and ID. Status can be "pending", "in_progress", or "completed". Priority can be "high", "medium", or "low". Each todo must have a unique ID.
type TodoServer ¶
type TodoServer struct {
// contains filtered or unexported fields
}
TodoServer implements a todo management MCP server with in-memory storage. It provides thread-safe operations for reading and writing todo lists, with support for task status tracking and priority levels.