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

# Install in Claude Code

> Add the Stratta MCP server to Claude Code — the recommended setup.

[Claude Code](https://claude.com/claude-code) is the recommended way to use Stratta. The
install is a single command, and you provide your API key on first use.

## Requirements

* Claude Code installed.
* [Node.js](https://nodejs.org) **20 or newer** (`node --version` to check).
* A Stratta [API key](/en/guides/get-api-key).

## Install

Add the server — no key needed up front:

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

On the first tool call, Claude Code prompts you to paste your API key. It's validated and saved
to `~/.stratta/config.json` (owner-only, mode `0600`), so you only do this once.

<Tip>
  `npx -y @stratta/mcp` always fetches the latest published version. No manual updates needed.
</Tip>

## Alternative: provide the key ahead of time

Prefer to set the key before the first call? You have two options.

<Tabs>
  <Tab title="Log in via CLI">
    Run the login command and paste your key when prompted. It's saved to `~/.stratta/config.json`.

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

  <Tab title="Environment variable">
    Pass the key as an environment variable. It takes precedence over the saved key.

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

    <Warning>
      Use `--scope user` (not a project-scoped config) so the key isn't committed to a repository.
    </Warning>
  </Tab>
</Tabs>

## Verify it works

Start a conversation and ask Claude to list the available norms, for example:

```text theme={null}
List the engineering norms available in Stratta.
```

Claude should call `list_norms` and return the norms in your workspace. If the tools don't
appear, see [Troubleshooting](/en/resources/troubleshooting).

<Tip>
  View the server logs anytime with `claude mcp logs stratta`.
</Tip>

## How the key is resolved

The server looks for your key in this order:

1. The `STRATTA_API_KEY` environment variable.
2. `~/.stratta/config.json` (written by `login` or the first-use prompt).
3. An interactive prompt on first use (clients that support it).

Full details in [MCP Reference → Overview](/en/mcp/overview).

## Next steps

<CardGroup cols={2}>
  <Card title="Ask your first question" icon="comments" href="/en/guides/ask-your-first-question">
    Prompt patterns that work well.
  </Card>

  <Card title="MCP Reference" icon="terminal" href="/en/mcp/overview">
    Every tool and command.
  </Card>
</CardGroup>
