Esta página se muestra en inglés. Una traducción al español está en curso.
MCP ConfigsMay 12, 2026·2 min de lectura

mcp-go — Build MCP Servers in Go

mcp-go is a Go SDK for building MCP servers (tools, resources, prompts) and serving them over stdio transports, so agents can call your Go code as tools.

Listo para agents

Staging seguro para este activo

Este activo primero queda en staging. El prompt copiado pide inspeccionar los archivos staged antes de activar scripts, config MCP o config global.

Stage only · 17/100Política: staging
Superficie agent
Cualquier agent MCP/CLI
Tipo
Mcp Config
Instalación
Stage only
Confianza
Confianza: Established
Entrada
Asset
Comando de staging seguro
npx -y tokrepo@latest install cad7f465-8f0f-4455-b75b-704d94077c15 --target codex

Primero deja archivos en staging; la activación requiere revisar el README y el plan staged.

Introducción

mcp-go is a Go SDK for building MCP servers (tools, resources, prompts) and serving them over stdio transports, so agents can call your Go code as tools.

  • Best for: Go teams who want first-class tool servers (strong typing, middleware, session handling) for agent workflows
  • Works with: Go 1.x toolchain, stdio MCP clients, server-side tool/resource/prompt patterns
  • Setup time: 12 minutes

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:

  1. Add resources for read-only context (like listing projects or configs).
  2. Add tools for side effects (create/update/apply).
  3. 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.

🙏

Fuente y agradecimientos

Source: https://github.com/mark3labs/mcp-go > License: MIT > GitHub stars: 8,682 · forks: 826

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados