Contributing
Guidelines for contributing to the mcp-golang project
Development Guide
This document provides a step-by-step guide for contributing to the mcp-golang project. By no means is it complete, but it should help you get started.
Development Setup
To set up your development environment, follow these steps:
Prerequisites
- Go 1.19 or higher
- Git
Local Development
- Clone the repository:
- Install dependencies:
- Run tests:
Project Structure
The project is organized into several key packages:
server/
: Core server implementationtransport/
: Transport layer implementations (stdio, SSE)protocol/
: MCP protocol implementationexamples/
: Example implementationsinternal/
: Internal utilities and helpers
Implementation Guidelines
Creating a Custom Transport
To implement a custom transport, create a struct that implements the Transport
interface.
If your transport is not part of the spec then you can add it as an experimental feature.
Before you implement the transport, you should have a good understanding of the MCP protocol. Take a look at https://spec.modelcontextprotocol.io/specification/
Testing
Unit Tests
All new functions should have unit tests where possible. We currently use testify for this. Each test should explain its purpose and expected behavior. E.g.
Integration Tests
Run integration tests that use the actual transport layers:
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run existing tests
- Submit a pull request
Pull Request Guidelines
- Keep changes focused and atomic
- Follow existing code style
- Include tests for new functionality
- Update documentation as needed
- Add yourself to CONTRIBUTORS.md
Adding docs
Prerequisite: Please install Node.js (version 19 or higher) before proceeding.
Follow these steps to install and run Mintlify on your operating system:
Step 1: Install Mintlify:
Step 2: Navigate to the docs directory (where the mint.json
file is located) and execute the following command:
A local preview of your documentation will be available at http://localhost:3000
.
When your PR merges into the main branch, it will be deployed automatically.
Getting Help
- Check existing GitHub issues
- Join our Discord community
- Read the Model Context Protocol specification
Was this page helpful?