Commit Graph

97 Commits

Author SHA1 Message Date
Max Isbey 801095acad Flag removed modules, update dependency files, add a batch-test harness
Three additions to mcp-codemod, closing the gaps a comparison with the
TypeScript codemod surfaced:

Imports of module namespaces v2 deleted outright (the experimental tasks
namespaces, the WebSocket transports, `mcp.shared.progress`) are now
marked with replacement guidance. A new ratchet test freezes the 107
public modules v1 shipped and asserts every one imports on v2, is
renamed, or is in the removed table, so the whole v1 module namespace is
provably accounted for.

The codemod now also updates the `mcp` requirement in `pyproject.toml`
(PEP 621 tables and dependency groups) and `requirements*.txt` to
`>=2,<3` -- only where the current constraint cannot accept any v2
release, and only the version specifier: name, extras, environment
marker, and spacing keep the user's spelling. Poetry tables and the
removed `ws` extra are marked instead of guessed at, under the same
`# mcp-codemod:` contract as source markers.

`scripts/codemod-batch-test/` runs the codemod against pinned real
repositories and audits the marker contract end to end: it type-checks
the pristine clone against the latest v1 and the migrated copy against
this workspace's v2 with identical pyright settings, then requires every
error that exists only on the migrated side to sit next to a marker.
Across the four repos in the manifest every migration-surface error is
covered, and the audit caught two real bugs now fixed here: `Context`
imported from the old `.server` submodule is rehomed to the package (the
submodule holds the name at runtime, but a type checker treats a
non-re-exported name as private), and `request_context` on a receiver
the pre-pass proved holds a lowlevel `Server` is flagged again --
receiver-matched, so the live `ctx.request_context` idiom stays
untouched.
2026-07-01 12:08:22 +00:00
Max Isbey 8900f2527c Add mcp-codemod, an automated v1 to v2 migration tool
A new `mcp-codemod` workspace package (`uvx mcp-codemod v1-to-v2 ./src`)
that rewrites every v1 -> v2 change whose meaning is unambiguous from the
file alone, and inserts a `# mcp-codemod:` comment above every site it
recognized but would not guess at. Built on libCST.

Names are resolved through each file's imports, never matched as text, so
an aliased import or an unrelated symbol that shares a name with an SDK
one is never touched. The camelCase to snake_case rename is restricted to
the field names v1's `mcp.types` actually declared. Anything whose correct
rewrite depends on information that is not in the file -- the lowlevel
decorator to `on_*` relocation, the transport keywords on the `MCPServer`
constructor -- is left exactly as written and marked instead, so the
remaining work is one grep. Re-running on the output is a no-op.

The mapping tables are pinned against the installed v2 package by ratchet
tests so they cannot silently drift: every rename target must resolve,
every removed API must be provably absent, and no flagged constructor
keyword may survive on `MCPServer.__init__`. Measured against the example
files that exist on both `v1.x` and `main` (whose diff is the hand-written
migration), the codemod fully reproduces 13 of the 51 with a real
migration diff, improves 35 more, and makes none worse.

Also adds an "Automated migration" section to docs/migration.md, a mention
of the tool in README.v2.md, and the package to the publish workflow's
build step (the PyPI project and its trusted publisher must exist before a
release is tagged with this in it).
2026-07-01 12:08:22 +00:00
Max 4caa41f6d5 Add story-style examples suite (27 stories + harness + CI) (#2957) 2026-06-26 12:02:27 +02:00
Marcelo Trylesinski 0ee7f1b293 Split protocol types into a standalone mcp-types package (#2973) 2026-06-25 19:18:38 +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 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 8cc187fac0 Remove Tasks (SEP-1686) from the SDK (#2714) 2026-06-02 18:27:05 +02:00
Max 24725633f1 test: interaction-model end-to-end suite with a requirements manifest (#2691) 2026-05-28 18:48:30 +00:00
Max 2b0da5631a build: pin PEP 517 build dependencies (#2547) 2026-05-07 17:32:30 +01:00
dependabot[bot] 8f806da611 chore(deps): bump cryptography from 46.0.5 to 46.0.7 in the uv group across 1 directory (#2406)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-12 12:48:13 +00:00
dependabot[bot] d5b9155f14 chore(deps): bump requests from 2.32.5 to 2.33.0 in the uv group across 1 directory (#2350)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-31 17:11:12 -04:00
Marcelo Trylesinski 37891f42a4 Add basic OpenTelemetry tracing for client and server requests (#2381) 2026-03-31 20:33:33 +00: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
dependabot[bot] 2c73a2a881 chore(deps): bump black from 25.1.0 to 26.3.1 in the uv group across 1 directory (#2290)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-13 10:39:56 +00:00
Jonathan Hefner 0fe16dd5fd fix: silence mkdocs social plugin warnings in strict mode (#2109) 2026-02-19 23:12:51 +01:00
dependabot[bot] d6d3ad9a7c chore(deps-dev): bump pillow from 12.1.0 to 12.1.1 in the uv group across 1 directory (#2036)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-11 14:57:37 +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
dependabot[bot] e39038d879 chore(deps): bump cryptography from 45.0.5 to 46.0.5 in the uv group across 1 directory (#2031)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-11 14:26:16 +01:00
dependabot[bot] 1a943ad085 chore(deps): bump the uv group across 1 directory with 2 updates (#1961)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-06 09:07:49 +00:00
Max Isbey 1b5287c727 fix: remove unused requests dependency from simple-chatbot example (#1958) 2026-01-26 14:02:11 +00: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
Max Isbey 213cf993ca Add conformance testing CI pipeline (#1915) 2026-01-21 16:04:35 +00: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 3ffe142e9a Support Python 3.14 (#1834) 2026-01-07 16:28:23 +00:00
Felix Weinberger 281fd4765e Add SSE polling support (SEP-1699) (#1654) 2025-12-02 11:44:49 +00:00
Max Isbey c92bb2f7ff SEP-1686: Tasks (#1645) 2025-11-28 18:51:58 +00:00
Paul Carleton 998f0ee4db [auth][conformance] add conformance auth client (#1640)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com>
2025-11-24 13:52:04 +00: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
Felix Weinberger da4fce2195 Add everything-server for comprehensive MCP conformance testing (#1587) 2025-11-09 13:45:37 +00:00
Cole Murray 3a9f118e34 Update Starlette to 0.49.1 in uv.lock (#1559) 2025-11-03 08:15:08 +00: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
Luca Chang c733eec5d9 Make client examples workspaces to reflect package code (#1466) 2025-10-17 17:13:39 +01:00
Felix Weinberger 7a933fe5da Fix workspace configuration error with structured_output_lowlevel.py (#1471)
Co-authored-by: lorenss-m <saeclmusic@gmail.com>
2025-10-13 15:53:46 +01:00
Max Isbey 4fb975c6dc feat: add paginated list decorators for prompts, resources, and tools (#1286)
Co-authored-by: Claude <noreply@anthropic.com>
2025-09-23 14:58:06 +01:00
David Soria Parra c3717e7ad3 Fix context injection for resources and prompts (#1336)
Main branch checks / checks (push) Failing after 0s
2025-09-11 14:30:06 +01:00
David Soria Parra 0926613714 Update dependencies and fix type issues (#1268)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2025-08-14 10:40:47 +01:00
Marcelo Trylesinski c7671e470c Add pyright strict mode on the whole project (#1254) 2025-08-11 18:56:37 +01:00
Felix Weinberger e0336213e8 Improve child process termination on POSIX & Windows (#1078)
Co-authored-by: jingx8885 <jingxu8885@qq.com>
Co-authored-by: Surya Prakash Susarla <susarla.surya.prakash.1998@gmail.com>
2025-07-08 15:04:06 +01:00
Marcelo Trylesinski 3fa7bc7b61 tests: add lowest dependency tests (#1067)
Co-authored-by: ihrpr <inna@anthropic.com>
2025-07-06 09:38:56 +02:00
Inna Harper adf327164a Embed code snippets for README from executable examples (#1055) 2025-07-04 17:25:54 +01:00
Marcelo Trylesinski 9301924f44 chore: bump ruff (#1085) 2025-07-04 09:01:17 +01:00
Mohamed Amine Zghal 7942184336 Bump Pydantic in the lockfile (#1041) 2025-06-27 17:41:17 +02:00
Inna Harper 0323831b01 unpin jsonschema version (#1037) 2025-06-26 13:28:15 +01:00
bhosmer-ant c8bbfc034d Add schema validation to lowlevel server (#1005) 2025-06-25 09:23:49 -04:00