---
updatedAt: 2026-10-03T12:42:45.000Z
agentTools:
  projectIndex: https://docs.getmontecarlo.com/llms.txt
---

# MCP Server

How AI agents interact with Monte Carlo

## Overview

The Monte Carlo MCP Server connects your AI agent or assistant directly to Monte Carlo through the Model Context Protocol (MCP). Once connected, your agent can investigate alerts, explore assets and lineage, create and manage monitors, and evaluate AI agent performance — all without leaving the tools you already work in, like Claude, Cursor, or VS Code.&#x20;

**Want to see what's possible?** Jump to [What you can do](#what-you-can-do) for copy-paste prompts that get you to value in seconds. The server also publishes ready-to-run **prompts** for common workflows — see [Guided prompts](#guided-prompts).

An Editor role or above is required.

<Callout icon="📘" theme="info">
  **Recommended model: Claude Opus 5.5 or later.** Workflows that chain many tool calls, such as onboarding a warehouse or investigating an incident, are where model capability matters most. If your client lets you choose the model, as Claude Code, Claude Desktop and Cursor do, select Claude Opus 5.5 or later.
</Callout>

<Callout icon="💡" theme="default">
  **Want smarter agents, not just connected ones?** The MCP Server gives your AI agent access to Monte Carlo's tools. The [Agent Toolkit](https://github.com/monte-carlo-data/mc-agent-toolkit) goes further — it teaches your agent how to use those tools effectively, with pre-built skills for monitoring, code change validations and more. [Get started with the Agent Toolkit](https://docs.getmontecarlo.com/docs/agent-toolkit) →
</Callout>

## Get connected

Pick the path that matches how you work. Most Claude users should start with the **Claude connector** (option 1) — it's the fastest and requires no setup. For other AI agents, use **OAuth** (option 2). For automations and service accounts, **API keys** are supported (option 3).

## Option 1: Claude connector (recommended for Claude users)

Monte Carlo is available as an Anthropic-verified connector in the **Claude Connectors Directory**, so there are no keys to manage and nothing to configure.

1. Open the [Monte Carlo connector](https://claude.com/connectors/monte-carlo) in the directory, or in Claude go to **Settings → Connectors** and find Monte Carlo.
2. Click **Connect**. Your browser opens the Monte Carlo login page.
3. Sign in and click **Allow access** on the consent screen.

That's it — Claude can now interact with your Monte Carlo account. This works on both Claude (claude.ai) and Claude Desktop.

***

## Option 2: OAuth (recommended for all other agents)

Any MCP client that supports [HTTP transport with OAuth 2.1](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http) can connect to Monte Carlo with no API keys.&#x20;

Monte Carlo registers OAuth clients through Dynamic Client Registration, so there is no OAuth app to create and no client ID or secret to copy. Your client registers itself on first connection. If your client asks for a client ID and secret, use its DCR option instead.

Point your client at the endpoint below using HTTP transport; on first connection it opens your browser to sign in and authorize access.

```
https://mcp.getmontecarlo.com/mcp
```

Most clients just need the URL. A few common examples:

**Command-line clients** (e.g. Claude Code) — add the server in one line:

```bash
claude mcp add --transport http monte-carlo-mcp https://mcp.getmontecarlo.com/mcp
```

**Config-file clients** (e.g. Cursor, VS Code) — add the URL to your MCP config:

```json
{
  "mcpServers": {
    "monte-carlo": {
      "url": "https://mcp.getmontecarlo.com/mcp"
    }
  }
}
```

> VS Code uses a `"servers"` key instead of `"mcpServers"`; otherwise the entry is identical. When the client connects, your browser opens to complete authentication. To confirm it's working, ask your agent: *"Test the Monte Carlo MCP connection."*

<br />

### Connect from a Snowflake Cortex Agent

Cortex Agents connect through an [MCP connector](https://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-agents-mcp-connectors):
an API integration holding the OAuth config, plus an external MCP server pointing at Monte Carlo.

Steps 1 and 2 are a one-time setup, run once per Snowflake account. Steps 3 and 4 apply to each user and agent.
Requires `CREATE INTEGRATION` on the account and `CREATE EXTERNAL MCP SERVER` on the schema, both
held by `ACCOUNTADMIN` by default.

**Step 1. Create the API integration and MCP server.**

In Snowsight, open a SQL worksheet and set your role to ACCOUNTADMIN, or to a role with CREATE INTEGRATION on the account and CREATE EXTERNAL MCP SERVER on your target schema. Replace <database>.<schema> with the schema that will hold the server.

```sql
CREATE API INTEGRATION monte_carlo_mcp_integration
  API_PROVIDER = external_mcp
  API_ALLOWED_PREFIXES = ('https://mcp.getmontecarlo.com/mcp')
  API_USER_AUTHENTICATION = (
    TYPE = OAUTH_DYNAMIC_CLIENT
    OAUTH_RESOURCE_URL = 'https://mcp.getmontecarlo.com/mcp'
  )
  ENABLED = TRUE;

CREATE EXTERNAL MCP SERVER <database>.<schema>.monte_carlo_mcp_server
  WITH DISPLAY_NAME = 'Monte Carlo'
  URL = 'https://mcp.getmontecarlo.com/mcp'
  API_INTEGRATION = monte_carlo_mcp_integration;
```

<Callout icon="⚠️" theme="warn">
  Use `OAUTH_DYNAMIC_CLIENT`, not `TYPE = OAUTH2`. The latter requires a static client ID and secret,
  which Monte Carlo does not issue.
</Callout>

**Step 2. Attach it to your agent, and grant access.**

You can also add the server from Snowsight under **AI & ML** > **Agents** > **MCP Connectors**.

```sql
ALTER AGENT <your_agent> ADD MCP_SERVER = '<database>.<schema>.monte_carlo_mcp_server';

GRANT USAGE ON EXTERNAL MCP SERVER monte_carlo_mcp_server TO ROLE <role_name>;
GRANT USAGE ON INTEGRATION monte_carlo_mcp_integration TO ROLE <role_name>;
```

**Step 3. Authenticate.** Each user authorizes Monte Carlo with an Editor role or above. In Snowflake CoWork, open the sources panel and select **Connectors**, then **Connect**. From the Agent:run API, run
`SYSTEM$START_USER_OAUTH_FLOW('MONTE_CARLO_MCP_INTEGRATION')`, open the returned URL, then pass the query string from the redirect to `SYSTEM$FINISH_OAUTH_FLOW` in the same session:

```sql
SELECT SYSTEM$FINISH_OAUTH_FLOW('state=<state>&authz_code=<authz_code>');
```

**Step 4. Tell the agent when to call Monte Carlo.** Cortex selects tools from your agent's
instructions, so state the check explicitly:

```text
Before presenting any query result, extract the base tables from the FROM and JOIN
clauses and use the Monte Carlo tools to check each one for active alerts, monitoring
coverage, and upstream issues. Report what you find with the results, and lead with a
warning if a table feeding the headline metric has an active incident.
```

See [How to make Claude a trusted analyst](https://montecarlo.ai/blog-how-to-make-claude-a-trusted-analyst-for-your-whole-company#step-3-validate-data-trust-with-live-health-checks)
for the full pattern.

***

<br />

## Option 3: API keys (advanced)

Use MCP Server keys when you're running a **service account, CI/automation, or a client that doesn't support HTTP transport or OAuth**. For individual, interactive use, prefer the connector or OAuth above.

MCP Server keys are **scoped credentials** that work only with the MCP Server — they are not standard API keys, and standard API keys will not work with the MCP Server. Treat the key secret like any other credential and store it securely; if it's exposed, create a new key and revoke the old one.

**Step 1 — Create MCP Server keys.** Create keys via the UI, CLI, or GraphQL — flip between the tabs below (the CLI method requires MC CLI v0.141.4+):

```text Via UI
Settings → API Keys → Add
Choose "MCP server" as the key type, add a description, then click Add.
Copy the Key id and Key secret.
```
```bash Via CLI
montecarlo mcp create-key --description "Automation key"
```
```graphql Via GraphQL
mutation CreateMcpIntegrationKey($description: String) {
  createMcpIntegrationKey(description: $description) {
    key {
      id
      secret
    }
  }
}
```

**Step 2 — Add the server to your client.** Key-based clients connect through `mcp-remote` (requires Node.js LTS + npm/npx — see [Reference & operations](https://docs.getmontecarlo.com/docs/mcp-server-reference-and-operations)). Add the entry to your MCP config, replacing `<KEY_ID>` and `<KEY_SECRET>`:

```json
{
  "mcpServers": {
    "monte-carlo": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.getmontecarlo.com/mcp",
        "--header",
        "Authorization: Bearer <KEY_ID>:<KEY_SECRET>"
      ]
    }
  }
}
```

If your client has trouble with the `Authorization` header, use custom headers instead:

```json
"--header", "x-mcd-id: <KEY_ID>",
"--header", "x-mcd-token: <KEY_SECRET>"
```

> To confirm it's working, ask your agent: *"Test the Monte Carlo MCP connection."*

## What you can do

The MCP Server exposes Monte Carlo as a set of tools your agent can chain together. You don't need to know the tool names — just describe what you want. Here are some of the most popular workflows, each with a prompt you can try and the kinds of tools the agent reaches for.

### **Example: Triage alerts**

Find what needs attention and act on it:

> *What Monte Carlo alerts do we have in the past 3 days? Triage them and let me know what I need to review first.*

Tools the agent may use: `get_alerts`, `alert_assessment`, `update_alert`.

<Callout icon="📘" theme="info">
  If your client supports MCP prompts, try `/mcp__monte-carlo__mc-triage past 3 days`
</Callout>

### **Example: Investigate an asset**

Understand a table's health and how data flows into it:

> *Check the health of table X, including its upstream dependencies."* / *"What are the lineage dependencies of table X?*

Tools the agent may use: `search`, `get_table`, `get_asset_lineage`.

<Callout icon="📘" theme="info">
  If your client supports MCP prompts, try `/mcp__monte-carlo__mc-asset-health table X`
</Callout>

### **Example: Close coverage gaps**

Find unmonitored critical tables and propose monitors:

> *Which critical tables in&#x20;*`<use case>`*&#x20;have no monitors? Draft monitors for them.*

Tools the agent may use: `get_use_case_tables`, `get_monitors`, `create_or_update_table_monitor`.

<Callout icon="📘" theme="info">
  If your client supports MCP prompts, try `/mcp__monte-carlo__mc-proactive-monitoring <use case>`
</Callout>

### **Example: Agent observability**

**M**onitor the performance and reliability of your AI agents:

> *Please propose monitoring for agent X.*

Tools the agent may use: `get_agent_metadata`, `get_agent_trace`, `create_agent_metric_monitor`.

<Callout icon="💡" theme="default">
  Use-case and agent-observability tools live in the `extended` and `agent_observability` toolsets — see [Reference & operations](https://docs.getmontecarlo.com/docs/mcp-server-reference-and-operations) to enable them.
</Callout>

## Guided prompts

Beyond tools, the MCP Server publishes a set of **prompts** — curated, ready-to-run workflows for common use cases. You pick a prompt, provide inputs, and the agent runs the recommended sequence of Monte Carlo tools for you. Prompts are provided by the MCP server so you always get the latest version.

Some of the available prompts:

* `mc-asset-health` — check the current health of a table before querying it.
* `mc-triage` — triage your Monte Carlo alerts so you know where to focus.
* `mc-incident-response` — full incident orchestration, from triage through root cause to remediation.
* `mc-proactive-monitoring` — discover coverage gaps and create monitors to close them.

In clients that surface prompts as slash commands (such as Claude Code and VS Code), they appear under the server's namespace, for example:

```
/mcp__monte-carlo__mc-asset-health
/mcp__monte-carlo__mc-triage
/mcp__monte-carlo__mc-incident-response
/mcp__monte-carlo__mc-proactive-monitoring
```

> The prefix after `/mcp__` is whatever name you gave the server in your MCP config (`monte-carlo` here). If you named it differently, your slash commands will match that name.

<Callout icon="⚠️" theme="default">
  **Available only in clients that support MCP prompts, like Claude Code and VS Code.** Clients without prompt support can still use tools — but will not show guided prompts.
</Callout>

## When to add the Agent Toolkit

The MCP Server connects your agent to Monte Carlo. The [Agent Toolkit](https://docs.getmontecarlo.com/docs/agent-toolkit) goes a step further and teaches it *how* to use those tools well — with pre-built skills, workflows, and hooks for monitoring, triage, and code-change validation.

Reach for the toolkit when you are:

* Working in a **coding agent** like Claude Code or Cursor.
* Looking to get the most out of Monte Carlo, just like a seasoned engineer would.
* Wanting advanced capabilities, such as automatic risk analysis for every code change.

[Explore the Agent Toolkit →](https://docs.getmontecarlo.com/docs/agent-toolkit) · [View on GitHub →](https://github.com/monte-carlo-data/mc-agent-toolkit)

## Reference & operations

Toolsets, read-only mode and tool restrictions, network access control, security, troubleshooting, and Node/`curl` setup are covered on a dedicated page: [Reference & operations](https://docs.getmontecarlo.com/docs/mcp-server-reference-and-operations).