# Claude Code

Source: https://docs.simail.ai/mcp/claude-code/

> Add the simail MCP server to Claude Code with an API key from an environment variable.

Create an inbox-scoped key in the console and export it in the shell that starts Claude Code:

```sh
export SIMAIL_API_KEY="sk_…"
```

## Command line

```sh
claude mcp add --transport http simail https://api.simail.ai/mcp \
  --header "Authorization: Bearer ${SIMAIL_API_KEY}"
```

Add `--scope user` to make it available in every project, or `--scope project` to write it to
`.mcp.json`. Note that the command line expands the variable now and stores the value; for a shared
`.mcp.json`, use the file form below instead.

## `.mcp.json` (project)

```json
{
  "mcpServers": {
    "simail": {
      "type": "http",
      "url": "https://api.simail.ai/mcp",
      "headers": { "Authorization": "Bearer ${SIMAIL_API_KEY}" }
    }
  }
}
```

Claude Code expands `${SIMAIL_API_KEY}` when it loads the file, so the key never lands in the
repository. Commit `.mcp.json` only with the variable reference.

## Check

Run `claude mcp list`, or `/mcp` inside a session; `simail` should show as connected with its tools.

## Recommended permissions

Ask before sending. In `.claude/settings.json`:

```json
{
  "permissions": {
    "ask": [
      "mcp__simail__send_message",
      "mcp__simail__reply_to_message",
      "mcp__simail__reply_all_message",
      "mcp__simail__forward_message",
      "mcp__simail__send_draft"
    ]
  }
}
```

Email content returned by the tools is untrusted; see [MCP server](/mcp/#untrusted-content).
