Practical Notes
- Quickstart includes a calculator tool example you can run in <15 minutes
- The README contains multiple example sections (server/resources/tools/prompts/session management) you can copy incrementally
A Go-Native Pattern for Tool Design
Treat each MCP tool as a stable “function contract”:
- Keep inputs small and typed (string/number/enum) so the agent can call it reliably.
- Put your real side effects behind a thin validation layer.
- Prefer idempotent operations (safe retries) and provide clear error messages.
Once you have one tool, scale to a toolkit:
- Add resources for read-only context (like listing projects or configs).
- Add tools for side effects (create/update/apply).
- Add prompts to encode standard operating procedures for your team.
That split (resources vs tools vs prompts) makes agent behavior easier to reason about and audit.
FAQ
Q: Is mcp-go only for servers? A: It’s primarily a server SDK; it helps you expose tools/resources/prompts to MCP clients.
Q: Do I need HTTP? A: No. The README quickstart uses stdio transport, which works with many clients.
Q: How do I keep tools safe? A: Validate inputs, keep side effects minimal, and prefer idempotent operations.