# Use a personal token

> For the complete documentation index, see [llms.txt](https://analytics.writechoice.io/docs/llms.txt).

Connect Cursor, Claude Code or any MCP client that can't sign in, with a personal token you create in the portal.

For tools that can't sign in to the portal (Cursor, scripts, any MCP client that takes a header), create a **personal token**. It reads what you can read in the portal right now, like the [Claude connection](https://analytics.writechoice.io/docs/connect-your-ai/), and only reads.

## Create the token

**1. Open Connect your AI**

In the portal, open **Settings → Connect your AI** and find **Other AI tools: a personal token**.

**2. Name it and create it**

Optionally give it a **Name** (such as *Cursor on my laptop*) and an expiry date (**Expires on**, in UTC; leave it empty for no expiry). Choose **Create token**.

**3. Copy it now**

The token (it starts with `wcp_`) is shown **once**: choose **Copy** and keep it in an environment variable, never in a file you commit. Then choose **Done**.

**Your tokens** lists your tokens, with their status (**Active**, **Expired**, **Revoked**). **Revoke** stops one right away. You can have up to 20 active tokens. WriteChoice can revoke them too.

## Set up your AI tool

The server address is `https://customer.writechoice.io/mcp` (Streamable HTTP), with the header `Authorization: Bearer <token>`. Keep the token in an environment variable named `WCA_TOKEN`.

**Cursor**

Add the server to `.cursor/mcp.json` in your project (or `~/.cursor/mcp.json` for all projects). Cursor reads `${env:WCA_TOKEN}` from your environment:

```json
{
  "mcpServers": {
    "writechoice-analytics": {
      "url": "https://customer.writechoice.io/mcp",
      "headers": {
        "Authorization": "Bearer ${env:WCA_TOKEN}"
      }
    }
  }
}
```

Open Cursor's MCP settings to check that the server is enabled and lists its tools.

**Claude Code**

```bash
export WCA_TOKEN="wcp_..."
claude mcp add --transport http writechoice-analytics https://customer.writechoice.io/mcp \
  --header "Authorization: Bearer ${WCA_TOKEN}"
```

Run `/mcp` in Claude Code to check that the server is connected, then ask a question. (Claude Code can also [sign in](https://analytics.writechoice.io/docs/connect-your-ai/#claude-code), with no token.)

**Claude Code (.mcp.json)**

To share the setup with your team without sharing the token, add `.mcp.json` to the project root. Each person keeps their own token in `WCA_TOKEN`:

```json
{
  "mcpServers": {
    "writechoice-analytics": {
      "type": "http",
      "url": "https://customer.writechoice.io/mcp",
      "headers": {
        "Authorization": "Bearer ${WCA_TOKEN}"
      }
    }
  }
}
```

**Other clients**

Point the client at `https://customer.writechoice.io/mcp` with the Streamable HTTP transport and the header `Authorization: Bearer <token>`. One JSON-RPC message per `POST`; the responses are JSON, and the server keeps no session.

## Keep it safe

- Treat the token like a password. If it leaks, revoke it and create another.
- The assistant never needs the token's value in the chat.
- The token never manages anything: it can't change settings, people, tokens or sites.