Skip to content

Claude Desktop Integration

Claude Desktop Integration

Claude Desktop is Anthropic’s desktop application for interacting with Claude models. It primarily uses Anthropic’s API directly but can be configured with environment variables.

Overview

Claude Desktop connects to Anthropic’s Claude models by default. It uses claude_desktop_config.json for configuration and supports environment variable-based API key management.

Configuration File

Claude Desktop reads from claude_desktop_config.json, typically located at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Configuring Anthropic (Default)

Claude Desktop uses Anthropic’s API natively. Set your API key as an environment variable:

Terminal window
export ANTHROPIC_API_KEY="your-anthropic-api-key"

claude_desktop_config.json

{
"mcpServers": {},
"model": "claude-sonnet-4-20250514"
}

Using Environment Variables

Claude Desktop inherits environment variables from your system. Set them before launching the app:

macOS/Linux:

Terminal window
export ANTHROPIC_API_KEY="sk-ant-..."
open -a Claude # macOS
# or launch Claude Desktop normally

Windows (PowerShell):

Terminal window
$env:ANTHROPIC_API_KEY="sk-ant-..."
Start-Process "Claude"

Persistent Environment Variables

macOS (~/.zshrc):

Terminal window
echo 'export ANTHROPIC_API_KEY="sk-ant-..."' >> ~/.zshrc
source ~/.zshrc

Linux (~/.bashrc):

Terminal window
echo 'export ANTHROPIC_API_KEY="sk-ant-..."' >> ~/.bashrc
source ~/.bashrc

Windows (System Environment Variables):

  1. Open System Properties > Advanced > Environment Variables
  2. Add ANTHROPIC_API_KEY with your key value
  3. Restart Claude Desktop

Available Models

Claude Desktop supports these Anthropic models:

ModelUse Case
claude-sonnet-4-20250514Latest, most capable
claude-3-5-sonnet-20241022Balanced performance
claude-3-haiku-20240307Fast responses

Verification

  1. Open Claude Desktop
  2. Click the model selector to confirm available models
  3. Send a test message to verify API connectivity
  4. Check for error messages indicating key or network issues

Troubleshooting

  • “API key not found”: Ensure ANTHROPIC_API_KEY is set in your environment and restart the app
  • “Invalid API key”: Regenerate your key at console.anthropic.com
  • Model unavailable: Update Claude Desktop to the latest version
  • Rate limit errors: Check your usage tier at console.anthropic.com