# Connect Cursor

In Cursor you add Kalender Sync as a remote MCP server. Cursor's agent then knows your calendars across every connected provider — Google, Outlook, iCloud, GMX, WEB.DE and more.

## 1. Create the access and key in Kalender Sync

No account yet? Create one at [app.kalender-sync.de](https://app.kalender-sync.de/) (7 days of Professional free, no credit card) and [connect your calendars](https://docs.kalender-sync.de/en/getting-started/connect-first-calendar/).

In the app, open **AI assistant → Connect the assistant** and choose **Something else**. As with every access, you pick the calendars one by one and set the [detail level](https://docs.kalender-sync.de/en/ki-assistent/sichtbarkeit/) per calendar — calendars you don't share don't exist for Cursor.

**Create key** gives you your access key (a token starting with `ksa_`). It is **shown only once**. Treat it like a password: whoever holds the key holds exactly the access you gave this connection. Never paste it into a chat.

:::note[Why a key and not a sign-in window?]
Sign-in through a browser window (OAuth) is currently available for Claude and ChatGPT only. Cursor therefore connects with an access key. Your permissions work exactly the same: you still decide per calendar what is visible and whether events may be created.
:::

## 2. Add Kalender Sync in Cursor

1. Store the key as the environment variable `KALENDER_SYNC_KEY` in your shell profile or system environment (Cursor doesn't read `envFile` for remote servers). Alternatively paste it directly instead of `${env:KALENDER_SYNC_KEY}` — then keep the file out of any Git repository.
2. Add the entry to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (this project only). Existing servers stay as they are:

```json
{
  "mcpServers": {
    "kalender-sync": {
      "url": "https://app.kalender-sync.de/mcp",
      "headers": {
        "Authorization": "Bearer ${env:KALENDER_SYNC_KEY}"
      }
    }
  }
}
```

3. Reload Cursor. **kalender-sync** and its tools should appear under **Settings → MCP**.

Then dive right in, e.g.: *"Which calendars are shared via Kalender Sync?"*, *"Where do I have two hours in one block this week?"* or *"When is my dentist appointment?"*

## Troubleshooting

- **401 / "Unauthorized":** the key is mistyped, expired or revoked. Check the header: name exactly `Authorization`, value `Bearer ksa_…` (with the space). If in doubt, create a fresh key.
- **A calendar is missing:** it isn't shared with this access. Add it in the app under **AI assistant → Edit sharing** — changes apply immediately, no new key needed.

## Revoke access

In Kalender Sync under **AI assistant**, click **Revoke** on the access — effective immediately; the key is dead regardless of what is stored in Cursor. More under [Revoke access](https://docs.kalender-sync.de/en/ki-assistent/#revoke-access).