Skip to content

Commit d6a15f6

Browse files
committed
[v1.x] Move the v1.x docs to /v1/ and mark v1.x as the maintenance line
With v2 becoming the stable release, v1.x moves from the site root to /v1/ and stops deploying the site itself: the combined site is built and deployed from main, which builds this branch's docs into /v1/ via the new scripts/docs/build.sh. A `docs` CI job runs that same script, so a change that breaks the v1 docs fails on this branch rather than at main's next deploy. site_url and the package's Documentation URL move to /v1/ so canonical links, the sitemap, and llms.txt point at where these pages are actually served. The README and landing page now describe v1.x as the maintenance line and send new users to the v2 docs, and every install line pins `mcp<2` so a reader following these docs stays on the 1.x line now that an unpinned install selects 2.x.
1 parent c0c5a9d commit d6a15f6

9 files changed

Lines changed: 58 additions & 153 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/shared.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,20 @@ jobs:
7676

7777
- name: Check doc snippets are up to date
7878
run: uv run --frozen scripts/update_doc_snippets.py --check
79+
80+
# The published site is built and deployed from main, which builds this
81+
# branch's docs (via scripts/docs/build.sh) under /v1/; this branch has no
82+
# deploy workflow of its own. This job runs that same script so a change
83+
# that breaks the v1 docs fails here rather than at main's next deploy.
84+
docs:
85+
runs-on: ubuntu-latest
86+
steps:
87+
- uses: actions/checkout@v5
88+
89+
- uses: astral-sh/setup-uv@v7
90+
with:
91+
enable-cache: true
92+
version: 0.9.5
93+
94+
- name: Build docs
95+
run: bash scripts/docs/build.sh

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313

1414
</div>
1515

16-
> **This documents v1.x, the stable release line of the MCP Python SDK. v2 is in alpha.**
16+
> **This documents v1.x, the maintenance line of the MCP Python SDK.** v2 is the current stable release: `pip install mcp` now installs 2.x. See the [v2 documentation](https://py.sdk.modelcontextprotocol.io/) and the [migration guide](https://py.sdk.modelcontextprotocol.io/migration/) for what changed and how to upgrade.
1717
>
18-
> v2 pre-releases are published to PyPI as `2.0.0aN`. Installers never select a pre-release unless you opt in (for example `pip install mcp==2.0.0a1`), so v1.x users are unaffected. **If your package depends on `mcp`, add a `<2` upper bound to your version constraint (for example `mcp>=1.27,<2`) before the stable v2 release lands.** See the [v2 documentation](https://github.com/modelcontextprotocol/python-sdk/blob/main/README.v2.md) and the [migration guide](https://github.com/modelcontextprotocol/python-sdk/blob/main/docs/migration.md) for what's changing.
19-
>
20-
> v1.x remains recommended for production use. It is in maintenance mode and continues to receive critical bug fixes and security patches.
18+
> **Staying on v1.x?** Keep a `<2` upper bound on your requirement (for example `mcp>=1.28,<2`) so an unpinned resolve stays on the 1.x line. v1.x remains supported for existing deployments and continues to receive critical bug fixes and security patches; its documentation is at <https://py.sdk.modelcontextprotocol.io/v1/>.
2119
2220
<!-- omit in toc -->
2321
## Table of Contents
@@ -38,7 +36,7 @@
3836
[python-badge]: https://img.shields.io/pypi/pyversions/mcp.svg
3937
[python-url]: https://www.python.org/downloads/
4038
[docs-badge]: https://img.shields.io/badge/docs-python--sdk-blue.svg
41-
[docs-url]: https://modelcontextprotocol.github.io/python-sdk/
39+
[docs-url]: https://py.sdk.modelcontextprotocol.io/v1/
4240
[protocol-badge]: https://img.shields.io/badge/protocol-modelcontextprotocol.io-blue.svg
4341
[protocol-url]: https://modelcontextprotocol.io
4442
[spec-badge]: https://img.shields.io/badge/spec-spec.modelcontextprotocol.io-blue.svg
@@ -69,13 +67,13 @@ If you haven't created a uv-managed project yet, create one:
6967
Then add MCP to your project dependencies:
7068

7169
```bash
72-
uv add "mcp[cli]"
70+
uv add "mcp[cli]<2"
7371
```
7472

7573
Alternatively, for projects using pip for dependencies:
7674

7775
```bash
78-
pip install "mcp[cli]"
76+
pip install "mcp[cli]<2"
7977
```
8078

8179
### Running the standalone MCP development tools
@@ -143,7 +141,7 @@ _Full example: [examples/snippets/servers/fastmcp_quickstart.py](https://github.
143141
You can install this server in [Claude Code](https://docs.claude.com/en/docs/claude-code/mcp) and interact with it right away. First, run the server:
144142

145143
```bash
146-
uv run --with mcp examples/snippets/servers/fastmcp_quickstart.py
144+
uv run --with "mcp<2" examples/snippets/servers/fastmcp_quickstart.py
147145
```
148146

149147
Then add it to Claude Code:
@@ -177,8 +175,8 @@ The [Model Context Protocol (MCP)](https://modelcontextprotocol.io) lets you bui
177175
- [Low-Level Server](docs/low-level-server.md) -- direct handler registration for advanced use cases
178176
- [Protocol Features](docs/protocol.md) -- MCP primitives, server capabilities
179177
- [Testing](docs/testing.md) -- in-memory transport testing with pytest
180-
- [API Reference](https://modelcontextprotocol.github.io/python-sdk/api/)
181-
- [Experimental Features (Tasks)](https://modelcontextprotocol.github.io/python-sdk/experimental/tasks/)
178+
- [API Reference](https://py.sdk.modelcontextprotocol.io/v1/api/)
179+
- [Experimental Features (Tasks)](https://py.sdk.modelcontextprotocol.io/v1/experimental/tasks/)
182180
- [Model Context Protocol documentation](https://modelcontextprotocol.io)
183181
- [Model Context Protocol specification](https://modelcontextprotocol.io/specification/latest)
184182
- [Officially supported servers](https://github.com/modelcontextprotocol/servers)

docs/index.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# MCP Python SDK
22

3-
!!! tip "Looking for the upcoming v2?"
4-
See the [v2 development documentation](https://py.sdk.modelcontextprotocol.io/v2/).
3+
!!! tip "You are viewing the v1.x maintenance-line documentation"
4+
v2 is the current stable release: its documentation is at
5+
<https://py.sdk.modelcontextprotocol.io/>. Staying on v1.x for now? Pin `mcp<2`
6+
(for example `mcp>=1.28,<2`) so an unpinned install doesn't move you to 2.x.
57

68
The **Model Context Protocol (MCP)** allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction.
79

@@ -48,7 +50,7 @@ if __name__ == "__main__":
4850
Run the server:
4951

5052
```bash
51-
uv run --with mcp server.py
53+
uv run --with "mcp<2" server.py
5254
```
5355

5456
Then open the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) and connect to `http://localhost:8000/mcp`:
@@ -74,5 +76,5 @@ Full API documentation is available in the [API Reference](api.md).
7476
## llms.txt
7577

7678
Reading with an LLM? This documentation is also published in the [llms.txt](https://llmstxt.org/) format:
77-
[llms.txt](https://py.sdk.modelcontextprotocol.io/llms.txt) is an index of the pages, and
78-
[llms-full.txt](https://py.sdk.modelcontextprotocol.io/llms-full.txt) contains every page in a single file.
79+
[llms.txt](https://py.sdk.modelcontextprotocol.io/v1/llms.txt) is an index of the pages, and
80+
[llms-full.txt](https://py.sdk.modelcontextprotocol.io/v1/llms-full.txt) contains every page in a single file.

docs/installation.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# Installation
22

3-
The Python SDK is available on PyPI as [`mcp`](https://pypi.org/project/mcp/) so installation is as simple as:
3+
The Python SDK is available on PyPI as [`mcp`](https://pypi.org/project/mcp/). These docs describe the **v1.x maintenance line**;
4+
the `<2` bound keeps you on it now that `pip install mcp` selects the 2.x stable release by default (the
5+
[v2 documentation](https://py.sdk.modelcontextprotocol.io/) covers that line):
46

57
=== "pip"
68

79
```bash
8-
pip install mcp
10+
pip install "mcp<2"
911
```
1012
=== "uv"
1113

1214
```bash
13-
uv add mcp
15+
uv add "mcp<2"
1416
```
1517

1618
The following dependencies are automatically installed:

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ strict: true
55
repo_name: modelcontextprotocol/python-sdk
66
repo_url: https://github.com/modelcontextprotocol/python-sdk
77
edit_uri: edit/v1.x/docs/
8-
site_url: https://py.sdk.modelcontextprotocol.io/
8+
site_url: https://py.sdk.modelcontextprotocol.io/v1/
99

1010
# TODO(Marcelo): Add Anthropic copyright?
1111
# copyright: © Model Context Protocol 2025 to present

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ bump = true
9191

9292
[project.urls]
9393
Homepage = "https://modelcontextprotocol.io"
94-
Documentation = "https://py.sdk.modelcontextprotocol.io/"
94+
Documentation = "https://py.sdk.modelcontextprotocol.io/v1/"
9595
Repository = "https://github.com/modelcontextprotocol/python-sdk"
9696
Issues = "https://github.com/modelcontextprotocol/python-sdk/issues"
9797

scripts/build-docs.sh

Lines changed: 0 additions & 76 deletions
This file was deleted.

scripts/docs/build.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Build the v1.x documentation into ./site.
4+
#
5+
# This is the single build recipe for this branch's docs. The combined site
6+
# is assembled and deployed from main, which fetches this branch and runs this
7+
# script to build it under /v1/ (main's scripts/build-docs.sh picks
8+
# scripts/docs/build.sh from each branch it builds). The `docs` CI job on
9+
# this branch runs the same script, so what CI checks is what gets published.
10+
#
11+
# Usage:
12+
# scripts/docs/build.sh
13+
#
14+
set -euo pipefail
15+
16+
cd "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
17+
18+
uv sync --frozen --group docs
19+
NO_MKDOCS_2_WARNING=1 uv run --frozen --no-sync mkdocs build --site-dir site

0 commit comments

Comments
 (0)