- Home
- MCP servers
- MCP-Go SDK
MCP-Go SDK
- go
3
GitHub Stars
go
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
The MCP-Go SDK provides the building blocks to create MCP-compatible tools and servers in Go, enabling seamless integration with AI applications that use Model Communication Protocol workflows.
How to use
This SDK demonstrates how to implement an MCP Tool in Go and run a lightweight MCP server that can be connected by an MCP client. Use the example EchoTool in the repository as a reference: it shows how to define a tool, expose a schema for parameters, implement execution logic, and run a server that communicates via a stdio transport. You can adapt the EchoTool pattern to build your own tools and register them with the server, then start the server to handle incoming requests from MCP clients.
How to install
Prerequisites: ensure you have Go installed on your development machine. If you do not have Go installed, follow the instructions for your operating system on the official Go website. Once Go is installed, you can set up a local MCP Go project that uses the SDK.
Step 1
Install Go from the official source for your OS and verify the installation by running go version in your terminal.
Step 2 Create or clone a Go project that will implement MCP tools and servers, following the examples provided in the SDK repository.
Step 3 Write your tool by implementing the MCP Tool interface as shown in the Core Concepts section of the SDK documentation, then create an MCP server using the stdio transport for command-line usage.
Step 4 Run your Go module to start the MCP server; the EchoTool example shows how to register your tool with the server and begin handling requests from an MCP client.
Additional sections
Configuration: The README provides an example of how to configure an MCP server for Cursor IDE using a JSON file located at .cursor/mcp.json in your project root. The example shows how to map a tool identifier to a command, arguments, and environment variables.
Notes on transport: By default, the SDK includes a stdio transport for command-line tools, which allows a simple local workflow where the MCP server communicates with the client through standard input and output streams.
Security and environment: When using stdio transports, consider securing the execution environment and carefully managing any environment variables that affect runtime behavior. The example configuration demonstrates how to supply environment settings for the server process.