# Connect Claude (MCP)

Zenith ships a local [Model Context Protocol](https://modelcontextprotocol.io)
server — `@zenith-books/mcp` — that gives Claude Desktop, Claude Code, and other
MCP-aware clients **read-only access to one company's books** through this
API. Ask "what was our burn in June?" and Claude pulls the real numbers.

You don't install anything permanently: your MCP client runs the server on
demand via `npx`.

## Setup

First [create an API token](/authentication) and copy the token + company key.

Claude Desktop and Claude Code are configured **separately** — they don't
share MCP settings. The JSON file below only affects the Desktop app; the
`claude mcp add` command only affects Claude Code in the terminal. Use
whichever you work in (or both).

### Claude Desktop

Add to `claude_desktop_config.json` — the easiest way to open it is
**Settings → Developer → Edit Config** inside Claude Desktop (the file lives
at `~/Library/Application Support/Claude/` on macOS, `%APPDATA%\Claude\` on
Windows). Restart the app afterwards:

```json
{
  "mcpServers": {
    "zenith": {
      "command": "npx",
      "args": ["-y", "@zenith-books/mcp@latest"],
      "env": {
        "ZENITH_API_TOKEN": "zth_live_…",
        "ZENITH_COMPANY_KEY": "a0b6156c-…"
      }
    }
  }
}
```

### Claude Code

One command in the terminal (this does **not** configure Claude Desktop):

```shell
claude mcp add zenith \
  --env ZENITH_API_TOKEN=zth_live_… \
  --env ZENITH_COMPANY_KEY=a0b6156c-… \
  -- npx -y @zenith-books/mcp@latest
```

The server talks to `hub.zenith-books.com` by default — no URL configuration
needed. (Self-hosting or testing? Set `ZENITH_API_URL` to override.)

An API token gives access to exactly one company. If you want Claude to see
several of your companies, repeat this setup once per company, each with that
company's token and a distinct name in place of `zenith` — e.g. `zenith-acme`,
`zenith-globex`.

## What Claude can do with it

**Tools** — `list_transactions`, `get_transaction`, `list_expenses`,
`get_expense`, `list_bank_accounts`, `list_partners`, and `yearly_summary`
(fast monthly aggregates — Claude reaches for this first on "how much did
we…" questions).

**Prompts** — ready-made report templates in the slash menu:

- `monthly-expense-report` — expenses for a month, grouped by category and partner
- `partner-spending-analysis` — spend trend with one supplier over a period
- `cashflow-summary` — inflow/outflow per bank account over a period

## Good to know

- Everything is **read-only** — Claude cannot create, modify, or pay anything.
- The MCP server is a thin client over this public API: same auth, same
  rate limits (it backs off automatically on `429`), same data. Nothing
  touches your database directly.
- Revoke access anytime by revoking the token in **Settings → API tokens**.
