> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stratta.ch/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture

> How the Stratta platform and the MCP connector fit together.

Stratta has two parts: the **platform** at stratta.ch (accounts, keys, organizations) and the
**MCP server** `@stratta/mcp` (the connector you install in Claude). This page shows how they fit
together — useful if you're integrating Stratta or just curious.

## The big picture

```mermaid theme={null}
flowchart LR
    A[Claude / Claude Code] -->|MCP tools over stdio| B["@stratta/mcp<br/>(thin client)"]
    B -->|API key auth| C[Stratta backend]
    C --> D[(TreeRAG store:<br/>documents, sections,<br/>figures, formulas,<br/>tables, cross-refs)]
    E[stratta.ch web app] --> C
    F[You] -->|sign up, API keys,<br/>organization| E
```

## The MCP server is a thin client

`@stratta/mcp` is intentionally small. It:

* Speaks the [Model Context Protocol](https://modelcontextprotocol.io) over stdio to your Claude
  client.
* Authenticates each request with your API key.
* Forwards calls to the Stratta backend and returns the results.

All the data and logic — the norms, the org scoping, the citation structure — live on the
backend. The package contains no norm content itself, which is why updates are just
`npx -y @stratta/mcp` fetching the latest version.

## The backend

The backend stores each norm as a **TreeRAG** structure: a tree of `sections` under a
`document`, with attached `figures`, `formulas`, `tables`, and `crossRefs`. Read tools query this
tree; ingestion tools write to it. Every record carries an `organizationId` so requests are
scoped to your workspace.

| Layer             | Technology                                            |
| ----------------- | ----------------------------------------------------- |
| MCP connector     | `@stratta/mcp` — TypeScript, MCP SDK, stdio transport |
| Web platform      | TanStack Start (SSR) on Vercel                        |
| Backend & storage | Convex (database, server functions, file storage)     |
| Authentication    | Better Auth + per-key API access                      |
| Email             | Resend                                                |

## Authentication today: API keys

Stratta authenticates the MCP connector with an **API key** — there is no browser-based OAuth
login for the MCP server today. This keeps the connector simple and works everywhere stdio MCP
works. (A remote, OAuth-based option has been evaluated but is not currently offered.) See
[Security](/en/concepts/security) and the [MCP overview](/en/mcp/overview).

## Related

<CardGroup cols={2}>
  <Card title="TreeRAG" icon="tree" href="/en/concepts/treerag">
    The data model behind citations.
  </Card>

  <Card title="MCP Reference" icon="terminal" href="/en/mcp/overview">
    The tools the connector exposes.
  </Card>
</CardGroup>
