Repolode
mark3labs

mark3labs/mcp-go

A Go implementation of the Model Context Protocol for building MCP servers that expose tools, resources and prompts to LLM applications.

Stars
9,181
Forks
910
Open issues
23
Last commit
2 hours ago

What is it?

mcp-go is a Go library for building servers that follow the Model Context Protocol, a standard for connecting LLM applications to external data sources and tools. It handles protocol details and server management so developers can register tools, resources and prompts with handler functions and start a server.

The library supports stdio, SSE and streamable-HTTP transports. It includes typed tool handlers, task-augmented tools for long-running work, session management with per-session tools and filters, middleware for tool and prompt handlers, and auto-completion providers. It also covers OAuth protected resource metadata, CORS for browser clients and DNS rebinding protection for local HTTP servers.

The project implements MCP specification version 2025-11-25 and maintains backward compatibility with several earlier protocol versions. The README notes that the implementation is still under active development, with some advanced capabilities in progress.

Key features

  • 01Register tools, resources, resource templates and prompts with simple handler functions.
  • 02Supports stdio, SSE and streamable-HTTP transports.
  • 03Task-augmented tools for asynchronous, long-running operations with polling.
  • 04Per-session tools, tool filtering and session-scoped notifications.
  • 05Middleware for tool and prompt handlers, plus panic recovery.
  • 06Built-in OAuth protected resource metadata and CORS configuration for HTTP transports.

Use cases

  • Exposing internal APIs or database queries as tools that an LLM agent can call.
  • Building an MCP server in Go to give an AI assistant access to files or system information.
  • Serving per-user tools and data to multiple connected clients over HTTP.
  • Adding MCP support to an existing Go service through its net/http router or other frameworks.

Quick start

  1. 1

    Install the library with go get

    go get github.com/mark3labs/mcp-go
  2. 2

    Create a server file with the Quickstart code (for example a main.go that calls server.ServeStdio)

Things to know

  • The project states it is under active development and some advanced MCP capabilities are still in progress.

Topics

FAQ

What is mcp-go?
A Go implementation of the Model Context Protocol for building MCP servers that expose tools, resources and prompts to LLM applications. mcp-go is a Go library for building servers that follow the Model Context Protocol, a standard for connecting LLM applications to external data sources and tools. It handles protocol details and server management so developers can register tools, resources and prompts with handler functions and start a server.
Is mcp-go free to use? What license does it have?
mcp-go is open source under the MIT license. Check the license terms before using it in commercial products.
Is mcp-go still maintained?
Actively maintained. The last commit to mcp-go was on Oct 22, 2026.
What can I use mcp-go for?
Exposing internal APIs or database queries as tools that an LLM agent can call. Building an MCP server in Go to give an AI assistant access to files or system information. Serving per-user tools and data to multiple connected clients over HTTP. Adding MCP support to an existing Go service through its net/http router or other frameworks.
How do I install mcp-go?
Install the library with go get: go get github.com/mark3labs/mcp-go Create a server file with the Quickstart code (for example a main.go that calls server.ServeStdio)
Where can I get mcp-go?
The source code and installation instructions are on GitHub: https://github.com/mark3labs/mcp-go

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects