mcp-go  by mark3labs

Go SDK for LLM-app integration with external data/tools via Model Context Protocol

created 8 months ago
6,644 stars

Top 7.8% on sourcepulse

GitHubView on GitHub
Project Summary

This Go library implements the Model Context Protocol (MCP), a standardized way for Large Language Models (LLMs) to interact with external data sources and tools. It targets developers building LLM-powered applications, enabling them to expose data via Resources and trigger actions via Tools with minimal boilerplate.

How It Works

MCP Go provides a high-level Go API for building MCP servers. It abstracts the complexities of the MCP protocol, allowing developers to define Resources (data endpoints) and Tools (action endpoints) using simple Go functions. The library handles server management, connection handling, and message routing, facilitating seamless integration between LLMs and custom logic. Key features include support for static and dynamic resources, parameterized tools with input validation, and reusable prompt templates.

Quick Start & Requirements

  • Install: go get github.com/mark3labs/mcp-go
  • Prerequisites: Go version >= 1.23.
  • Setup: Clone the repository and run tests with go test -v './...'.
  • Docs: Tutorial

Highlighted Details

  • Resources: Expose data via static URIs or dynamic templates, supporting various MIME types.
  • Tools: Define callable functions with typed arguments, descriptions, and validation rules (e.g., enums, patterns).
  • Prompts: Create reusable interaction templates for LLMs, including system messages and embedded resources.
  • Session Management: Supports per-session tool customization, notifications, and tool filtering based on session context.

Maintenance & Community

Licensing & Compatibility

  • License: Not explicitly stated in the README.
  • Compatibility: Designed for Go applications.

Limitations & Caveats

The project is under active development, and the MCP specification itself is evolving. While core features are functional, some advanced capabilities are still in progress.

Health Check
Last commit

2 days ago

Responsiveness

1 day

Pull Requests (30d)
32
Issues (30d)
14
Star History
2,318 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Travis Fischer Travis Fischer(Founder of Agentic), and
1 more.

fastmcp by punkpeye

3.7%
2k
TypeScript framework for building MCP servers handling client sessions
created 7 months ago
updated 2 days ago
Starred by Didier Lopes Didier Lopes(Founder of OpenBB), Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), and
2 more.

fastmcp by jlowin

2.1%
15k
Pythonic SDK for building Model Context Protocol (MCP) servers/clients
created 8 months ago
updated 1 day ago
Feedback? Help us improve.