> For the complete documentation index, see [llms.txt](https://docs.gridstatus.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gridstatus.io/developers/ai-agents/mcp-server.md). Agents can also search and read this documentation through its [MCP server](https://docs.gridstatus.io/~gitbook/mcp).

# MCP Server

Connect Claude, Codex, Cursor, VS Code, and other AI clients to Grid Status data with the hosted MCP server.

The Grid Status MCP server lets AI assistants and coding agents search our datasets, query grid data, read Grid Status Insights, and more. It speaks the [Model Context Protocol](https://modelcontextprotocol.io), so any MCP-capable client can use it.

* **Hosted.** Nothing to install or run. Point your client at one URL.
* **Signs in as you.** Your client opens a browser window, you sign in to Grid Status and approve access. There is no API key to create or paste.
* **Same access as your account.** The agent sees exactly the datasets and features your plan includes.

```
https://api.gridstatus.io/mcp
```

## Authentication and access

{% hint style="info" %}
Don't have a Grid Status account yet? [Create a free one](https://www.gridstatus.io/settings/mcp) first. You'll sign in with it when your client connects.
{% endhint %}

The server uses OAuth over streamable HTTP. The first time your client connects:

1. Your client opens a Grid Status sign-in page in your browser.
2. You sign in and approve access for that client.
3. Back in your client, the Grid Status tools are ready to use.

The agent acts as you, so it can only reach the data your plan includes. Some tools also need a plan feature, such as dashboards or bulk CSV exports. If your plan doesn't include it, the tool returns a "not available on your plan" message instead of data.

## Client setup

{% tabs %}
{% tab title="Claude" %}
**Claude app (web and desktop)**

1. Open [Claude connectors](https://claude.ai/customize/connectors).
2. Click **Add custom connector**.
3. Name it "Grid Status" and paste `https://api.gridstatus.io/mcp`.
4. Click **Add**, then sign in to Grid Status.

On a Team or Enterprise plan, an Owner adds the connector under **Organization settings → Connectors**, then each member clicks **Connect**.

**Claude Code**

```bash
claude mcp add --transport http --scope user gridstatus https://api.gridstatus.io/mcp
```

Then run `/mcp` inside Claude Code and choose **gridstatus** to sign in.
{% endtab %}

{% tab title="Codex" %}
**Codex app**

1. Open **Settings → MCP servers**.
2. Click **Add server**.
3. Name it `gridstatus`, choose **Streamable HTTP**, and paste `https://api.gridstatus.io/mcp`.
4. Click **Save**, then **Restart**.
5. Click **Authenticate** to sign in to Grid Status.

**Codex CLI and IDE extension**

```bash
codex mcp add gridstatus --url https://api.gridstatus.io/mcp
codex mcp login gridstatus
```

{% endtab %}

{% tab title="Cursor" %}

1. Click [Add to Cursor](https://cursor.com/install-mcp?name=gridstatus\&config=eyJ1cmwiOiJodHRwczovL2FwaS5ncmlkc3RhdHVzLmlvL21jcCJ9).
2. Confirm the install in Cursor.
3. Sign in to Grid Status when Cursor prompts you.

To add it by hand, put this in `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (one project):

```json
{
  "mcpServers": {
    "gridstatus": {
      "url": "https://api.gridstatus.io/mcp"
    }
  }
}
```

{% endtab %}

{% tab title="VS Code" %}

1. Click [Install in VS Code](https://insiders.vscode.dev/redirect/mcp/install?name=gridstatus\&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fapi.gridstatus.io%2Fmcp%22%7D).
2. Confirm the install in VS Code.
3. Sign in to Grid Status when VS Code prompts you.

Or from a terminal:

```bash
code --add-mcp '{"name":"gridstatus","type":"http","url":"https://api.gridstatus.io/mcp"}'
```

{% endtab %}

{% tab title="GitHub Copilot" %}
**Copilot CLI**

```bash
copilot mcp add --transport http gridstatus https://api.gridstatus.io/mcp
```

**Visual Studio**

1. Open GitHub Copilot Chat and switch to **Agent** mode.
2. Open the tools picker and click **+**.
3. Choose **HTTP** and paste `https://api.gridstatus.io/mcp`.
4. Click **Save**, then **Auth** above the server in `mcp.json` to sign in to Grid Status.

**JetBrains, Eclipse, and Xcode**

1. Open Copilot's `mcp.json`: **Configure tools** in Copilot Chat's Agent mode, or **Settings → MCP → Edit Config** in Xcode.
2. Add this server:

```json
{
  "servers": {
    "gridstatus": {
      "url": "https://api.gridstatus.io/mcp"
    }
  }
}
```

3. Sign in to Grid Status when Copilot prompts you.

If MCP is greyed out, your organization needs to enable it in its Copilot policies.
{% endtab %}

{% tab title="Windsurf" %}

1. Open the MCPs icon in the Cascade panel (or **Settings → Cascade → MCP Servers**), or open `~/.codeium/windsurf/mcp_config.json`.
2. Add this server:

```json
{
  "mcpServers": {
    "gridstatus": {
      "serverUrl": "https://api.gridstatus.io/mcp"
    }
  }
}
```

3. Sign in to Grid Status when Windsurf prompts you.
   {% endtab %}

{% tab title="Zed" %}

1. Open your `settings.json`.
2. Add this under `context_servers`:

```json
{
  "context_servers": {
    "gridstatus": {
      "url": "https://api.gridstatus.io/mcp"
    }
  }
}
```

3. Sign in to Grid Status when Zed prompts you.
   {% endtab %}

{% tab title="Cline" %}

1. Open **MCP Servers → Configure → Remote Servers**.
2. Choose transport **Streamable HTTP** and paste `https://api.gridstatus.io/mcp`.
3. Sign in to Grid Status when Cline prompts you.

Or in Cline's settings JSON:

```json
{
  "mcpServers": {
    "gridstatus": {
      "type": "streamableHttp",
      "url": "https://api.gridstatus.io/mcp"
    }
  }
}
```

Keep the `type` field. Without it, Cline silently falls back to SSE and the connection fails.
{% endtab %}

{% tab title="Antigravity" %}

1. Open **Settings → Customizations → Installed MCP Servers → Add MCP**, or open `~/.gemini/config/mcp_config.json`.
2. Add this server:

```json
{
  "mcpServers": {
    "gridstatus": {
      "serverUrl": "https://api.gridstatus.io/mcp"
    }
  }
}
```

3. Sign in to Grid Status when Antigravity prompts you.
   {% endtab %}

{% tab title="Other" %}
Any client that supports MCP over streamable HTTP with OAuth sign-in works. Most accept this config:

```json
{
  "mcpServers": {
    "gridstatus": {
      "url": "https://api.gridstatus.io/mcp"
    }
  }
}
```

{% endtab %}
{% endtabs %}

## Available tools

* `gridstatus_whoami`: Reports the Grid Status account and plan the connection signed in as.
* `gridstatus_search_datasets`: Finds datasets and the columns they carry. Agents call this before querying so they use real dataset ids.
* `gridstatus_query_dataset`: Fetches rows from a dataset, with time range, filters, and resampling.
* `gridstatus_run_sql`: Runs a read-only SQL query across datasets, for aggregates, rankings, and joins.
* `gridstatus_list_dataset_exports`: Lists a dataset's daily bulk CSV export files.
* `gridstatus_get_dataset_export_url`: Returns a time-limited download link for one day's gzipped CSV.
* `gridstatus_search_interconnection_queue`: Finds generation projects in development: planned plants, capacity, and expected online dates.
* `gridstatus_search_insights`: Searches Grid Status Insights analyst commentary and blog posts.
* `gridstatus_get_insight`: Reads one Insights post in full.
* `gridstatus_list_dashboards`: Lists the saved dashboards your account can open.
* `gridstatus_get_dashboard`: Reads one dashboard's cards, configuration, and time window.
* `gridstatus_search_docs`: Searches the Grid Status documentation, including how the web app and API work and release notes.
* `gridstatus_get_doc_page`: Reads one documentation page in full.
* `gridstatus_send_feedback`: Sends a bug report or suggestion to the Grid Status team.

## MCP or API key?

| Use                                                                            | When                                                                                                         |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| **MCP server**                                                                 | You're working interactively with an AI assistant or coding agent.                                           |
| [**API key**](https://docs.gridstatus.io/developers/getting-started/readme.md) | Scripts, notebooks, scheduled jobs, pipelines, and servers. Anything that runs without you there to sign in. |

A common pattern: use MCP to explore datasets and draft a query, then ask the agent to turn it into a script that uses the API key and the [Python client](https://docs.gridstatus.io/developers/getting-started/python-client.md).

## Troubleshooting

1. **Check the URL.** Use `https://api.gridstatus.io/mcp` exactly, with no trailing slash. `/mcp/` redirects, and MCP clients don't follow redirects.
2. **Sign in again.** If tools stop working, disconnect and reconnect the server in your client to start a fresh sign-in.
3. **Run `gridstatus_whoami`.** It confirms which account and plan the connection is using. If a dataset or tool is missing, your plan may not include it.
4. **Restart the client.** Some clients only load MCP servers at startup.
5. **Check the transport.** The server only speaks streamable HTTP. Clients set to SSE won't connect.

Still stuck? Ask your agent to report it with `gridstatus_send_feedback`, or contact us at <support@gridstatus.io>.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gridstatus.io/developers/ai-agents/mcp-server.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
