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

# Cursor

## Overview

Connect **GWI Spark MCP** directly to [Cursor](https://cursor.com) using **Streamable HTTP**. Cursor talks to the Spark MCP endpoint over the network—no local `mcp-remote` bridge or Node.js install required. This is the fastest way for developers to use Spark tools in Agent chat.

Authentication for this setup uses a **Spark API access token** in the `Authorization` header. Store the token in an environment variable and reference it from `mcp.json` so the token never appears in your project or docs.

Reference: [Cursor MCP documentation](https://cursor.com/docs/mcp)

## Prerequisites

* Your organization is [enabled for Spark MCP](https://api.globalwebindex.com/docs/spark-mcp/v2beta/getting-started/prerequisites.md).
* A [Spark API access token](https://api.globalwebindex.com/docs/spark-mcp/v2beta/getting-started/authorization.md#access-tokens-developercustom-agents) for developer or custom MCP clients.
* [Cursor](https://cursor.com/download) with MCP support (Streamable HTTP; Cursor **v0.48.0** or later).

## Spark API token mode

### 1. Set your token in the environment

Create an environment variable named `SPARK_API_TOKEN` in the environment from which Cursor is launched, then fully restart Cursor. Use the raw token value only—do **not** include the `Bearer ` prefix.

How you configure the variable depends on your operating system and how you launch Cursor. See [Cursor's configuration interpolation documentation](https://cursor.com/docs/mcp#config-interpolation) for details.

### 2. Add GWI Spark to `mcp.json`

Choose **global** (`~/.cursor/mcp.json`) or **project** (`.cursor/mcp.json` in your repo root):

```json theme={null}
{
  "mcpServers": {
    "gwi_spark_v2beta": {
      "url": "https://api.globalwebindex.com/v2beta/spark-api/mcp",
      "headers": {
        "Authorization": "Bearer ${env:SPARK_API_TOKEN}"
      }
    }
  }
}
```

> [!NOTE]
>
> Remote MCP servers in Cursor do not support `envFile`. Set `SPARK_API_TOKEN` in your system or shell environment, not only in a `.env` file inside the project.

### 3. Enable the server in Cursor

1. Open **Customize** in the sidebar (or **Cursor Settings → MCP**).
2. Confirm **gwi\_spark\_v2beta** appears and is **enabled**.
3. If you edited `mcp.json` while Cursor was open, restart Cursor or toggle the server off and on.

![GWI Spark v2beta enabled in Cursor](https://mintcdn.com/gwi-c45e8f9c/wi_GZsAnhdgW_rVb/assets/images/cursor/v2beta-01-mcp-enabled.png?fit=max\&auto=format\&n=wi_GZsAnhdgW_rVb\&q=85\&s=448e62bf11164383cb1884153583e8a3)

### 4. Verify tools are available

Open **gwi\_spark\_v2beta** and confirm v2beta Spark MCP tools are listed, for example `audience_generation`, `explore_datasets`, and `explore_insight`. The exact list comes from the server’s `tools/list` response.

![GWI Spark v2beta tools in Cursor](https://mintcdn.com/gwi-c45e8f9c/wi_GZsAnhdgW_rVb/assets/images/cursor/v2beta-02-tools.png?fit=max\&auto=format\&n=wi_GZsAnhdgW_rVb\&q=85\&s=78b3c8bdc80f9b70e0d38752b347ed0c)

### 5. Run a test prompt

In **Agent** chat, ask a question that should use Spark, for example:

```text theme={null}
Using GWI Spark v2beta, list the datasets I have access to.
```

Approve the tool call when Cursor prompts you. A successful call returns the datasets available to your account.

## Alternative: MCP Remote bridge

If direct HTTP connection fails (for example, due to a corporate proxy or transport detection issues), use the [MCP Remote](https://api.globalwebindex.com/docs/spark-mcp/v2beta/integration-guide/mcp-remote.md) npm bridge with the same token and endpoint.

## Troubleshooting

* **401 / unauthorized:** Confirm `SPARK_API_TOKEN` is set in the environment Cursor inherits, that the value has no `Bearer ` prefix, and that the token is valid. See [Authorization](https://api.globalwebindex.com/docs/spark-mcp/v2beta/getting-started/authorization.md#access-tokens-developercustom-agents).
* **Server does not connect:** Open **Output** (`Cmd+Shift+U` / `Ctrl+Shift+U`), choose **MCP Logs**, and check for TLS or auth errors. See [Cursor’s MCP FAQ](https://cursor.com/docs/mcp).
* **Tools missing:** Ensure the server is enabled in **Customize** and that your organization has Spark MCP access for your account.
