|
| 1 | +# Versioning Policy |
| 2 | + |
| 3 | +The MCP TypeScript SDK follows [Semantic Versioning 2.0.0](https://semver.org/) for every published package. |
| 4 | + |
| 5 | +## Packages and Version Groups |
| 6 | + |
| 7 | +The v2 SDK is a monorepo. Versions are managed with [Changesets](https://github.com/changesets/changesets) (`.changeset/`): |
| 8 | + |
| 9 | +- `@modelcontextprotocol/core`, `client`, `server`, `server-legacy` and `codemod` form a **fixed group** and always release together with the same version. |
| 10 | +- The framework integrations `@modelcontextprotocol/node`, `express`, `hono` and `fastify` are versioned through Changesets alongside the fixed group: they bump whenever their `@modelcontextprotocol/server` peer range has to move, and independently for their own changes. |
| 11 | +- `@modelcontextprotocol/core-internal` is private and carries no compatibility promise; the `@modelcontextprotocol/core/internal` entry point is likewise not covered by this policy and may change in any release. |
| 12 | +- The `v1.x` branch continues to publish `@modelcontextprotocol/sdk` 1.x under the same rules (patch releases on `release-X.Y` npm tags; see `CONTRIBUTING.md`). |
| 13 | + |
| 14 | +## Version Format |
| 15 | + |
| 16 | +`MAJOR.MINOR.PATCH` |
| 17 | + |
| 18 | +- **MAJOR**: Incremented for breaking changes (see below). |
| 19 | +- **MINOR**: Incremented for new features that are backward-compatible. |
| 20 | +- **PATCH**: Incremented for backward-compatible bug fixes. |
| 21 | + |
| 22 | +## What Constitutes a Breaking Change |
| 23 | + |
| 24 | +The following changes are considered breaking and require a major version bump: |
| 25 | + |
| 26 | +- Removing or renaming a public API export (class, function, type, or constant). |
| 27 | +- Changing the signature of a public function or method in a way that breaks existing callers (removing parameters, changing required/optional status, changing types). |
| 28 | +- Removing or renaming a public type or interface field. |
| 29 | +- Changing the behavior of an existing API in a way that breaks documented contracts. |
| 30 | +- Dropping support for a Node.js LTS version. |
| 31 | +- Removing support for a transport type. |
| 32 | +- Dropping support for an MCP protocol revision the SDK previously negotiated (see `docs/protocol-versions.md`). |
| 33 | + |
| 34 | +The following are **not** considered breaking: |
| 35 | + |
| 36 | +- Adding new optional parameters to existing functions. |
| 37 | +- Adding new exports, types, or interfaces. |
| 38 | +- Adding new optional fields to existing types. |
| 39 | +- Bug fixes that correct behavior to match documented intent. |
| 40 | +- Internal refactoring that does not affect the public API. |
| 41 | +- Adding support for new MCP spec revisions or features. |
| 42 | +- Changes to dev dependencies or build tooling. |
| 43 | + |
| 44 | +## How Breaking Changes Are Communicated |
| 45 | + |
| 46 | +1. **Changelog**: Every consumer-facing change ships with a changeset; the per-package `CHANGELOG.md` and the GitHub release for each package tag document breaking changes with migration instructions. |
| 47 | +2. **Deprecation**: When feasible, APIs are deprecated for at least one minor release before removal using `@deprecated` JSDoc annotations, which surface warnings through TypeScript tooling and editors. Protocol features the specification deprecates stay available for as long as the specification keeps them. |
| 48 | +3. **Migration guide**: Major version releases include a migration guide (see `docs/migration/`) and, where practical, a codemod (`@modelcontextprotocol/codemod`). |
| 49 | +4. **PR labels**: Pull requests containing breaking changes are labeled with `breaking change`. |
0 commit comments