# Connect Grok

In **Grok Build**, xAI's terminal tool, you add Kalender Sync as a remote MCP server.

:::caution[Grok Build only]
The Grok app (desktop, iOS, web) can't add Kalender Sync at the moment. This guide covers the Grok Build command line only.
:::

## 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 Grok.

**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. Grok 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 Grok Build

1. Run this command and replace `ksa_…` with your key:

```bash
grok mcp add --transport http kalender-sync https://app.kalender-sync.de/mcp \
  --header "Authorization: Bearer ksa_…"
```

2. Check the connection with `grok mcp list` or `grok mcp doctor kalender-sync`.

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. Remove the server with `grok mcp remove kalender-sync` and add it again with a fresh key.
- **A calendar is missing:** add it in the app under **AI assistant → Edit sharing** — changes apply immediately.

## 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 Grok. More under [Revoke access](https://docs.kalender-sync.de/en/ki-assistent/#revoke-access).