Thank you for your interest in contributing to the MCP Python SDK! This document provides guidelines and instructions for contributing.
We welcome contributions! These guidelines exist to save everyone time, yours included. Following them means your work is more likely to be accepted.
All pull requests require a corresponding issue. Unless your change is trivial (typo, docs tweak, broken link), create an issue first. Every merged feature becomes ongoing maintenance, so we need to agree something is worth doing before reviewing code. PRs without a linked issue will be closed.
Having an issue doesn't guarantee acceptance. Wait for maintainer feedback or a ready for work label before starting. PRs for issues without buy-in may also be closed.
Use issues to validate your idea before investing time in code. PRs are for execution, not exploration.
Not every contribution will be accepted, even with a working implementation. We prioritize maintainability and consistency over adding capabilities. This is at maintainers' discretion.
These always require an issue first:
- New public APIs or decorators
- Architectural changes or refactoring
- Changes that touch multiple modules
- Features that might require spec changes (these need a SEP first)
Bug fixes for clear, reproducible issues are welcome—but still create an issue to track the fix.
| Label | For | Description |
|---|---|---|
good first issue |
Newcomers | Can tackle without deep codebase knowledge |
help wanted |
Experienced contributors | Maintainers probably won't get to this |
ready for work |
Maintainers | Triaged and ready for a maintainer to pick up |
Issues labeled needs confirmation or needs maintainer action are not ready for work—wait for maintainer input first.
Before starting, comment on the issue so we can assign it to you. This prevents duplicate effort.
- Make sure you have Python 3.10+ installed
- Install uv
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR-USERNAME/python-sdk.git - Install dependencies:
uv sync --frozen --all-extras --dev- Set up pre-commit hooks:
uv tool install pre-commit --with pre-commit-uv --force-reinstall-
Choose the correct branch for your changes:
Change Type Target Branch Example New features, breaking changes mainNew APIs, refactors Security fixes for v1 v1.xCritical patches Bug fixes for v1 v1.xNon-breaking fixes Note:
mainis the v2 development branch. Breaking changes are welcome onmain. Thev1.xbranch receives only security and critical bug fixes. -
Create a new branch from your chosen base branch
-
Make your changes
-
Ensure tests pass:
uv run pytest- Run type checking:
uv run pyright- Run linting:
uv run ruff check .
uv run ruff format .- Update README snippets if you modified example code:
uv run scripts/update_readme_snippets.py- (Optional) Run pre-commit hooks on all files:
pre-commit run --all-files- Submit a pull request to the same branch you branched from
- We use
rufffor linting and formatting - Follow PEP 8 style guidelines
- Add type hints to all functions
- Include docstrings for public APIs
By the time you open a PR, the "what" and "why" should already be settled in an issue. This keeps reviews focused on implementation.
Small PRs get reviewed fast. Large PRs sit in the queue.
A few dozen lines can be reviewed in minutes. Hundreds of lines across many files takes real effort and things slip through. If your change is big, break it into smaller PRs or get alignment from a maintainer first.
- No prior discussion: Features or significant changes without an approved issue
- Scope creep: Changes that go beyond what was discussed
- Misalignment: Even well-implemented features may be rejected if they don't fit the SDK's direction
- Overengineering: Unnecessary complexity for simple problems
- Update documentation as needed
- Add tests for new functionality
- Ensure CI passes
- Address review feedback
Please note that this project is released with a Code of Conduct. By participating in this project you agree to abide by its terms.
By contributing, you agree that your contributions will be licensed under the MIT License.