# Connect MCP clients

> Connect Claude Code, Claude Desktop, or ChatGPT to your live Recense session in four steps: load a dataset, generate an API key, add the relay endpoint, and test with a read-only prompt. The assistant works with your live session — not a separate copy.

*Source:* https://recense.ai/docs/mcp-setup

## Before you start

- A Recense plan that includes MCP access.
- A Recense API key (Account → API Access).
- An MCP-capable client (Claude Code, Claude Desktop, ChatGPT Desktop, or your own).

## How it works

Your MCP client connects to Recense, which routes tool calls to the browser session you have open. The client works with the same session you see — not a separate copy.

> **⚠ Browser tab must stay open**  
> The browser tab must stay open. Closing it disconnects the MCP client.

## Setup (all clients)

The setup flow is the same for all MCP clients:

1. **Open Recense in the browser, sign in, and load a dataset.** — The MCP client needs a live session to connect to.
2. **Generate an API key in Account → API Access.** — The relay uses your Recense API key for authentication.
3. **Add the Recense MCP server in your client using the relay endpoint.** — Use the endpoint URL below and send your API key as a Bearer token.
4. **Test with a read-only request.** — Try "describe the dataset" or "list variables" to confirm the connection works.

*Relay MCP endpoint:*

```text
https://mcp.recense.ai/mcp
```

## Per-client notes

Claude Code — add a new MCP server pointing to the endpoint above. Claude Code handles connection setup. Ideal for users who want Recense tools alongside their coding workflow.

Claude Desktop — add the endpoint in Claude Desktop's MCP server settings. Authentication is discovered automatically — no extra configuration needed.

ChatGPT Desktop — same endpoint as above. Start with read-only prompts (dataset description, variable listing) before moving to analysis actions.

## Custom clients

Supported today:

- Live session relay — your client controls a signed-in browser session with full app access.
- Headless CLI — direct access against a .sav file without a browser. Analysis engine only (no workspace UI).

*Headless pattern:*

```bash
recense-cli mcp --file /path/to/data.sav --name "My Survey"
```

> **ℹ Hosted compute**  
> Enterprise hosted compute is available for organizations that have been enabled for it and have explicitly published datasets. It is separate from the live-session browser relay path.

## Available tools

All MCP clients can:

- Inspect dataset structure, variables, and metadata.
- Build and modify tables on the canvas.
- Apply filters, weights, and measures.
- Read analysis results.

> **ℹ Relay vs headless**  
> The relay option gives full live-session app access. The headless CLI gives direct analysis engine access without the workspace UI.

## Troubleshooting

- Client can't connect: verify the endpoint URL ends in /mcp, not just the site root.
- Tool calls fail: check the Recense browser tab is still open and signed in.
- Sign-in keeps looping: confirm you're signing in with the same account you expect the client to control.
- Tier issue: verify your Recense plan includes MCP access.

## Next steps

- **[Write dataset instructions](/docs/dataset-instructions)** — Give the agent durable context about your survey.
- **[Agent recipes](/docs/agent-recipes)** — Prompt patterns that work well from MCP clients.
- **[Security and privacy](/docs/security-and-privacy)** — What the relay sees and what stays in your browser.
- **[Team and billing](/docs/team-and-billing)** — MCP request allowances by tier.
