Thank you for your interest in contributing to the MCP Go SDK! We welcome contributions of all kinds, including bug fixes, new features, and documentation improvements. This document outlines the process for contributing to the project.
Make sure you have Go 1.23 or later installed on your machine. You can check your Go version by running:
go version-
Fork the repository
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/mcp-go.git cd mcp-go -
Install the required packages:
go mod tidy
-
Create a new branch.
-
Make your changes.
-
Ensure you have added tests for any new functionality.
-
Run the tests as shown below from the root directory:
go test -v './...'
The
otelsubmodule has its owngo.mod. To test it:cd otel && go test -v './...'
-
Submit a pull request to the main branch.
The repository contains two Go modules:
github.com/mark3labs/mcp-go(root) — core, no OpenTelemetry deps.github.com/mark3labs/mcp-go/otel— OpenTelemetry adapter, has its owngo.mod.
Tag the core module first, then bump otel/go.mod's require line to the new
core tag (replacing the replace directive used during development), then tag
the submodule:
# 1. Tag the core
git tag v0.X.Y
git push origin v0.X.Y
# 2. Bump otel/go.mod and remove the replace directive
cd otel
go mod edit -require=github.com/mark3labs/mcp-go@v0.X.Y -dropreplace=github.com/mark3labs/mcp-go
go mod tidy
# 3. Commit and tag the submodule
git commit -am "otel: pin core to v0.X.Y"
git tag otel/v0.X.Y
git push origin otel/v0.X.YFeel free to reach out if you have any questions or need help either by opening an issue or by reaching out in the Discord channel.