We welcome contributions to the Model Context Protocol TypeScript SDK! This document outlines the process for contributing to the project.
This repository has two main branches:
main– v2 of the SDK (currently in development). This is a monorepo with split packages.v1.x– stable v1 release. Bug fixes and patches for v1 should target this branch.
Which branch should I use as a base?
- For new features or v2-related work: base your PR on
main - For v1 bug fixes or patches: base your PR on
v1.x
This project uses pnpm as its package manager. If you don't have pnpm installed, enable it via corepack (included with Node.js 16.9+):
corepack enableThen:
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR-USERNAME/typescript-sdk.git - Install dependencies:
pnpm install - Build the project:
pnpm build:all - Run tests:
pnpm test:all
- Create a new branch for your changes (based on
mainorv1.xas appropriate) - Make your changes
- Run
pnpm lint:allto ensure code style compliance - Run
pnpm test:allto verify all tests pass - Submit a pull request
- Follow the existing code style
- Include tests for new functionality
- Update documentation as needed
- Keep changes focused and atomic
- Provide a clear description of changes
See examples/server/README.md and examples/client/README.md for a full list of runnable examples.
Quick start:
# Run a server example
pnpm --filter @modelcontextprotocol/examples-server exec tsx src/simpleStreamableHttp.ts
# Run a client example (in another terminal)
pnpm --filter @modelcontextprotocol/examples-client exec tsx src/simpleStreamableHttp.tsThis project follows our Code of Conduct. Please review it before contributing.
- Use the GitHub issue tracker
- Search existing issues before creating a new one
- Provide clear reproduction steps
Please review our Security Policy for reporting security vulnerabilities.
By contributing, you agree that your contributions will be licensed under the MIT License.