> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neosantara.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code Integration

> Configure Claude Code CLI using Neosantara Anthropic and MCP endpoints.

[Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview?utm_source=neosantara-docs\&utm_medium=referral) is [Anthropic](https://www.anthropic.com/?utm_source=neosantara-docs\&utm_medium=referral)'s official terminal-based coding assistant. You can connect it to Neosantara in two ways: as the primary LLM model provider or as a supplemental tool provider via Model Context Protocol (MCP).

## Method 1: Primary Model Provider

Neosantara provides an Anthropic-compatible protocol endpoint at `/anthropic`.

**1. Install Claude Code CLI**

```bash theme={"theme":{"light":"catppuccin-latte","dark":"ayu-dark"}}
npm install -g @anthropic-ai/claude-code
```

**2. Configure Environment Variables**

Set the base URL to the Neosantara gateway and export your API key:

```bash theme={"theme":{"light":"catppuccin-latte","dark":"ayu-dark"}}
export ANTHROPIC_BASE_URL="https://api.neosantara.xyz/anthropic"
export ANTHROPIC_API_KEY="nsk_your_api_key_here"
```

To persist these across terminal sessions, add them to your shell configuration (`~/.bashrc` or `~/.zshrc`).

**3. Launch Claude Code**

Navigate to your project directory and execute:

```bash theme={"theme":{"light":"catppuccin-latte","dark":"ayu-dark"}}
claude
```

Claude Code connects to Neosantara using the default flagship model `claude-sonnet-4-6`.

## Method 2: Adding Neosantara MCP Server

To equip Claude Code with Neosantara tools such as image generation or model catalog queries, attach Neosantara as an MCP server:

```bash theme={"theme":{"light":"catppuccin-latte","dark":"ayu-dark"}}
claude mcp add --transport http neosantara https://api.neosantara.xyz/v1/mcp --header "x-api-key: nsk_mcp_your_key_here"
```

> [!NOTE]
>
> MCP connections require a dedicated API key with the `nsk_mcp_` prefix. Generate one via the [API Keys Dashboard](https://app.neosantara.xyz/api-keys) or follow the [MCP API Keys guide](https://docs.neosantara.xyz/en/agents/mcp-keys.md).

### Verifying MCP Server Status

Check active configured MCP servers:

```bash theme={"theme":{"light":"catppuccin-latte","dark":"ayu-dark"}}
claude mcp list
```

The output confirms `neosantara` with active status and listed available tools.

## Testing Interaction

Run a test prompt within the Claude Code session:

```text theme={"theme":{"light":"catppuccin-latte","dark":"ayu-dark"}}
> Create a debounce utility in TypeScript and write test cases for it.
```

## Next Steps

| Task | Guide |
| :- | :- |
| Configure OpenCode | [OpenCode Integration](https://docs.neosantara.xyz/en/agents/opencode.md) |
| Configure Cursor IDE | [Cursor Integration](https://docs.neosantara.xyz/en/agents/cursor.md) |
| Review MCP Keys | [MCP API Keys](https://docs.neosantara.xyz/en/agents/mcp-keys.md) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.