> ## 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.

# CLI & commands

> Every command to install, authenticate, and run the Stratta MCP server.

The `@stratta/mcp` package is both the MCP server and a small CLI for setup. You rarely run it
directly — your Claude client launches it — but these commands cover install and authentication.

## Add to Claude Code

```bash theme={null}
claude mcp add stratta -- npx -y @stratta/mcp
```

Adds the server with no key up front; you're prompted on first use. To scope the key explicitly:

```bash theme={null}
claude mcp add stratta --scope user --env STRATTA_API_KEY=sk_strt_xxx -- npx -y @stratta/mcp
```

<Warning>
  Use `--scope user`, never a project-scoped config, so your key isn't committed to a repository.
</Warning>

## Log in (save your key)

```bash theme={null}
npx -y @stratta/mcp login
```

Prompts you to paste your API key (input hidden), validates it against the backend, and saves it
to `~/.stratta/config.json` (owner-only, mode `0600`). Run it again anytime to replace the key.

## Add to Claude Desktop

After `login`, add the server to `claude_desktop_config.json` (Settings → Developer → Edit
Config):

```json theme={null}
{
  "mcpServers": {
    "stratta": {
      "command": "npx",
      "args": ["-y", "@stratta/mcp"]
    }
  }
}
```

See [Install in Claude Desktop](/en/guides/install-claude-desktop) for the full walkthrough,
including keeping the key in the config via an `env` block.

## Global install (optional)

```bash theme={null}
npm install -g @stratta/mcp
```

Then reference the binary directly instead of `npx`:

```json theme={null}
{
  "mcpServers": {
    "stratta": {
      "command": "stratta-mcp"
    }
  }
}
```

## Run the server directly

For local testing only — your Claude client normally does this:

```bash theme={null}
npx -y @stratta/mcp
```

It connects over stdio and logs to stderr (stdout is reserved for the MCP protocol). Inspect it
with the official MCP inspector:

```bash theme={null}
npx @modelcontextprotocol/inspector npx -y @stratta/mcp
```

## Command summary

| Command                                         | Purpose                                        |
| ----------------------------------------------- | ---------------------------------------------- |
| `claude mcp add stratta -- npx -y @stratta/mcp` | Add to Claude Code (key on first use).         |
| `npx -y @stratta/mcp login`                     | Save your API key to `~/.stratta/config.json`. |
| `npm install -g @stratta/mcp`                   | Install the `stratta-mcp` binary globally.     |
| `npx -y @stratta/mcp`                           | Run the server over stdio (testing).           |

## Related

<CardGroup cols={2}>
  <Card title="Overview" icon="book" href="/en/mcp/overview">
    Authentication and key resolution.
  </Card>

  <Card title="Read tools" icon="book-open" href="/en/mcp/read-tools">
    What the server exposes once running.
  </Card>
</CardGroup>
