npm package: @qorrelate/mcp-server
Description: MCP server for Qorrelate observability platform - enables AI agents to query logs, traces, metrics, and alerts
Author: Qorrelate
Latest version: 0.1.0

# Qorrelate MCP Server

[Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that enables AI agents to interact with [Qorrelate](https://qorrelate.io) observability data. Query logs, search traces, analyze metrics, manage alerts, and investigate session replays—all through natural language.

## Features

- **🔍 Log Search**: Query application logs with filters for severity, service, time range, and content
- **🔗 Trace Analysis**: Search distributed traces, analyze latency, and discover service dependencies
- **📊 Metrics**: Query time-series metrics with aggregation and comparison capabilities
- **🚨 Alert Management**: View, acknowledge, and analyze alerts
- **🎬 Session Replay**: List and analyze user session recordings
- **🏥 Service Health**: Monitor service health with error rates and latency percentiles

## Installation

### For Claude Desktop

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "qorrelate": {
      "command": "npx",
      "args": ["qorrelate-mcp-server"],
      "env": {
        "QORRELATE_API_KEY": "your-api-key-here",
        "QORRELATE_ENDPOINT": "https://qorrelate.io"
      }
    }
  }
}
```

### For Cursor

Add to your Cursor settings (`.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "qorrelate": {
      "command": "npx",
      "args": ["qorrelate-mcp-server"],
      "env": {
        "QORRELATE_API_KEY": "your-api-key-here",
        "QORRELATE_ENDPOINT": "https://qorrelate.io"
      }
    }
  }
}
```

### Get Your API Key

1. Log in to [Qorrelate](https://qorrelate.io)
2. Go to **Settings** → **API Keys**
3. Click **Create API Key**
4. Copy the key and add it to your MCP configuration

## Available Tools

### Logs

| Tool | Description |
|------|-------------|
| `query_logs` | Search logs with filters for severity, service, time range, and content |
| `logs_get_histogram` | Get log count histogram over time |
| `logs_get_error_summary` | Get grouped error summary for a service |

### Traces

| Tool | Description |
|------|-------------|
| `search_traces` | Search distributed traces with filters |
| `get_trace` | Get detailed trace with all spans |
| `traces_analyze_latency` | Analyze latency patterns (P50/P95/P99) |
| `traces_find_dependencies` | Discover service dependencies from traces |

### Metrics

| Tool | Description |
|------|-------------|
| `query_metrics` | Query time-series metrics with aggregation |
| `metrics_list` | List available metrics |
| `metrics_compare` | Compare metrics between two time periods |

### Alerts

| Tool | Description |
|------|-------------|
| `list_alerts` | List active or historical alerts |
| `alerts_get_details` | Get alert details and history |
| `acknowledge_alert` | Acknowledge an alert |
| `alerts_summary` | Get alert summary by severity and service |

### Session Replays

| Tool | Description |
|------|-------------|
| `list_sessions` | List user sessions with filters |
| `get_session` | Get session details and key events |
| `sessions_analyze_errors` | Analyze JavaScript errors across sessions |

### Services

| Tool | Description |
|------|-------------|
| `list_services` | List all services sending telemetry |
| `get_service_health` | Get health metrics for a service |
| `services_compare_health` | Compare health across multiple services |
| `services_overview` | Get overview of all service health |

## Example Prompts

Once configured, you can ask your AI assistant questions like:

### Investigating Errors

> "Show me all errors from the payment-service in the last hour"

> "What's causing the increase in 500 errors?"

> "Find the trace for this failed request and show me what went wrong"

### Performance Analysis

> "Analyze the latency for the checkout-api service"

> "Compare CPU usage between yesterday and today"

> "Which service has the highest error rate right now?"

### Incident Response

> "What alerts are currently firing?"

> "Show me the health of all services"

> "Are there any user sessions with JavaScript errors?"

### Deployment Verification

> "Compare error rates before and after the last deployment"

> "Is the new version performing better than the old one?"

> "Show me any anomalies in the last 30 minutes"

## Resources

The MCP server also exposes resources that provide context:

- `qorrelate://services` - List of available services
- `qorrelate://alerts/active` - Currently firing alerts

## Development

### Build from Source

```bash
cd mcp-server
npm install
npm run build
```

### Run Locally

```bash
QORRELATE_API_KEY=xxx QORRELATE_ENDPOINT=https://qorrelate.io npm start
```

### Link for Testing

```bash
npm link
# Then in your MCP config, use:
# "command": "qorrelate-mcp"
```

## Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `QORRELATE_API_KEY` | Your Qorrelate API key (required) | - |
| `QORRELATE_ENDPOINT` | Qorrelate API endpoint | `https://qorrelate.io` |

## Support

- Documentation: https://qorrelate.io/documentation
- Issues: https://github.com/sethmichaelking/arqive/issues
- Email: support@qorrelate.io

## License

MIT