> 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 **app.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 | [Connect Claude](/connect-claude-and-access/claude.md) |
| Claude API, Claude Code, Cursor, Lovable, ChatGPT, 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 **app.kula.digital** and open **Connectors → New connector** (or **Tokens**).
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 app.kula.digital if it leaks.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kula.digital/for-developers/connect.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
