API & MCP: connect an AI assistant
API & MCP (in Users, at the bottom of the sidebar) lets you connect an AI assistant, such as Claude or another MCP client, to set up and manage your workspace. MCP is an open standard that lets an assistant use tools in an app on your behalf. The same access tokens open the REST API.
Note Only the workspace owner and agency owners can open this page. Everyone else sees "Owner access required".
What you need #
- The MCP endpoint, shown at the top of the page. Press Copy URL.
- An access token that says what the assistant may do.
Create an access token #
- Press Create token.
- Give it a name and choose its access: Workspace setup, or Custom permissions to tick them one by one (for example "Read fans and conversations" or "Read sales").
- Save. The token is shown once: press Copy token, or Copy client configuration to get a ready-made configuration for your assistant.
- Press Done, I saved it.
Connect your assistant #
- Create a dedicated access for this assistant (one token per tool you connect).
- Add the HTTP MCP connection in your assistant, with the endpoint and the token (exact steps below).
- Ask it what it can see, to check the permissions are right.
- Work in drafts: let it prepare changes, test them, then publish.
The same steps, with the endpoint, header and configuration ready to copy, are in Connect your assistant at the bottom of the API & MCP page. In every example below, replace the URL with the one of your workspace (Copy URL) and YOUR_MCP_TOKEN with your token.
Claude Code #
One command in your terminal:
claude mcp add --transport http lanachat https://app.lanachat.ai/mcp \
--header "Authorization: Bearer YOUR_MCP_TOKEN"
Then type /mcp in Claude Code: lanachat shows as connected, with its tools.
Cursor #
Add this to ~/.cursor/mcp.json (every project) or .cursor/mcp.json (one project), then turn lanachat on in Settings › MCP:
{
"mcpServers": {
"lanachat": {
"url": "https://app.lanachat.ai/mcp",
"headers": { "Authorization": "Bearer YOUR_MCP_TOKEN" }
}
}
}
VS Code (GitHub Copilot) #
Add this to .vscode/mcp.json in your project:
{
"servers": {
"lanachat": {
"type": "http",
"url": "https://app.lanachat.ai/mcp",
"headers": { "Authorization": "Bearer YOUR_MCP_TOKEN" }
}
}
}
Claude Desktop #
Claude Desktop starts local servers from its configuration file, so it reaches LanaChat through the small mcp-remote bridge (Node.js 18 or later). Open Settings › Developer › Edit Config and add:
{
"mcpServers": {
"lanachat": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://app.lanachat.ai/mcp", "--header", "Authorization:${LANACHAT_AUTH}"],
"env": { "LANACHAT_AUTH": "Bearer YOUR_MCP_TOKEN" }
}
}
}
Restart Claude Desktop; LanaChat's tools appear in the tools menu of a new chat.
ChatGPT and other assistants #
Any MCP client that can send a header on an HTTP connection works with the configuration above. Web connectors that only offer an OAuth sign-in (ChatGPT connectors, custom connectors on claude.ai) cannot send an access token, so they cannot connect yet.
Check the connection #
The MCP Inspector lists the tools your token opens, without any assistant:
npx @modelcontextprotocol/inspector
Choose Streamable HTTP, paste the endpoint, add the header Authorization: Bearer YOUR_MCP_TOKEN, then Connect and List tools.
Manage tokens #
The Access tokens table shows each token's permissions, expiry and status. Use Edit, Rotate (or Renew) and Revoke. Show revoked tokens lists the old ones.
Warning A token works like a password. Revoke it as soon as you stop using the assistant or think it leaked.
The MCP endpoint #
| Method | Path | Description | Permission | Status |
|---|---|---|---|---|
| POST | https://app.lanachat.ai/mcp | The MCP server (Streamable HTTP): every tool call goes here | any token | Planned |
| GET | https://app.lanachat.ai/mcp | Opens the event stream of the session | any token | Planned |
| POST | https://app.lanachat.ai/api/media/uploads | Media uploads from an assistant, with the same token | can_setup | Planned |
The exact URL of your workspace is shown at the top of the API & MCP page (Copy URL). The token goes in the Authorization header, as for the API. A client configuration looks like this:
{
"mcpServers": {
"lanachat": {
"type": "http",
"url": "https://app.lanachat.ai/mcp",
"headers": { "Authorization": "Bearer YOUR_MCP_TOKEN" }
}
}
}
Tools the assistant gets #
The assistant only sees the tools its token allows. A tool it cannot use is not listed at all. When it connects, the server sends each tool's exact arguments (name, type, required) to the assistant, so you never type them yourself. The last column is the API endpoint that does the same thing, where its parameters are documented.
| Tool | What it does | Permission | Same as in the API |
|---|---|---|---|
list_creators, get_creator | Read creators, their identity and setup progress | can_setup | GET /creators |
update_creator, update_persona | Change a creator's identity or persona pages | can_setup, can_engine for the persona | PUT …/identity, PATCH …/persona |
list_accounts, update_account | Read Telegram accounts, change brain, market or traffic | can_setup | GET /accounts, PATCH /accounts/{id} |
list_media, upload_media, update_media, create_media_folder | Add media to a Vault, sort them, suggest descriptions (shown for review before saving) | can_setup | /media |
list_scripts, draft_script, update_script | Read scripts and draft new ones: steps, media and Stars prices | can_setup | /scripts |
list_members, update_member | Read and change team members | can_setup | /members |
get_brain, update_brain_draft, test_brain | Read a brain, edit its draft, try it in the Playground | can_engine | /brains, /playground |
publish_brain | Publish an ordinary brain draft | can_publish | POST /brains/{id}/publish |
test_advanced_ai, tune_advanced_ai, publish_advanced_ai | Advanced AI drafts, settings and profiles (owner workspace only) | can_ai_test, can_ai_tune, can_ai_publish | None |
list_experiment_reports | Read commercial experiment reports (owner workspace only) | can_commercial_reports | None |
list_fans, get_conversation | Read fans and conversation history | can_fan_read | GET /fans, GET /conversations/{id}/messages |
import_fan_history | Add past fans and messages to the records; never sends a message | can_fan_import | POST /fans/import |
list_sales | Read recorded sales for reports | can_sales_read | GET /fans/{id}/sales, GET /stats |
Note Turning Access AI configuration off also clears publishing, Advanced AI and experiment-report permissions. Workspace setup and the fan and sales permissions stay independent. No tool sends a message to a fan.
What to ask it #
Talk to it like a colleague who knows the Console. A few prompts that work well:
- "List my creators and tell me which ones have an unfinished setup."
- "Read Lea's persona and suggest three phrase bank answers for fans who ask if she is real. Do not save anything."
- "Draft a win-back script for Lea: three steps over two days, the last one a paid set at 250 Stars. Leave it inactive."
- "Upload the photos in this folder to Lea's Vault, in a folder called Beach, and suggest a description for each."
- "Change the draft of Lea's brain so the first offer comes after 6 messages, test it in the Playground with a new English-speaking fan, and show me the replies before you publish."
- "How much did each creator sell yesterday, and which tracking link brought the most buyers this week?"
Tip Ask it to work in drafts and to show you the result before it publishes. Publishing needs a token with Publish AI Brain drafts: leave it off if you want to keep the last word.
Token endpoints #
The page above calls these routes; the team guide lists the same actions in the public API (/v1/tokens).
| Method | Path | Description | Permission | Status |
|---|---|---|---|---|
| GET | /api/mcp/tokens | List tokens, their permissions, expiry and status | owner | Planned |
| POST | /api/mcp/tokens | Create a token (shown once) | owner | Planned |
| PUT | /api/mcp/tokens/{id} | Edit its name or permissions | owner | Planned |
| POST | /api/mcp/tokens/{id}/rotate | Rotate the secret | owner | Planned |
| DELETE | /api/mcp/tokens/{id} | Revoke it | owner | Planned |
These Console routes take and return the permissions as one true or false field each (can_setup, can_engine, can_publish, can_ai_test, can_ai_tune, can_ai_publish, can_commercial_reports, can_fan_read, can_fan_import, can_sales_read). Creating a token answers { "token": "…", "grant": { … } }: token is the secret, shown once; grant is the access with its id, name, scope, enabled, created and expires (Unix seconds). Rotating revokes the old access and answers a new token and grant. A missing name answers 400, an unknown id 404, a revoked access 409.
More on the API and MCP feature page.