Documentation
¶
Overview ¶
Package server provides the MCP (Model Context Protocol) server implementation for ToolHive.
Index ¶
- Constants
- type Config
- type Handler
- func (h *Handler) GetServerLogs(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
- func (h *Handler) ListServers(ctx context.Context, _ mcp.CallToolRequest) (*mcp.CallToolResult, error)
- func (h *Handler) RemoveServer(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
- func (h *Handler) RunServer(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
- func (h *Handler) SearchRegistry(_ context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
- func (h *Handler) StopServer(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
- type Info
- type Server
- type WorkloadInfo
Constants ¶
View Source
const ( // DefaultMCPPort is the default port for the MCP server // 4483 represents "HIVE" on a phone keypad (4=HI, 8=V, 3=E) DefaultMCPPort = "4483" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles MCP tool requests for ToolHive
func NewHandler ¶
NewHandler creates a new ToolHive handler
func (*Handler) GetServerLogs ¶
func (h *Handler) GetServerLogs(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
GetServerLogs gets logs from a running MCP server
func (*Handler) ListServers ¶
func (h *Handler) ListServers(ctx context.Context, _ mcp.CallToolRequest) (*mcp.CallToolResult, error)
ListServers lists all running MCP servers
func (*Handler) RemoveServer ¶
func (h *Handler) RemoveServer(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
RemoveServer removes a stopped MCP server
func (*Handler) RunServer ¶
func (h *Handler) RunServer(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
RunServer runs an MCP server
func (*Handler) SearchRegistry ¶
func (h *Handler) SearchRegistry(_ context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
SearchRegistry searches the ToolHive registry
func (*Handler) StopServer ¶
func (h *Handler) StopServer(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)
StopServer stops a running MCP server
type Info ¶
type Info struct { Name string `json:"name"` Description string `json:"description"` Transport string `json:"transport"` Image string `json:"image,omitempty"` Args []string `json:"args,omitempty"` Tools []string `json:"tools,omitempty"` Tags []string `json:"tags,omitempty"` }
Info represents server information returned by search
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the ToolHive MCP server
func (*Server) GetAddress ¶
GetAddress returns the server address
Click to show internal directories.
Click to hide internal directories.