Mocapi Design Documents¶
These describe the current architecture. They are living documents: when an ADR changes a decision, the relevant design doc is updated in the same change. If a design doc and an ADR disagree, the design doc is wrong — fix it.
Index¶
- Architecture Overview — module layering, request flow, ScopedValues
- Transports — Streamable HTTP, stdio, the
McpServer↔McpTransportcontract - Extension SPI — customizer SPI, the six interceptor strata, parameter resolver model
- Handlers — internal handler classes and how they are built at startup
- Elicitation — MRTR Replay — requestState codec, response ledger, replay engine, idempotency contract
- MCP Apps — the
mocapi-appsmodule,_meta.uishapes, descriptor customizers,@McpAppResource/@McpUi - Authorization Model — how OAuth2 + Guard SPI compose at runtime
- Observability Stack — design of the four-module observability story
- Native Image — what mocapi contributes to GraalVM native-image
Keeping these synchronized with code¶
When you make an architecturally significant change:
- Decide whether it warrants an ADR (a decision, not a tweak).
- If yes: write the ADR under
../adr/using the template, and update the affected design doc(s) here in the same change. - If no: just update the design doc.
Docs and code drift fast when nobody owns the synchronization. The rule is: if the design doc is wrong, fix it in the PR that made it wrong.