# Claude Code
> Setting up, authenticating, and running MCP servers in Claude Code with Ivar.
Source: https://ivar.run/docs/guide/mcp/providers/claude-code

import { Callout } from 'fumadocs-ui/components/callout';

Claude Code integrates directly with MCP servers declared in your hall's `ivar.json`. When targeting Claude Code, `ivar sync` generates a `.mcp.json` file at the hall root with hall-qualified server names, and Claude Code manages its own OAuth lifecycle natively.

## Configuration & naming

`ivar` maps canonical server names from `ivar.json` (`figma`, `linear`) to hall-qualified keys (`<hall>-<server>`) in `.mcp.json`.

- **Provider config path:** `.mcp.json` (hall root)
- **Canonical vs. qualified names:** In `ivar.json`, servers are named `figma` and `linear`. In `.mcp.json`, they appear as `acme-figma` and `acme-linear` (assuming a hall named `acme`).
- **Session-scoped enablement:** When starting a session, `ivar` supplies the `--settings` flag with `enabledMcpjsonServers` (for example, `["acme-linear", "acme-figma"]`), enabling the hall's servers in process scope without altering global Claude configuration.

### Generated `.mcp.json`

```json title=".mcp.json"
{
  "mcpServers": {
    "acme-linear": {
      "type": "http",
      "url": "https://mcp.linear.app/mcp"
    },
    "acme-figma": {
      "type": "http",
      "url": "https://mcp.figma.com/mcp"
    }
  }
}
```

## Authentication

Claude Code owns the full OAuth lifecycle for both Linear and Figma. Credentials are stored in `~/.claude/.credentials.json` (or OS Keychain on macOS).

### Linear

Linear supports standard OAuth 2.0 dynamic client registration for public clients. Claude Code registers and logs in natively.

You can authenticate using either the unified `ivar mcp auth` command (using the canonical name) or Claude Code's direct CLI command (using the hall-qualified name):

```sh
# Via Ivar (canonical name)
ivar mcp auth linear --provider claude-code

# Direct Claude Code command (hall-qualified name)
claude mcp login acme-linear
```

### Figma

Figma restricts Dynamic Client Registration (DCR) to allowlisted clients, and Claude Code is on Figma's allowlist. Claude Code handles Figma authentication natively without requiring Ivar to pre-register OAuth client credentials.

```sh
# Via Ivar (canonical name)
ivar mcp auth figma --provider claude-code

# Direct Claude Code command (hall-qualified name)
claude mcp login acme-figma
```

### Authenticate all providers

To authenticate all configured providers for a server at once:

```sh
ivar mcp auth figma --all-providers
```

### Status inspection

`ivar mcp status` inspects Claude Code credentials from `~/.claude/.credentials.json`. When Claude Code stores tokens in the macOS Keychain or the file is absent/unreadable, local inspection reports `unknown`. Use `--live` to query `claude mcp list` directly (note that `--live` connects to every declared server and can take several seconds):

```bash
ivar mcp status figma --provider claude-code --live
```
## OAuth ownership & credentials

| Aspect | Linear | Figma |
| --- | --- | --- |
| **OAuth ownership** | Claude Code | Claude Code |
| **Preregistration by Ivar** | None (public client) | None (Claude Code allowlisted) |
| **Credential storage** | `~/.claude/.credentials.json` / Keychain | `~/.claude/.credentials.json` / Keychain |
| **Ivar visibility** | Local JSON inspection / live query | Local JSON inspection / live query |

## Related

- [Linear integration guide](/docs/guide/mcp/integrations/linear)
- [Figma integration guide](/docs/guide/mcp/integrations/figma)
- [MCP OAuth overview](/docs/guide/mcp/oauth)
- [MCP reference & schema](/docs/reference/mcp)
