Documentation
¶
Index ¶
- Constants
- func CallTool(url, token, toolName string, arguments map[string]interface{}) (string, error)
- func GetIdFromServerNameAndToolName(serverName, toolName string) string
- func GetServerNameAndToolNameFromId(id string) (string, string)
- func GetToolsFromURL(url, token string) ([]*protocol.Tool, error)
- func NewClient(url, token string) (*client.Client, error)
- type InnerMcpServer
- type ScanIntranetResult
- type ServerConfig
- type ToolSet
Constants ¶
const (
MaxScanHosts = 1024
)
Variables ¶
This section is empty.
Functions ¶
func CallTool ¶
CallTool opens a short-lived MCP connection to url, calls toolName with the supplied arguments, and returns the JSON-marshalled result content.
func GetToolsFromURL ¶
GetToolsFromURL connects to an HTTP-based MCP server and returns its tool list. Always uses StreamableHTTP transport (the current MCP standard); when token is non-empty it is sent as a Bearer Authorization header.
Types ¶
type InnerMcpServer ¶
type ScanIntranetResult ¶
type ScanIntranetResult struct {
CIDR []string `json:"cidr"`
ScannedHosts int `json:"scannedHosts"`
OnlineHosts []string `json:"onlineHosts"`
Servers []*InnerMcpServer `json:"servers"`
}
func ScanIntranetServers ¶
func ScanIntranetServers(cidr, ports, paths []string) (*ScanIntranetResult, error)
ScanIntranetServers probes all IPv4 hosts in cidr for active MCP endpoints. ports and paths may be empty, in which case defaults are used.
type ServerConfig ¶
type ServerConfig struct {
// Stdio config
Command string `json:"command"`
Args []string `json:"args"`
Env map[string]string `json:"env"`
// SSE / StreamableHTTP config
URL string `json:"url"`
// Transport type: "sse", "stdio", "streamablehttp"
// Auto-detected from URL when omitted: URL set → streamablehttp, else → stdio.
Type string `json:"type,omitempty"`
}
type ToolSet ¶
type ToolSet struct {
// Connections maps server name → open MCP connection (closed after the conversation).
Connections map[string]*client.Client
// Tools is the protocol-level tool list passed to the AI model.
Tools []*protocol.Tool
// BuiltinTools is the registry of server-side builtin tools.
BuiltinTools *tool.ToolRegistry
WebSearchEnabled bool
}
ToolSet holds everything needed to execute MCP and builtin tool calls during a model conversation: the open connections, the tool list for the AI, and the builtin tool registry.