me

metoro-io/mcp-golang

Golang framework for building MCP Servers, focussed on type safety

#golang#mcp-server#type-safety
Publishermetoro-io/mcp-golang
Submitted date4/19/2025

Overview of mcp-golang

Title

mcp-golang โ€“ Unofficial Go implementation of the Model Context Protocol (MCP)

How to Use

Installation

go get github.com/metoro-io/mcp-golang

Quick Start

  • Server Example: Define tools, prompts, and resources with native Go structs and register them with the MCP server.
  • Client Example: Initialize a client, call tools with type-safe arguments, and handle responses.
  • HTTP/Gin Support: Use HTTP-based transports for stateless communication (no bidirectional features).

Key Features

  • ๐Ÿ›ก๏ธ Type Safety: Define tool arguments as Go structs with automatic schema generation and deserialization.
  • ๐Ÿš› Custom Transports: Supports stdio (full bidirectional), HTTP (stateless), Gin, SSE, and custom transports.
  • โšก Low Boilerplate: Auto-generates MCP endpoints, reducing manual setup.
  • ๐Ÿงฉ Modular Design: Split into transport, protocol, and server/client components for flexibility.
  • ๐Ÿ”„ Bi-directional Support: Full server and client capabilities via stdio transport.

Use Cases

  • AI Tool Integration: Build MCP-compatible servers for AI models (e.g., Claude Desktop).
  • Kubernetes Monitoring: Example: Metoro uses mcp-golang to query Kubernetes environments.
  • Custom Workflows: Extend with custom transports (e.g., WebSockets, gRPC) for specialized use cases.

Supported Features

FeatureStatusNotes
Tool Callsโœ…Native Go structs, notifications
Prompt Callsโœ…Role-based messaging
Resource Callsโœ…Embedded/text resources
HTTP/Gin Transportโœ…Stateless, no notifications
SSE Transportโœ…Event-driven communication

For more details, visit mcpgolang.com or join the Discord. Contributions welcome!

Visit More

View All