Files
Max Isbey 1facb5762d Document the import-cost contract and the deferred-work model
- AGENTS.md: state the import-cost exception to the imports-at-top rule,
  listing which stacks stay off which import paths and pointing at the
  ratchet test that enforces it.
- New docs page "Imports & startup time" (Advanced): what loads when, the
  one-time first-use costs, and a tested prewarm recipe for hosts that want
  the deferred work paid at startup.
- Migration guide: the lazy import graph, the incidental namespace bindings
  that moved to their defining modules, and defer_build inheritance for user
  subclasses of SDK models.
- What's new: one paragraph on imports paying only for what they use.
2026-07-29 22:07:29 +00:00

1.6 KiB

Advanced

Everything an ordinary server or client needs has a topical home in the sections above. This section is the escape hatches you reach for when MCPServer's convenience layer is in the way:

  • The low-level Server: the class MCPServer is built on. Hand-written schemas, on_* handlers, nothing checked for you, and custom JSON-RPC methods of your own.
  • Pagination and Middleware: two things you can only do on the low-level Server.
  • Extensions and MCP Apps: the protocol's extension surface. Compose extension packages into a server, or write your own.
  • Imports & startup time: what the SDK loads when, and how to move its deferred first-use work to startup if you want it there.

A few things you might reasonably look for here live where you'd actually use them instead:

  • Authorization is under Running your server because you protect a server where you deploy it.
  • OAuth, identity assertion, connecting to multiple servers, and the response cache are all under Clients.
  • Multi-round-trip requests and Subscriptions are under Inside your handler because both are things a handler does.
  • URI templates is under Servers, next to Resources.
  • Protocol versions and Deprecated features each have their own top-level page.

If you're not sure whether you need this section, you don't.