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

# Configuration

> Set up the Pragmatiks MCP server in your AI tool

This guide shows how to configure the Pragmatiks MCP server in popular AI tools.

## Prerequisites

Before configuring the MCP server, ensure you have:

1. A Pragmatiks account with API access
2. Your authentication token (get it from the [dashboard](https://pragmatiks.io/settings/tokens) or via `pragma auth token`)

## Claude Desktop

Claude Desktop stores MCP server configuration in a JSON file.

**Configuration file location:**

* **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
* **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

**Configuration:**

```json theme={"theme":{"light":"min-light","dark":"min-dark"}}
{
  "mcpServers": {
    "pragmatiks": {
      "url": "https://api.pragmatiks.io/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_TOKEN"
      }
    }
  }
}
```

After saving the configuration, restart Claude Desktop completely.

<Tip>
  Use the Settings icon → Developer tab → Edit Config to open the configuration file directly.
</Tip>

## Claude Code

Claude Code can be configured via the CLI or by editing the configuration file directly.

### Using the CLI

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
claude mcp add pragmatiks \
  --url https://api.pragmatiks.io/mcp \
  --header "Authorization: Bearer YOUR_TOKEN" \
  --scope user
```

### Direct configuration

**Configuration file location:** `~/.claude.json`

```json theme={"theme":{"light":"min-light","dark":"min-dark"}}
{
  "mcpServers": {
    "pragmatiks": {
      "url": "https://api.pragmatiks.io/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_TOKEN"
      }
    }
  }
}
```

Restart Claude Code after making changes.

<Tip>
  Use `claude mcp list` to verify the server is configured correctly.
</Tip>

## Cursor

Cursor supports both global and project-level MCP configuration.

**Configuration file locations:**

* **Global**: `~/.cursor/mcp.json`
* **Project**: `.cursor/mcp.json` in your project root

**Configuration:**

```json theme={"theme":{"light":"min-light","dark":"min-dark"}}
{
  "mcpServers": {
    "pragmatiks": {
      "url": "https://api.pragmatiks.io/mcp",
      "headers": {
        "Authorization": "Bearer ${env:PRAGMA_TOKEN}"
      }
    }
  }
}
```

<Note>
  Cursor supports environment variable interpolation with `${env:VAR_NAME}`. Set `PRAGMA_TOKEN` in your shell environment to avoid hardcoding tokens.
</Note>

After saving, Cursor will detect the new server. Click "Start" in the MCP panel to connect.

## VS Code (GitHub Copilot)

VS Code with GitHub Copilot supports MCP servers starting from VS Code 1.102.

**Configuration file location:** `.vscode/mcp.json` in your workspace

**Configuration:**

```json theme={"theme":{"light":"min-light","dark":"min-dark"}}
{
  "servers": {
    "pragmatiks": {
      "type": "http",
      "url": "https://api.pragmatiks.io/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_TOKEN"
      }
    }
  }
}
```

After saving:

1. Open the Command Palette (`Cmd+Shift+P` / `Ctrl+Shift+P`)
2. Run "MCP: List Servers" to verify the configuration
3. Click "Start" next to the Pragmatiks server

<Warning>
  If you're part of an organization with Copilot Business or Enterprise, the "MCP servers in Copilot" policy must be enabled by your admin.
</Warning>

## Gemini CLI

Gemini CLI stores MCP configuration in its settings file.

**Configuration file locations:**

* **Global**: `~/.gemini/settings.json`
* **Project**: `.gemini/settings.json` in your project root

### Using the CLI

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
gemini mcp add pragmatiks \
  --url https://api.pragmatiks.io/mcp \
  --scope user
```

### Direct configuration

```json theme={"theme":{"light":"min-light","dark":"min-dark"}}
{
  "mcpServers": {
    "pragmatiks": {
      "httpUrl": "https://api.pragmatiks.io/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_TOKEN"
      }
    }
  }
}
```

<Note>
  Gemini CLI uses `httpUrl` for HTTP-based MCP servers (not `url`).
</Note>

## Verifying the Connection

After configuring any tool, test the connection by asking your AI assistant:

```
List my Pragmatiks resources
```

or

```
What resource types are available in Pragmatiks?
```

If configured correctly, the assistant will use the MCP tools to query your Pragmatiks account.

## Troubleshooting

### "Unauthorized" errors

* Verify your token is valid: `pragma auth token`
* Generate a new token from the [dashboard](https://pragmatiks.io/settings/tokens)
* Ensure no extra whitespace in the Authorization header

### Server not appearing

* Restart your AI tool completely after configuration changes
* Validate your JSON syntax with an online validator
* Check file permissions on the configuration file

### Tools not available

* Some tools may require specific permissions in your Pragmatiks account
* Verify you have access to the resources you're trying to manage

## Security Best Practices

<Warning>
  Never commit configuration files containing tokens to version control.
</Warning>

**Recommended approaches:**

1. **Environment variables** - Use `${env:PRAGMA_TOKEN}` syntax where supported
2. **Git ignore** - Add MCP config files to `.gitignore`
3. **Token rotation** - Regularly rotate API tokens from the dashboard
4. **Minimal scope** - Use project-level configuration when possible
