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

# MCP Configuration

> Configure the CorrData MCP server for your environment

## Installation

### Using uvx (Recommended)

```bash theme={null}
uvx corrdata-mcp
```

### Using pip

```bash theme={null}
pip install corrdata-mcp
```

### From Source

```bash theme={null}
git clone https://github.com/CorrData/corrdata-mcp
cd corrdata-mcp
pip install -e .
```

## Configuration

### Environment Variables

| Variable             | Required | Description                        |
| -------------------- | -------- | ---------------------------------- |
| `CORRDATA_API_URL`   | Yes      | GraphQL API endpoint               |
| `CORRDATA_API_KEY`   | Yes      | Your API key                       |
| `CORRDATA_TENANT_ID` | No       | Specific tenant (for multi-tenant) |
| `CORRDATA_LOG_LEVEL` | No       | Logging level (DEBUG, INFO, WARN)  |

### Claude Desktop Configuration

Add to `~/.config/claude/claude_desktop_config.json` (Linux/Mac) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):

```json theme={null}
{
  "mcpServers": {
    "corrdata": {
      "command": "uvx",
      "args": ["corrdata-mcp"],
      "env": {
        "CORRDATA_API_URL": "https://api.corrdata.com/graphql",
        "CORRDATA_API_KEY": "sk_live_xxxxx"
      }
    }
  }
}
```

### Claude Code Configuration

For Claude Code (CLI), add to your project's `.mcp.json`:

```json theme={null}
{
  "servers": {
    "corrdata": {
      "command": "uvx",
      "args": ["corrdata-mcp"],
      "env": {
        "CORRDATA_API_URL": "https://api.corrdata.com/graphql",
        "CORRDATA_API_KEY": "${CORRDATA_API_KEY}"
      }
    }
  }
}
```

<Warning>
  Never commit API keys to version control. Use environment variables or secrets management.
</Warning>

## Security

### API Key Scopes

CorrData API keys can be scoped to specific permissions:

| Scope               | Description                |
| ------------------- | -------------------------- |
| `assets:read`       | Read asset data            |
| `assets:write`      | Create/update assets       |
| `measurements:read` | Read measurement data      |
| `compliance:read`   | Read compliance status     |
| `admin:*`           | Full administrative access |

### Rate Limits

| Tier       | Requests/minute | Requests/day |
| ---------- | --------------- | ------------ |
| Free       | 60              | 1,000        |
| Pro        | 300             | 10,000       |
| Enterprise | Unlimited       | Unlimited    |

## Troubleshooting

### Connection Issues

```bash theme={null}
# Test the connection
curl -H "Authorization: Bearer $CORRDATA_API_KEY" \
  https://api.corrdata.com/graphql \
  -d '{"query": "{ __typename }"}'
```

### Debug Mode

Enable debug logging:

```json theme={null}
{
  "mcpServers": {
    "corrdata": {
      "command": "uvx",
      "args": ["corrdata-mcp"],
      "env": {
        "CORRDATA_API_URL": "https://api.corrdata.com/graphql",
        "CORRDATA_API_KEY": "your-key",
        "CORRDATA_LOG_LEVEL": "DEBUG"
      }
    }
  }
}
```

### Common Errors

| Error                   | Cause                    | Solution                   |
| ----------------------- | ------------------------ | -------------------------- |
| `401 Unauthorized`      | Invalid API key          | Check API key in dashboard |
| `403 Forbidden`         | Insufficient permissions | Request additional scopes  |
| `429 Too Many Requests` | Rate limited             | Reduce request frequency   |
| `Connection refused`    | Server unreachable       | Check network/firewall     |
