> For the complete documentation index, see [llms.txt](https://docs.kula.digital/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kula.digital/for-developers/connect.md).

# Connect — API, Code, Cursor, Lovable

There are two ways to connect, depending on what your client supports — and **both** credentials are role-scoped and created in **console.kula.digital**, so access stays under your control. There's no open, anonymous endpoint.

| Your client                                             | Method                                                                                         | See                                                    |
| ------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| Claude Desktop / claude.ai                              | **Custom connector (OAuth)** with a connect link — one click from an invite, or pasted by hand | [Connect Claude](/connect-claude-and-access/claude.md) |
| ChatGPT (Plugins / MCP Servers)                         | **Custom MCP server (OAuth)** with the same connect link                                       | [Connect Claude](/connect-claude-and-access/claude.md) |
| Claude API, Claude Code, Cursor, Lovable, custom agents | **Access token (bearer)**                                                                      | this page                                              |

This page covers the **access-token** method, for any client that connects with a bearer token rather than the OAuth custom-connector flow.

## Get an access token

1. Sign in to **console.kula.digital** and open **Tokens** → **Mint a token**. (**Connectors → New invite** is the other path — that mints an OAuth *connect link* for the Claude/ChatGPT custom-connector flow, not a bearer token.)
2. Choose the **permission level** for the integration — see [permission levels](/connect-claude-and-access/scopes.md).
3. Pick your **platform**. The app generates the **ready-to-paste connection config for that platform** (and the token itself, shown once). Copy it.

The token is a role-scoped credential, exactly like a connect link — it just travels in an `Authorization: Bearer` header instead of in the URL. The endpoint it points at is:

```
https://mcp.kula.digital/mcp        (Authorization: Bearer <token>)
```

> Use the per-platform config the app gives you — the snippets below show the shape so you know what to expect, but the app fills in your token and the exact format for your client.

## Claude API (programmatic)

Pass the token as `authorization_token` on the MCP server entry.

```python
from anthropic import Anthropic

client = Anthropic()

response = client.messages.create(
    model="claude-opus-4-8",  # or whichever Claude model is current when you read this
    max_tokens=4096,
    mcp_servers=[{
        "type": "url",
        "url": "https://mcp.kula.digital/mcp",
        "name": "kula-intelligence",
        "authorization_token": "YOUR_TOKEN_HERE",
    }],
    messages=[{
        "role": "user",
        "content": "Which instructor has the highest affinity with member M123?",
    }],
)

print(response.content)
```

## Claude Code (CLI)

```bash
claude mcp add --transport http kula-intelligence https://mcp.kula.digital/mcp \
  --header "Authorization: Bearer YOUR_TOKEN_HERE"
```

Verify with `claude mcp list`, then use your studio data in any session.

## Cursor

Add an MCP server in Cursor's settings with the URL above and an `Authorization: Bearer YOUR_TOKEN_HERE` header. Create the token at the **operations** or **admin** level for most work on member data — see [permission levels](/connect-claude-and-access/scopes.md).

## Lovable

Add Kula as an MCP tool source with the URL and bearer header. For dashboards and embeds that show trends without naming individuals, create the token at the **analytics** level so no personal data is ever returned.

## Any other MCP-compatible client

The server speaks standard MCP over streamable HTTP. Point the client at `https://mcp.kula.digital/mcp` with an `Authorization: Bearer <token>` header. The bare endpoint **requires** a valid role-scoped token — without one it returns `401`, so there's no anonymous access.

## Verify the connection

Ask the client:

> *"List the tools you can use from Kula Intelligence."*

You should get the full [tool list](/for-developers/tools.md) back — scoped to the token's level.

## Good practice

* **One token per integration**, so usage and revocation are independent.
* **Lowest workable level** — see [permission levels](/connect-claude-and-access/scopes.md).
* **Never commit a token.** Store it in your platform's secret manager, and revoke it from console.kula.digital if it leaks.
