Files
Max Isbey 8c88d2792b Tighten the public API surface: root exports, listen types, dead-code removal
Root `mcp` package: export `MCPServer` (alongside the existing `Client`,
so `from mcp import MCPServer, Client` works) and `NoBackChannelError`;
drop the v1-carryover `SamplingRole` alias (`mcp.types.Role`). `mcp.client`
now re-exports the types `Client.listen()` yields and raises: `Subscription`,
`SubscriptionLost`, `ListenNotSupportedError`.

Remove dead surface: `StreamableHTTPError`/`ResumptionError` (never raised
from a reachable path) and `StreamableHTTPTransport.get_session_id()` on the
client transport; the no-op `RegistrationRequest`/`TokenSuccessResponse`
auth-handler aliases; the `validate_extension_identifier` re-export alias;
the unreachable `__main__` guard in `mcp/cli/__init__.py`. The unused
lowlevel server `Context` moves to the private `mcp.server._context`
module.

`_handle_resumption_request` now takes the resumption token as a required
argument instead of re-deriving it and carrying an unreachable no-token
branch.

Enable ruff `RUF022` and sort every `__all__`; `mcp_types/__init__.py` is
exempted since its `__all__` is grouped by section comments on purpose.
2026-07-28 11:25:13 +00:00
..