Documentation
¶
Overview ¶
Package tinymcp provides a lightweight wrapper around the official Model Context Protocol Go SDK. It reduces boilerplate for building stdio MCP servers that AI clients (Cursor, Claude Desktop, Windsurf, etc.) can discover and call.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTool ¶
func RegisterTool[In, Out any](s *TinyServer, name, description string, handler mcp.ToolHandlerFor[In, Out]) error
RegisterTool registers a tool on s with automatic JSON Schema inference from the handler's input struct (use json and jsonschema struct tags). The handler must match mcp.ToolHandlerFor[In, Out] — typically return TextResult for text tools.
func TextResult ¶
func TextResult(text string) *mcp.CallToolResult
TextResult builds a successful CallToolResult with a single text content block. Use this in tool handlers so LLM clients receive consistent, readable output.
Types ¶
type TinyServer ¶
type TinyServer struct {
// contains filtered or unexported fields
}
TinyServer wraps the official MCP Server with a simplified API for registering tools and starting stdio transport.
func NewServer ¶
func NewServer(name, version string) *TinyServer
NewServer creates a TinyServer identified by name and version for connected clients.
func (*TinyServer) RawServer ¶
func (s *TinyServer) RawServer() *mcp.Server
RawServer returns the underlying *mcp.Server for advanced customization.
func (*TinyServer) Start ¶
func (s *TinyServer) Start() error
Start runs the server over stdin/stdout (stdio), the standard transport for local AI clients.