"""The paper-doc MCP server: the same domain layer, spoken as MCP tools. Three front doors, one domain layer ----------------------------------- The REST API (``app.api``), the MCP server (this package) and the seed script (``scripts/seed.py``) all end up in :mod:`app.crud` and validate through :mod:`app.schemas`. Nothing about a paper is decided here: a rule fixed in the CRUD layer is fixed in the API, in the tools and in the next tool added. What lives here is only what a *model* needs and a browser does not: * compact JSON instead of HTTP envelopes, because tool results are paid for in context tokens; * paragraphs addressed by **heading** as well as by position, because a model knows the paper says "1. Introduction" and does not know that the template happens to place it at ``sort = 20``; * a bulk write, because "generate the paper, then put it in" is one intention and should not be thirty round trips. Transports ---------- Both MCP transports are served from one build: ``stdio`` (what Claude Code, Codex and the Harness spawn locally) and ``streamable-http`` (what a client on another machine connects to). See ``scripts/mcp_server.py``. """