Documentation
¶
Overview ¶
Package mcpkit provides the shared scaffolding used by hawk-ecosystem libraries (inspect, sight, ...) to expose their functionality as MCP servers. It wraps github.com/mark3labs/mcp-go with the ecosystem's standard construction, transports, and small handler helpers so that individual repos only declare their tools and handlers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONResult ¶
func JSONResult(v any) (*mcplib.CallToolResult, error)
JSONResult marshals v as indented JSON and returns it as a text tool result. It returns a protocol-level error only when marshalling fails.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wraps an mcp-go MCPServer with the ecosystem's standard transports (stdio and streamable HTTP).
func (*Server) AddTool ¶
func (s *Server) AddTool(tool mcplib.Tool, handler mcpserver.ToolHandlerFunc)
AddTool registers a tool and its handler.
func (*Server) MCP ¶
MCP returns the underlying mcp-go server, as an escape hatch for capabilities mcpkit does not wrap.
func (*Server) ServeHTTP ¶
ServeHTTP serves MCP over the streamable HTTP transport at http://<addr>/mcp and blocks until the server stops.
func (*Server) ServeStdio ¶
ServeStdio serves MCP over stdin/stdout and blocks until the stream is closed or the context that mcp-go derives internally is done.