> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getlurk.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP server

> Point an agent at Lurk. It reads your project, writes rules as drafts and previews them. Going live always waits for a person.

Lurk's **optional** MCP server exposes the [API](https://docs.getlurk.com/quickstart.md) as typed tools at `https://api.getlurk.com/mcp`. It is stateless and speaks JSON over Streamable HTTP (`POST` only).

## Connect

This page connects an agent with a key. To connect your own assistant as yourself, with no key, see [Connect your assistant](https://docs.getlurk.com/connect-your-assistant.md).

Make an **agent key** in **Developers → Agents** (one per agent, to revoke one alone). Put it in an environment variable.

> [tab] Claude Code
>
> ```bash theme={null}
> claude mcp add --transport http lurk https://api.getlurk.com/mcp \
>   --header 'Authorization: Bearer ${LURK_AGENT_KEY}'
> ```
>
> Keep the single quotes: Claude Code reads `LURK_AGENT_KEY` at each connection, so the key never lands in its config file.
>
> ```bash theme={null}
> # Check it: lurk should say Connected
> claude mcp list
> ```

> [tab] Cursor
>
> ```json .cursor/mcp.json theme={null}
> {
>   "mcpServers": {
>     "lurk": {
>       "url": "https://api.getlurk.com/mcp",
>       "headers": { "Authorization": "Bearer ${env:LURK_AGENT_KEY}" }
>     }
>   }
> }
> ```

> [tab] VS Code
>
> ```json .vscode/mcp.json theme={null}
> {
>   "servers": {
>     "lurk": {
>       "type": "http",
>       "url": "https://api.getlurk.com/mcp",
>       "headers": { "Authorization": "Bearer ${input:lurk-agent-key}" }
>     }
>   },
>   "inputs": [{ "id": "lurk-agent-key", "type": "promptString", "description": "Lurk agent key", "password": true }]
> }
> ```

> [tab] Any other client
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "lurk": {
>       "url": "https://api.getlurk.com/mcp",
>       "headers": { "Authorization": "Bearer lurk_ak_…" }
>     }
>   }
> }
> ```
>
> Set the URL and an `Authorization: Bearer <key>` header in your client's MCP settings.

A project key (`lurk_sk_…`) works too, but an agent key puts the agent's name on its receipts and proposals, and can be revoked without touching your server.

> [!WARNING]
>
> Never put a key in a repository or a shared prompt. Use an environment variable, and ask your agent to read it by name.

## What it can do

See [MCP tools](https://docs.getlurk.com/mcp-tools.md) for every tool an agent key sees. An agent can use `lurk.apply` to ask a person to approve creating an audience, adding people to a list or taking back an added template.

## What it cannot do, on purpose

Going live (`rules.publish`, `rules.resume`), deciding proposals and held changes, giving units by hand, spending, using and sending units, undoing, creating or changing units, arranging dashboards (read one view at a time with `lurk.views.get`), credentials, the team, project settings, and copying between projects. A person does these in the dashboard.

When an agent needs one, the call answers `approval_required` with a link. That is not an error: the agent gives the person the link and stops. See [Going live](https://docs.getlurk.com/guides/going-live.md).

## Errors and limits

A tool that fails answers the same error body as the REST API, with a `next_step`: see [Errors](https://docs.getlurk.com/errors.md). The same [limits](https://docs.getlurk.com/guides/idempotency-and-retries.md#limits) apply.

A rate-limited tool call has `isError: true` and `error.code: "rate_limited"` in its text content, even when the HTTP response is 200. Its result includes `_meta["getlurk.com/retry-after-seconds"]`, the seconds to wait before retrying with the same idempotency key. Read it, not an HTTP `Retry-After` header. No other tool error has it.

## Docs for agents

These docs are agent-readable: [`/llms.txt`](https://docs.getlurk.com/llms.txt), [`/llms-full.txt`](https://docs.getlurk.com/llms-full.txt), a **Copy as Markdown** menu on every page, and a docs MCP server at `https://docs.getlurk.com/mcp`. For a brief for your agent's instructions, see [Agent instructions](https://docs.getlurk.com/agent-instructions.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.