# Cursor IDE Setup

> Connect Cursor IDE to graph8 via MCP using the remote OAuth connector

Source: https://docs.graph8.com/developers/cursor-setup/

Connect Cursor IDE to graph8 so you can prospect contacts, run campaigns, and query your accounts and intelligence while you code.

> **Tip:**
> graph8 connects to Cursor as a **remote MCP server over OAuth** — just a URL. There is no `session_id` to copy and no API key required for the remote flow. Cursor prompts you to sign in on first use.

## Prerequisites

- Cursor IDE installed ([download](https://cursor.com)) with MCP support (recent versions)
- A graph8 account ([get started free](https://auth.graph8.com/en/signup) — 1,000 credits, no card required)

## Setup (remote OAuth — recommended)

1. **Add graph8 to your MCP config**

   Create or edit `.cursor/mcp.json` in your project root (or `~/.cursor/mcp.json` for all projects):

```json
   {
     "mcpServers": {
       "graph8": {
         "url": "https://be.graph8.com/mcp/"
       }
     }
   }
```

2. **Reload Cursor**

   Quit and reopen Cursor, or reload the window, so it picks up the new server.

3. **Authorize (one time)**

   The first time a graph8 tool is used, Cursor opens a browser tab. Sign in to graph8 and approve the connection — no API key or session ID needed. The grant binds to your account and the organization you have active when you authorize.

4. **Verify**

   Open Cursor's AI chat and ask: *"What campaigns do I have in graph8?"*

> **Note:**
> You can also add MCP servers from Cursor's UI: **Settings → MCP → Add new global MCP server**, then paste the same `url`. The `.cursor/mcp.json` file above is the equivalent config it writes.

## Self-hosted (stdio)

For headless setups, CI, or when you prefer a personal API key over OAuth, run the server locally:

```json
{
  "mcpServers": {
    "graph8": {
      "command": "uvx",
      "args": ["g8-mcp-server"],
      "env": {
        "G8_API_KEY": "g8_...",
        "G8_MCP_MODE": "all"
      }
    }
  }
}
```

Create a personal API key from **Profile → Developer**. See [MCP Overview → Modes](https://docs.graph8.com/developers/mcp/#modes) for `G8_MCP_MODE` options (`dev`, `gtm`, `all`).

## Example Questions

Once connected, try asking Cursor:

```
Show me my active campaigns in graph8
```

```
What accounts are in the healthcare industry?
```

```
Get the intelligence report for [account name]
```

```
Search graph8 for content about enterprise pricing
```

## Multiple Organizations

The connection uses the organization you had active when you authorized. To switch: change organizations in graph8, then re-authorize the graph8 server in Cursor (remove and re-add, or trigger a fresh OAuth prompt).

## Troubleshooting

Cursor specifics live here. Generic MCP issues (auth, permissions, JSON parse, "tool not found") are answered in the [MCP FAQ](https://docs.graph8.com/developers/mcp-faq/).

### "MCP server not found" or no graph8 tools

- Confirm `mcp.json` is valid JSON and in the correct location (`.cursor/mcp.json` in the project root, or `~/.cursor/mcp.json`).
- Reload Cursor after editing — the MCP client only picks up changes on reload.

### Other issues

- Session expired or authentication failed → [FAQ](https://docs.graph8.com/developers/mcp-faq/#authentication-failed-or-401)
- Permission denied → [FAQ](https://docs.graph8.com/developers/mcp-faq/#permission-denied)
- Tool not found → [FAQ](https://docs.graph8.com/developers/mcp-faq/#tool-not-found)
- OAuth redirect loop → [FAQ](https://docs.graph8.com/developers/mcp-faq/#oauth-redirect-loop)

## Managing the Connection

- **Disconnect**: remove the `graph8` entry from `mcp.json` and reload Cursor. You can also revoke the OAuth grant from your graph8 Profile.
- **Re-authorize**: if Cursor reports an authentication error, trigger a graph8 tool again to reopen the OAuth prompt.

## Frequently Asked Questions

### Does MCP work in Cursor's chat and composer?

graph8 tools are available in Cursor's AI chat panel. When you ask about graph8 data, Cursor invokes the appropriate MCP tools automatically.

### Can multiple team members share one connection?

No. Each OAuth grant (or personal API key) is tied to an individual graph8 account and its permissions. Each teammate connects with their own account.

### How do I disconnect Cursor from graph8?

Remove the `graph8` entry from `mcp.json` and reload Cursor, and/or revoke the session from your graph8 Profile.

## Related

- [MCP Overview](https://docs.graph8.com/developers/mcp)
- [Claude Code Setup](https://docs.graph8.com/developers/claude-code-setup/)
- [Claude Desktop Setup](https://docs.graph8.com/developers/claude-desktop-setup/)
