Tiny Go MCP Server is a lightweight Model Context Protocol (MCP) toolkit for the Go language, built on top of the official modelcontextprotocol/go-sdk. Its goal is to minimize repetitive boilerplate code such as server creation, transport configuration, and registration error handling while preserving the official protocol implementation. The project can be used both as a library (the tinymcp package) and as a starter template (cmd/tiny-go-mcp).
[Purpose and Positioning] This project is suitable for Go developers who want to use the official protocol implementation, keep a small static server binary, and at the same time avoid writing a large amount of repetitive code. It is not a replacement for go-sdk, but a thin wrapper: the protocol implementation, generics, and schema inference still come from modelcontextprotocol/go-sdk. Therefore, handler code imports both packages at the same time, and this is intentional—the project does not aim for a non-leaky facade that hides the SDK. If full control is needed, you can call RawServer() or use go-sdk directly; both are the same server underneath, and there is no lock-in.
[Main Capabilities]
- Transports: supports stdio (standard input/output, the default mode expected by most local AI clients), streamable HTTP, and legacy SSE. Start() runs stdio; HTTP/SSE are wrapped through minimal options around the official go-sdk handlers. The examples use stateless mode by default (Stateless: true), meaning one POST JSON-RPC per request, with no long-lived SSE GET stream and no server-initiated messages.
- Registration content: supports tools, resources, and prompts. Resources can register read-only context (see examples/resources for a runnable example), and dynamic URI templates can use RegisterResourceTemplate.
- JSON Schema inference: automatically derives JSON Schema from Go structs via struct tags (jsonschema tags), so parameter descriptions appear in the schema.
- Result return: use tinymcp.TextResult to return human-readable text,so that clients can display it reliably.
- Binary size: the compiled artifact is a static binary of about 5MB, which can be further reduced to about 1.8MB after UPX compression.
[Environment Requirements and Usage] Requires Go 1.26 or later. See docs/QUICKSTART.md for a detailed step-by-step guide, and SYSTEM_PROMPT.md for AI code generation reference. See examples/minimal for a runnable copy-paste example. Scaffolding approach: the template/ module tag (v1.1.1+) is needed for stdio, or template-http/ for streamable HTTP; you can also directly copy examples/minimal, template/, or template-http/. After installing the example server, both installation paths generate a binary named tiny-go-mcp, and it can also be built from source.
When connecting an AI client, the MCP server communicates over stdio; simply point the client to the path of the compiled binary. See examples/mcp-client-config.json for a template configuration. Regarding logging, the protocol uses stdin/stdout, and server logs (if any) are output only to stderr; setting TINY_GO_MCP_VERBOSE=1 on the server process enables startup log lines. The configuration examples cover Cursor (.cursor/mcp.json), Claude (claude_desktop_config.json on macOS or Windows), and other stdio clients such as Windsurf and Zed use the same form: command is the absolute path to tiny-go-mcp, and transport is stdio.
[Applicable Scenarios]
- Need to quickly set up a local stdio server compliant with the MCP specification for AI clients to call tools, resources, and prompts.
- Want to integrate with the official go-sdk with minimal boilerplate code while keeping a small deployment size.
- Use as a starter template or scaffold for a new MCP server project.
- HTTP deployment scenarios: the examples provide examples/http (stateless mode) and examples/http-deploy (for Smithery URL listing hosting, where end users do not need Docker), docs/GLAMA.md (Glama's Docker hosting).
[Limitations and Notes]
- This project is a thin wrapper over the official go-sdk and does not hide the underlying SDK; handlers still need to import the mcp package to use request types. Advanced session routing or event storage must be implemented directly using server.RawServer() together with go-sdk.
- Example tools (such as math calculations and greetings) are only for MCP integration demonstrations and are not production logic; agents should calculate math and compose greetings within the conversation unless explicitly testing tool calls.
- Requires Go 1.26+; stateless mode is the example default. If a full streamable HTTP session is needed, omit this setting or use session options; see docs/HTTP.md for details.
- Publishing a stable release requires tagging with semver (e.g. v1.2.0) to trigger go get versions and GitHub Releases as well as multi-architecture GHCR images. For public API stability see docs/STABILITY.md, and for upgrading from v1.1.x see docs/MIGRATION-v1.2.md.
- The project uses the MIT license.
[Other] The docs/ directory contains key documentation; for discovery and registration see docs/DISCOVERY.md (server.json for the MCP Registry, awesome lists, and community directories), and for listing copy and launch posts see docs/SUBMISSIONS.md. For contributions see CONTRIBUTING.md, and for AI code generation see SYSTEM_PROMPT.md. CI runs tests, lint, and CodeQL, and Dependabot maintains Go and Actions dependencies. For the security policy see the repository description.