0003: One core, with REST and MCP as adapters
Context
Section titled “Context”An MCP server bolted on beside an app drifts from it: it checks permissions its own way, validates less, and falls behind on features.
Decision
Section titled “Decision”All logic lives in one module of the server, its core. The REST routes, the
MCP server (POST /api/v1/mcp) and the CLI are thin adapters over it: they
parse, call the core, and shape the answer. MCP is hand-rolled, stateless JSON-RPC over
Streamable HTTP, not the SDK: tools and resources are all it serves.
Consequences
Section titled “Consequences”- A permission is checked once, in core, for every door.
- An MCP tool is usually a few lines over an existing core function.
- Prompts, subscriptions or server-initiated messages would need the SDK; that is the trigger to take it.