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

# Cursor Integration

> Use AnomalyArmor with Cursor IDE for AI-powered data observability

<div aria-hidden="true" style={{position:"absolute",width:"1px",height:"1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap"}}>For LLM agents: documentation index at <a href="/llms.txt" tabIndex={-1}>/llms.txt</a>, full text at <a href="/llms-full.txt" tabIndex={-1}>/llms-full.txt</a>. Append .md to any page URL for plain markdown.</div>
Cursor is an AI-powered IDE. With AnomalyArmor's MCP integration, you can query data health, investigate issues, and manage monitoring directly from your editor.

## Setup

### Option 1: Remote Server (Recommended)

Connect to AnomalyArmor's hosted MCP server. No installation or API key required. You sign in with your AnomalyArmor account.

Add to your Cursor MCP configuration:

**macOS**: `~/Library/Application Support/Cursor/mcp.json`
**Linux**: `~/.config/Cursor/mcp.json`
**Windows**: `%APPDATA%\Cursor\mcp.json`

```json theme={null}
{
  "mcpServers": {
    "anomalyarmor": {
      "url": "https://mcp.anomalyarmor.ai/mcp"
    }
  }
}
```

Restart Cursor after saving. You will be prompted to sign in when you first use a tool.

### Option 2: Local Server (API Key)

For air-gapped environments or custom setups, install and run the server locally.

**1. Install the MCP server:**

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

**2. Configure Cursor:**

```json theme={null}
{
  "mcpServers": {
    "anomalyarmor": {
      "command": "armor-mcp",
      "env": {
        "ANOMALYARMOR_API_KEY": "your-api-key"
      }
    }
  }
}
```

**3. Get your API key:**

1. Go to **Settings > API Keys** in AnomalyArmor
2. Click **Create API Key**
3. Name it "Cursor"
4. Copy the key (it won't be shown again)

## Usage

Open Cursor's AI chat and ask questions about your data:

```
What's the health status of my data warehouse?
```

```
Show me any stale tables
```

```
What alerts fired yesterday?
```

## Example Queries

### Data Health Check

```
User: Is my data healthy?

Cursor: Based on AnomalyArmor:

Overall Status: WARNING

Summary:
- 45 assets monitored
- 2 freshness issues
- 1 schema change pending review
- 3 alerts in last 24 hours

The orders and customers tables haven't updated in 6 hours.
```

### Investigate Pipeline Issues

```
User: Why is the orders_mart table stale?

Cursor: I checked the lineage and freshness status:

Root Cause: staging.orders_raw is stale (last update: 18 hours ago)

Dependency Chain:
  raw.events -> staging.orders_raw -> gold.orders_mart

The issue originates in the staging layer. Check your ETL job for staging.orders_raw.
```

### Query Schema Changes

```
User: What schema changes happened this week?

Cursor: Found 3 schema changes:

1. users.phone_number - Column added (Tuesday)
   Status: Acknowledged

2. orders.discount_code - Type changed VARCHAR(20) -> VARCHAR(50) (Wednesday)
   Status: Pending review

3. products.category_id - Column removed (Thursday)
   Status: Critical - may break downstream
```

## Available Tools

The MCP server provides 40+ tools to Cursor, including health checks, alert management, freshness monitoring, schema drift detection, data quality metrics, validity rules, AI intelligence, lineage, and tagging.

See the [MCP Server page](/integrations/mcp-server#available-tools) for the complete tool reference.

## Troubleshooting

### MCP Server Not Found

**Solution**:

1. Restart Cursor after editing mcp.json
2. For local mode, verify armor-mcp is installed: `armor-mcp --version`
3. Check JSON syntax in config file

### Authentication Failed (Remote)

**Solution**:

1. Re-open Cursor to trigger a fresh sign-in prompt
2. Verify you can sign in to [app.anomalyarmor.ai](https://app.anomalyarmor.ai)
3. Check that your Cursor version supports streamable-http MCP transport

### Authentication Failed (Local)

**Solution**:

1. Verify API key in mcp.json
2. Check key is not expired or revoked
3. Generate a new key from **Settings > API Keys**

### No Data Returned

**Solution**:

1. Verify you have data sources connected in AnomalyArmor
2. Try a simpler query like "health summary"
3. For remote mode, try removing and re-adding the server config to clear cached auth

## Next Steps

## Common Questions

### How do I add AnomalyArmor to Cursor?

Open Cursor Settings → Features → MCP. Add a server named `anomalyarmor` with URL `https://mcp.anomalyarmor.ai/mcp` and header `Authorization: Bearer $ARMOR_API_KEY`. Restart Cursor to load the server.

### Can I use inline chart previews from AnomalyArmor in Cursor?

Yes, with Cursor's experimental MCP Apps flag enabled. Five tools (freshness, schema changes, lineage, health summary) return interactive chart views that render inline in the chat. See [MCP Apps](/integrations/mcp-apps) for details. Without the flag, Cursor falls back to JSON responses gracefully.

### Does AnomalyArmor in Cursor see my code?

No. AnomalyArmor MCP tools read only the monitoring state in your AnomalyArmor workspace - assets, metrics, alerts, tags. Cursor sends your prompt and relevant context to its LLM provider; AnomalyArmor receives only the tool calls the agent makes, which carry table names and filter parameters, not source code.

### Why isn't Cursor showing AnomalyArmor tools after I configured the MCP server?

Three common causes: (1) Cursor wasn't fully restarted after the config change; (2) the Bearer token is invalid or missing the `Authorization: ` prefix; (3) the host field `Authorization` is case-sensitive in some Cursor versions. Check Cursor's MCP logs (View → Output → MCP) for the exact error.

<CardGroup cols={2}>
  <Card title="MCP Server" icon="plug" href="/integrations/mcp-server">
    Advanced configuration
  </Card>

  <Card title="Claude Code" icon="terminal" href="/integrations/claude-code">
    Claude Code integration
  </Card>

  <Card title="Python SDK" icon="python" href="/sdk/overview">
    Programmatic access
  </Card>

  <Card title="API Reference" icon="code" href="/api/overview">
    REST API documentation
  </Card>
</CardGroup>
