Welcome, and thanks for your interest in contributing! We're glad you're here.
This document outlines how to contribute effectively to the TypeScript SDK.
Please open an issue before starting work on new features or significant changes. This gives us a chance to align on approach and save you time if we see potential issues.
We'll close PRs for undiscussed features—not because we don't appreciate the effort, but because every merged feature becomes an ongoing maintenance burden for our small team of maintainers. Talking first helps us figure out together whether something belongs in the SDK.
Straightforward bug fixes (a few lines of code with tests demonstrating the fix) can skip this step. For complex bugs that need significant changes, consider opening an issue first.
- New public APIs or classes
- Architectural changes or refactoring
- Changes that touch multiple modules
- Features that might require spec changes (these need a SEP first)
Help us help you:
- Lead with what's broken or what you need
- Include code we can run to see the problem
- Keep it focused—a clear problem statement goes a long way
We're a small team, so issues that include some upfront debugging help us move faster. Low-effort or obviously AI-generated issues will be closed.
| 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, needs repro, or needs design are not ready for work—wait for maintainer input before starting.
Before starting work, comment on the issue so we can assign it to you. This lets others know and avoids duplicate effort.
By the time you open a PR, the "what" and "why" should already be settled in an issue. This keeps PR reviews focused on implementation rather than revisiting whether we should do it at all.
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
Small PRs get reviewed fast. Large PRs sit in the queue.
We can review a few dozen lines in a few minutes. But a PR touching hundreds of lines across many files takes real effort to verify—and things inevitably slip through. If your change is big, break it into a stack of smaller PRs or get clear alignment from a maintainer on your approach in an issue before submitting a large PR.
PRs may be rejected for:
- Lack of prior discussion — Features or significant changes without an approved issue
- Scope creep — Changes that go beyond what was discussed or add unrequested features
- Misalignment with SDK direction — Even well-implemented features may be rejected if they don't fit the SDK's goals
- Insufficient quality — Code that doesn't meet clarity, maintainability, or style standards
- Overengineering — Unnecessary complexity or abstraction for simple problems
- 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
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
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.tsThe v1.x branch contains the stable v1 release. To release a patch:
git checkout v1.x
git pull origin v1.x
# Apply your fix or cherry-pick commits
npm version patch # Bumps version and creates tag (e.g., v1.25.3)
git push origin v1.x --tagsThe tag push automatically triggers the release workflow.
For patching older minor versions that aren't on the v1.x branch:
# 1. Create a release branch from the last release tag
git checkout -b release/1.23 v1.23.1
# 2. Apply your fixes (cherry-pick or manual)
git cherry-pick <commit-hash>
# 3. Bump version and push
npm version patch # Creates v1.23.2 tag
git push origin release/1.23 --tagsThen manually trigger the "Publish v1.x" workflow from GitHub Actions, specifying the tag (e.g., v1.23.2).
v1.x releases are published with release-X.Y npm tags (e.g., release-1.25), not latest. To install a specific minor version:
npm install @modelcontextprotocol/sdk@release-1.25This 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 code contributions will be licensed under the Apache License 2.0. Documentation contributions (excluding specifications) are licensed under CC-BY 4.0. See the LICENSE file for details.