Max Isbey
ec5b2258c9
Cut import and startup cost with deferred model builds and lazy imports
...
Every import path now pays only for what it uses, with no public API
added or removed:
- The protocol models (mcp.types / mcp_types, incl. the JSON-RPC
envelopes and the generated per-version wire packages) build their
pydantic validators on first use instead of at import (defer_build),
through one shared private base class. First-use builds are
serialised behind a single process-wide lock, since released pydantic
does not make concurrent first use of a deferred model thread-safe;
this also fixes a pre-existing concurrent-first-use failure that
reproduces on main.
- `import mcp` binds the client/server names lazily on first attribute
access (PEP 562) instead of importing both stacks eagerly, and the
client no longer imports the server, so client entry points stop
loading the server, the web stack, httpx2 and cryptography.
- The web application stack (starlette's app machinery, sse_starlette,
uvicorn) loads with the app builders that use it, and each protocol
version's wire package loads on the first message parsed for that
version rather than both loading at import.
On the fresh-interpreter harness `import mcp` is ~0.4x of v1 (main is
~1.6x), the client entry points ~0.6x of v1, `import mcp.server.mcpserver`
~0.7x, and time-to-ready / stdio cold start land at parity with v1. RSS
after `import mcp` is 19 MiB (v1 43.5, main 57). Steady-state per-call
latency is unchanged.
Observable-but-incidental differences (removed incidental namespace
bindings, deeper submodules no longer imported as a side effect of a
bare `import mcp`, get_type_hints needing localns= for a documented set
of callables, pre-first-use introspection) are catalogued in
docs/migration.md; ratchet tests pin the import footprints and the
concurrent-first-use safety.
2026-08-03 15:06:11 +00:00
Max
78e6fbb7e4
Serve v2 docs at the site root, with permanent per-major paths ( #3176 )
2026-07-28 13:57:21 +01:00
Max
b7c9a916d6
Add mcp.types as a permanent alias for mcp_types ( #3190 )
2026-07-27 23:47:04 +01:00
Max
b9422f1c9b
Make the per-version wire packages private (mcp_types._v*) ( #3191 )
2026-07-27 22:16:48 +01:00
Max
3212591946
Stop advertising MCP_* env vars for MCPServer settings; drop pydantic-settings ( #3170 )
2026-07-25 23:22:27 +01:00
Marcelo Trylesinski
2713b53b12
Replace httpx and httpx-sse with httpx2 ( #2972 )
...
CI / checks (push) Failing after 1s
CI / all-green (push) Has been cancelled
Co-authored-by: Max Isbey <224885523+maxisbey@users.noreply.github.com >
2026-07-14 17:05:08 +01:00
Marcelo Trylesinski
4fc8882c02
docs: replace MkDocs with Zensical ( #3073 )
...
Co-authored-by: Claude <noreply@anthropic.com >
Co-authored-by: Max Isbey <224885523+maxisbey@users.noreply.github.com >
2026-07-10 12:48:46 +01:00
Max
6d2e908f2b
docs: pin mkdocs<2 and silence the mkdocs-material advisory banner in CI ( #3072 )
2026-07-07 13:45:30 +01:00
Max
2359b40285
docs: modernize the site theme ( #3057 )
2026-07-02 16:17:33 +01:00
Max
220d362112
docs: restructure into topical sections and add the four most-asked-for pages ( #3044 )
2026-07-01 21:06:04 +01:00
Max
f2e63c979a
Promote the v2 README to README.md ahead of the first v2 beta ( #3014 )
2026-06-29 12:01:54 +01:00
Max
411a6d3980
Rebuild the docs around tested examples; shrink README.v2.md to a pitch ( #2978 )
2026-06-26 12:49:19 +02:00
Max
4caa41f6d5
Add story-style examples suite (27 stories + harness + CI) ( #2957 )
2026-06-26 12:02:27 +02:00
Max
603342f0fe
Set Development Status classifier to Production/Stable ( #2975 )
2026-06-25 23:47:31 +02:00
Marcelo Trylesinski
0ee7f1b293
Split protocol types into a standalone mcp-types package ( #2973 )
2026-06-25 19:18:38 +02:00
Max
f226d00d0a
Client-side 2026-07-28 support: .discover()/.adopt() + Client(mode=); request-metadata green ( #2950 )
2026-06-25 16:09:23 +02:00
Marcelo Trylesinski
4573e4ac33
Deprecate roots, sampling, and logging methods per SEP-2577 ( #2926 )
2026-06-20 18:25:41 +02:00
Max
65be5a7147
Protocol types for 2026-07-28: superset monolith, committed per-version packages, and wire-method maps ( #2849 )
2026-06-16 17:40:14 +01:00
Max
e196857bc9
Prepare release machinery for v2 pre-releases ( #2831 )
2026-06-11 09:03:27 +01:00
Max
5d826490b6
[v2] Dispatcher/ServerRunner receive-path swap — replaces BaseSession ( #2710 )
2026-06-09 12:58:47 +01:00
Max
b478bff56d
Remove the unsupported WebSocket transport ( #2785 )
2026-06-08 12:05:27 +01:00
Max
24725633f1
test: interaction-model end-to-end suite with a requirements manifest ( #2691 )
2026-05-28 18:48:30 +00:00
Max
f4753440da
ci: deploy docs to py.sdk.modelcontextprotocol.io via Pages artifact (v1 at /, v2 at /v2/) ( #2634 )
2026-05-18 15:28:13 +01:00
Max
2b0da5631a
build: pin PEP 517 build dependencies ( #2547 )
2026-05-07 17:32:30 +01:00
Max
941089e06a
docs: modernize development guidelines and rename to AGENTS.md ( #2413 )
2026-04-13 12:50:04 +01:00
Marcelo Trylesinski
37891f42a4
Add basic OpenTelemetry tracing for client and server requests ( #2381 )
2026-03-31 20:33:33 +00:00
Marcelo Trylesinski
e6235d1667
Propagate contextvars.Context through anyio streams without modifying SessionMessage ( #2298 )
2026-03-31 12:49:38 -04:00
Marcelo Trylesinski
98f8ef295a
Restrict httpx version to <1.0.0 ( #2345 )
...
Co-authored-by: Max Isbey <224885523+maxisbey@users.noreply.github.com >
2026-03-25 22:29:13 +00:00
Jonathan Hefner
5388bea53a
docs: generate hierarchical per-module API reference pages ( #2103 )
2026-03-18 18:15:17 +00:00
Max Isbey
e1fd62e0f3
fix: close all memory stream ends in client transport cleanup ( #2266 )
2026-03-13 14:43:54 +00:00
Jonathan Hefner
0fe16dd5fd
fix: silence mkdocs social plugin warnings in strict mode ( #2109 )
2026-02-19 23:12:51 +01:00
Max Isbey
8f669a77e3
fix: explicitly load required pytest plugins in addopts ( #2055 )
2026-02-13 18:25:10 +00:00
Aaron Abbott
f049c8e5c6
Fix leaked anyio streams in streamable_http ( #1991 )
...
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com >
2026-02-11 14:52:07 +00:00
Max Isbey
d3133ae6ce
chore: update author metadata to LF Projects ( #1992 )
2026-02-04 11:01:33 +00:00
Marcelo Trylesinski
74f41ff1ae
Add more maintainers to the PyPI metadata ( #1976 )
2026-02-03 16:19:56 +00:00
Max Isbey
2137c8fbdb
fix: revert README to v1.x documentation on main ( #1971 )
...
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com >
2026-01-29 20:03:01 +00:00
Marcelo Trylesinski
65c614e48e
Rename FastMCP to MCPServer ( #1951 )
2026-01-25 14:45:52 +01:00
Max Isbey
a7ddfdae07
ci: add strict-no-cover to detect unnecessary coverage pragmas ( #1897 )
2026-01-23 21:00:20 +01:00
Marcelo Trylesinski
a1d330de9f
Proper handle extra data in MCP objects ( #1937 )
2026-01-23 15:35:23 +01:00
Marcelo Trylesinski
f0ab53e194
Add meta to Client methods ( #1923 )
2026-01-22 14:50:39 +01:00
Marcelo Trylesinski
bcb07c2b25
refactor: flatten the methods in Client ( #1914 )
2026-01-20 13:12:07 +01:00
Rin
0f9a41d777
chore: include cli and ws extras in dev environment ( #1905 )
...
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com >
2026-01-19 14:53:08 +01:00
Marcelo Trylesinski
5fdd48a0d3
Completely drop RootModel from types module ( #1910 )
2026-01-19 14:29:15 +01:00
Felix Weinberger
d41d0c0128
chore: add D212 lint rule to enforce Google-style docstrings ( #1892 )
2026-01-16 16:10:52 +00:00
Marcelo Trylesinski
3ffe142e9a
Support Python 3.14 ( #1834 )
2026-01-07 16:28:23 +00:00
Marcelo Trylesinski
1fd557afdc
Add type checker to examples/client ( #1837 )
2026-01-07 17:08:18 +01:00
Victorien
116c13e2c6
Refactor func_metadata() implementation ( #1496 )
2025-11-13 20:21:15 +00:00
Max Isbey
89e9c43acf
Get baseline 100% clean coverage ( #1553 )
2025-11-11 14:09:32 +01:00
Luca Chang
f161149680
Implement RFC 7523 JWT flows ( #1247 )
...
Co-authored-by: Yann Jouanin <yann.jouanin@valueandco.com >
2025-10-29 16:48:08 +00:00
Max Isbey
3e86edfb2f
fix: Replace arbitrary sleeps with active server readiness checks in tests ( #1527 )
...
Co-authored-by: Claude <noreply@anthropic.com >
2025-10-28 21:42:33 +00:00