LanaChat

API & MCP: connect an AI assistant

7 min readUpdated Markdown

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.

API and MCP: the REST API, webhooks and the MCP server for AI assistants

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 #

  1. Press Create token.
  2. 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").
  3. Save. The token is shown once: press Copy token, or Copy client configuration to get a ready-made configuration for your assistant.
  4. Press Done, I saved it.
The new token panel with Copy token and Copy client configuration

Connect your assistant #

  1. Create a dedicated access for this assistant (one token per tool you connect).
  2. Add the HTTP MCP connection in your assistant, with the endpoint and the token (exact steps below).
  3. Ask it what it can see, to check the permissions are right.
  4. 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 #

MethodPathDescriptionPermissionStatus
POSThttps://app.lanachat.ai/mcpThe MCP server (Streamable HTTP): every tool call goes hereany tokenPlanned
GEThttps://app.lanachat.ai/mcpOpens the event stream of the sessionany tokenPlanned
POSThttps://app.lanachat.ai/api/media/uploadsMedia uploads from an assistant, with the same tokencan_setupPlanned

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.

ToolWhat it doesPermissionSame as in the API
list_creators, get_creatorRead creators, their identity and setup progresscan_setupGET /creators
update_creator, update_personaChange a creator's identity or persona pagescan_setup, can_engine for the personaPUT …/identity, PATCH …/persona
list_accounts, update_accountRead Telegram accounts, change brain, market or trafficcan_setupGET /accounts, PATCH /accounts/{id}
list_media, upload_media, update_media, create_media_folderAdd media to a Vault, sort them, suggest descriptions (shown for review before saving)can_setup/media
list_scripts, draft_script, update_scriptRead scripts and draft new ones: steps, media and Stars pricescan_setup/scripts
list_members, update_memberRead and change team memberscan_setup/members
get_brain, update_brain_draft, test_brainRead a brain, edit its draft, try it in the Playgroundcan_engine/brains, /playground
publish_brainPublish an ordinary brain draftcan_publishPOST /brains/{id}/publish
test_advanced_ai, tune_advanced_ai, publish_advanced_aiAdvanced AI drafts, settings and profiles (owner workspace only)can_ai_test, can_ai_tune, can_ai_publishNone
list_experiment_reportsRead commercial experiment reports (owner workspace only)can_commercial_reportsNone
list_fans, get_conversationRead fans and conversation historycan_fan_readGET /fans, GET /conversations/{id}/messages
import_fan_historyAdd past fans and messages to the records; never sends a messagecan_fan_importPOST /fans/import
list_salesRead recorded sales for reportscan_sales_readGET /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).

MethodPathDescriptionPermissionStatus
GET/api/mcp/tokensList tokens, their permissions, expiry and statusownerPlanned
POST/api/mcp/tokensCreate a token (shown once)ownerPlanned
PUT/api/mcp/tokens/{id}Edit its name or permissionsownerPlanned
POST/api/mcp/tokens/{id}/rotateRotate the secretownerPlanned
DELETE/api/mcp/tokens/{id}Revoke itownerPlanned

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.

Latest news about Lana on Telegram

New releases and beta invites, first in the channel.