You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEPENDENCY_POLICY.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
## How requirements are declared
6
6
7
-
Every runtime dependency is a `>=` floor set to the oldest version that provides what the SDK uses, with no upper bound unless a dependency's next major is known to break the SDK. The one exception is `mcp-types`, the wire-types package released in lockstep with `mcp`: each `mcp` release requires exactly its own version of it, so it is the other half of the SDK rather than an independent constraint.
7
+
Every runtime dependency is a `>=` floor set to the oldest version that provides what the SDK uses, with no upper bound unless a dependency's next major is known to break the SDK. The exceptions are `mcp-client` and `mcp-types`, which release in lockstep with `mcp`: each `mcp` release requires exactly its own version of both, and `mcp-client` requires the matching `mcp-types`. They are parts of the SDK rather than independent constraints.
The `cli` extra adds the `mcp` command-line tool (`mcp dev`, `mcp run`, `mcp install`) on top of the SDK; install plain `mcp` if you don't need it. For one-off commands, `uv run --with "mcp[cli]" mcp ...` works without a project.
48
48
49
+
For a client-only project, use `uv add mcp-client` and `from mcp_client import Client`.
50
+
It includes the client transports and OAuth support without the HTTP server dependencies.
51
+
See [client-only installation](https://py.sdk.modelcontextprotocol.io/get-started/installation/#client-only-installation).
Copy file name to clipboardExpand all lines: VERSIONING.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,11 @@ What a version number of `mcp` promises: which changes can arrive in a minor rel
4
4
5
5
## The version number
6
6
7
-
[Semantic Versioning](https://semver.org/) semantics in [PEP 440](https://peps.python.org/pep-0440/) syntax, taken from the git tag: in `2.X.Y`, **X** (minor) carries new functionality and every non-breaking change, **Y** (patch) carries bug fixes only, and a breaking change to the public API lands only in a new **major**. Pre-releases are cut from `main` as `aN`/`bN`/`rcN`; installers prefer final releases by default, so an unpinned `pip install mcp` stays on a stable release whenever one satisfies your requirement. `mcp` and its wire-types package`mcp-types` release in lockstep, each`mcp`requiring exactly the matching `mcp-types`.
7
+
[Semantic Versioning](https://semver.org/) semantics in [PEP 440](https://peps.python.org/pep-0440/) syntax, taken from the git tag: in `2.X.Y`, **X** (minor) carries new functionality and every non-breaking change, **Y** (patch) carries bug fixes only, and a breaking change to the public API lands only in a new **major**. Pre-releases are cut from `main` as `aN`/`bN`/`rcN`; installers prefer final releases by default, so an unpinned `pip install mcp` stays on a stable release whenever one satisfies your requirement. `mcp`, `mcp-client`, and`mcp-types` release in lockstep. Each`mcp`requires exactly the matching `mcp-client` and `mcp-types`; `mcp-client` also requires exactly the matching `mcp-types`.
8
8
9
9
## The public API
10
10
11
-
The promise covers every name exported by `mcp` and `mcp_types` (their `__all__`), the import paths, signatures, and behavior documented on the [documentation site](https://py.sdk.modelcontextprotocol.io/) and in its [API Reference](https://py.sdk.modelcontextprotocol.io/api/mcp/). It does not cover underscore-prefixed names, undocumented modules, or the wording of log lines, warnings, and exception messages (their types and documented raise conditions are covered). APIs labelled **provisional** (for example the middleware chain) may still change in a minor release; **experimental** APIs are opt-in previews.
11
+
The promise covers every name exported by `mcp`, `mcp_client`, and `mcp_types` (their `__all__`), the import paths, signatures, and behavior documented on the [documentation site](https://py.sdk.modelcontextprotocol.io/) and in its [API Reference](https://py.sdk.modelcontextprotocol.io/api/mcp/). It does not cover underscore-prefixed names, undocumented modules, or the wording of log lines, warnings, and exception messages (their types and documented raise conditions are covered). APIs labelled **provisional** (for example the middleware chain) may still change in a minor release; **experimental** APIs are opt-in previews.
Copy file name to clipboardExpand all lines: docs/get-started/installation.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,10 +21,45 @@ These docs describe **v2**, the current stable release line:
21
21
covers every one. If your *package* depends on `mcp` and isn't ready to migrate, keep a
22
22
`<2` upper bound (for example `mcp>=1.28,<2`) so an unpinned resolve stays on the 1.x line.
23
23
24
+
## Client-only installation
25
+
26
+
```bash
27
+
uv add mcp-client
28
+
```
29
+
30
+
```python
31
+
import anyio
32
+
33
+
from mcp_client import Client
34
+
35
+
36
+
asyncdefmain() -> None:
37
+
asyncwith Client("http://localhost:8000/mcp") as client:
38
+
tools =await client.list_tools()
39
+
for tool in tools.tools:
40
+
print(tool.name)
41
+
42
+
43
+
anyio.run(main)
44
+
```
45
+
46
+
Run this example against an MCP server listening at `http://localhost:8000/mcp`.
47
+
48
+
Use `mcp-client` when you only connect to servers. It includes the client transports,
49
+
OAuth support, and shared protocol machinery without installing Starlette, Uvicorn,
50
+
`sse-starlette`, or `python-multipart`. Import client APIs from `mcp_client`, OAuth
51
+
support from `mcp_client.client.auth`, and protocol types from `mcp_types`.
52
+
53
+
Install `mcp` if you also build servers, use the CLI, or pass a server instance to
54
+
`Client(server)` for in-process testing. Existing `mcp` imports keep working and
55
+
refer to the same client implementation. All three distributions release together;
56
+
`mcp` requires its exact `mcp-client` version, which requires its exact `mcp-types` version.
57
+
24
58
## What gets installed
25
59
26
60
You don't need to know any of this to use the SDK, but if you're wondering what each dependency is for:
27
61
62
+
*`mcp-client`: the client API, transports, OAuth support, and shared protocol machinery, versioned in lockstep with the SDK.
28
63
*`mcp-types`: every protocol type (requests, results, content blocks) as its own package, versioned in lockstep with the SDK. Code that depends on `mcp` imports it through the `mcp.types` alias (every `from mcp.types import ...` in these docs); import `mcp_types` directly only in a project that installs `mcp-types` without the SDK.
29
64
*[`anyio`](https://anyio.readthedocs.io/): the async runtime. The whole SDK is written against anyio, so it runs on either `asyncio` or `trio`.
30
65
*[`pydantic`](https://docs.pydantic.dev/): what every `mcp.types` model is built on, plus all schema generation and validation.
0 commit comments