Back to documentation

Connect kansei to Claude, Cursor & ChatGPT

kansei exposes its tools — generate social variants, search projects, run reports, mint invoices — over the Model Context Protocol. Plug it into any MCP-aware client and let your AI work directly inside your kansei entity.

Admin (one-time)

Deploy the kansei-mcp Worker once. Whoever owns the kansei deployment does this — the Worker URL is shared by every user in the organization.

Each user

Mint a personal token, paste it into your MCP client's settings, and you're done. ~90 seconds, no terminal needed.

What is MCP?

Model Context Protocol (MCP) is the open standard Anthropic introduced for letting AI clients discover and call third-party tools at runtime. Once connected, the AI can use any tool you have permission for — same auth, same audit trail, same financial gates as the in-app Takumi assistant.

Learn more at modelcontextprotocol.io

Connect from your own Claude or ChatGPT (recommended)

The simplest path: paste this single address into your AI client as a custom connector. It is both the MCP endpoint and its authorization server, so the client discovers everything else on its own. No tokens to copy.

https://kansei.works/api/mcp
  1. In Claude (Settings → Connectors) or ChatGPT (Settings → Connectors → custom connector), paste the address above.
  2. The client registers itself and sends you to kansei to sign in.
  3. On the consent screen, pick the workspace the connector may reach and approve.
  4. The connection appears in Settings → Connections → Apps & tokens, where you can disconnect it any time.

Under the hood this is OAuth 2.1 with PKCE (S256) and dynamic client registration — exactly what the MCP specification calls for. You do not configure any of it by hand; the endpoints are here in case you are writing the client yourself:

GET  https://kansei.works/.well-known/oauth-protected-resource
GET  https://kansei.works/.well-known/oauth-authorization-server
POST https://kansei.works/api/mcp/oauth/register        (RFC 7591 — the client registers itself)
GET  https://kansei.works/mcp/authorize                 (you sign in + pick a workspace)
POST https://kansei.works/api/mcp/oauth/token           (PKCE S256; refresh supported)
POST https://kansei.works/api/mcp/oauth/revoke          (disconnect)

The access token lasts 1 hour and the client refreshes it on its own. Clients with no sign-in flow — your own scripts, or Claude Desktop via mcp-remote — can still use a manual token from Settings → Connections → Apps & tokens.

Admin one-time: deploy the Worker

The kansei-mcp Cloudflare Worker is the bridge between MCP clients and your kansei app. It's stateless — no secrets to set, no DB. Pick whichever option fits how you ship code.

Option A — Cloudflare dashboard (paste code, no terminal)

Easiest if you don't have a dev environment set up. Takes ~5 minutes.

  1. Open dash.cloudflare.com → Workers & Pages → Create.
  2. Click "Hello World" template, name it kansei-mcp, click Deploy.
  3. Click Edit code → paste the contents of worker-mcp/src/index.ts → Save and Deploy.
  4. Open the new Worker → Settings → Variables → add Plain text variable: KANSEI_API_BASE = your kansei URL (e.g. https://kansei.works).
  5. Optionally add ALLOWED_ORIGINS if you want browser-based clients (claude.ai, ChatGPT in browser).
  6. Copy the Worker URL shown at the top of the page — that's what users put in their MCP config.

The dashboard editor doesn't bundle TypeScript types, but the file has no imports — paste-as-is works. Remove the `: Env` annotations if the editor warns.

Option B — GitHub auto-deploy (zero-touch after setup)

Connect the kansei repo to Cloudflare; every push to worker-mcp/ auto-deploys. No more manual deploys ever.

  1. Cloudflare dashboard → Workers & Pages → Create → Connect to Git → authorize the kansei repository.
  2. Set Root directory = worker-mcp/, Build command = npx wrangler deploy.
  3. In the Cloudflare project's Settings → Variables, add KANSEI_API_BASE = your kansei URL.
  4. (Alternative path via GitHub Actions) Add CLOUDFLARE_API_TOKEN to GitHub → Settings → Secrets and variables → Actions. The .github/workflows/deploy-mcp-worker.yml workflow auto-runs on every push.

GitHub Actions is the simplest route if you already have CI for kansei — the workflow file is already in the repo.

Option C — terminal (one developer, ~30 seconds)

If you have a developer with a working terminal, this is the fastest one-time setup. Edit worker-mcp/wrangler.toml first to point KANSEI_API_BASE at your kansei URL.

cd worker-mcp
npm install
npx wrangler login
npx wrangler deploy
Verify: Hit the Worker URL with /health

Step 1 — Mint a token

Tokens are scoped to one (user, entity) pair. A leaked token is bounded to whatever you can do, and revoking it kills it within 60 seconds (the edge cache TTL).

Step 2 — Configure your client

Pick the client below. The walkthrough shows the click-by-click UI path; the snippet underneath is the exact config to paste.

Steps in the UI

  1. Open Claude Desktop. From the menu bar, choose Claude → Settings (or Settings in the app menu).
  2. Click the Developer tab on the left.
  3. Click Edit Config — your default text editor opens claude_desktop_config.json.
  4. Replace the file's contents with the JSON snippet below (or merge the mcpServers.kansei key into your existing config). Save the file.
  5. Quit Claude Desktop and reopen it. Kansei tools appear in the tool picker within a few seconds.

Config location: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "kansei": {
      "transport": {
        "type": "streamable-http",
        "url": "https://kansei-mcp.<your-subdomain>.workers.dev/mcp",
        "headers": {
          "Authorization": "Bearer kmcp_xxxxxxxx_replace-with-real-token"
        }
      }
    }
  }
}

Before saving, replace these two values:

  • <your-subdomain> your Cloudflare Workers subdomain (find it at workers.cloudflare.com under your account, or in the URL the dashboard showed after you deployed the Worker).
  • kmcp_xxxxxxxx_replace-with-real-token the plaintext token from step 1.

Step 3 — Restart & verify

After saving the config, restart the client. The kansei tools should appear in the tool picker within a few seconds.

  1. Quit and reopen the client app (Claude Desktop / Cursor) — it reads the config on launch.
  2. Open a chat and ask “list my MCP tools” — you should see kansei tools mixed in.
  3. Try a read-only call first: “use kansei to search invoices from last month”.

Running an unattended agent

kansei stays pull-only: your harness (an OpenClaw-class bot, a scheduled Claude session, a cron script) wakes on ITS schedule and works the workspace within server-enforced rules. Every run follows the same loop:

  1. Call get_agenda — what needs attention, filtered to your identity; omitted sections are named.
  2. Work the sections: create drafts directly, file anything client-visible with request_approval.
  3. Conversations: list_conversations → read_conversation → draft_reply → request_approval targeting log_outbound_message with the exact text. After a human approves, send on your channel and log it back with the approvalId.
  4. Log everything you read with log_inbound_message (externalId makes replays safe).
  5. Pass clientRequestId on writes so a retried call never runs twice.

Recommended bot identities

Ready-made recipes ship as MCP prompts (prompts/list): morning triage, inbox sweep, invoice-question / scheduling / new-job plays. Resources (resources/list) serve the live agenda, your operating rules and this guide.

Not an MCP client? The same surface speaks plain HTTP — GET /api/mcp/openapi (with your bearer) returns an OpenAPI description of every tool your token can call.

Answers are kept short for the model: empty fields are left out (a missing field means it is empty), and each answer is one compact JSON text block. A refused action comes back marked as an error.

Subtitles for an editor (DaVinci Resolve)

Mint the token with the Post-production scope and the assistant gets exactly the tools this job needs — find the videos, read the tracks, translate a track, fetch the file — and none of the money tools. That scope is roughly 5,750 tokens of tool descriptions per answer instead of ~42,000 for the whole menu, which is most of the speed.

  1. list_deliverables — find the video and see which subtitle tracks it already has, with cue counts. The cue TEXT never comes back here; a 600-cue track would be tens of thousands of tokens on every turn.
  2. translate_subtitle_track — translate a saved track into a new one. Long tracks come back partial by design (see below).
  3. get_subtitle_file — ask for the finished track as SRT or VTT. You get a short signed link, not the subtitles.
  4. list_transcripts, get_transcript, transcribe_recording — work from what was said. Every transcription is kept as a recording of the workspace (subtitle projects, meetings, voice memos). get_transcript answers with an outline, a slice, the sentences that hold a phrase, or a signed link to the whole text — never the whole transcript.

Translation is RESUMABLE, and the assistant is expected to loop: each call translates as much as fits in its time budget, saves it, and answers nextIndex plus complete. Call again with fromIndex set to that nextIndex — and pass the glossary you were given back in every time, so the same names are spelt the same way from the first cue to the last. Keep going until complete is true. Nothing is ever lost between calls: whatever a slice translated is already saved on the track.

The link is what travels to your editor, not the file: it is a signed URL that needs no kansei login, so you can paste it straight into DaVinci Resolve or hand it to whoever is cutting. It expires on its own — that expiry is the only control, there is nothing to revoke — so mint a fresh one when you need it again. An invalid or wrong link answers exactly like a link that never existed.

list_review_feedback — what the review of a cut says: each file's review rounds with the client's decision, and every note with the second it sits on. An assistant driving your editor turns those into timeline markers. It reads only what the token's owner may read in the task's chat, and long notes come back clipped.

get_review_updates — which files were approved, rejected or sent back since you last asked. Keep the cursor it returns and pass it as since next time; a machine that checks every few minutes then hears of each decision once. It also lists files with new notes since notesSince (its own cursor, notesCursor), before anybody decides.

send_for_review — hand a finished cut to the client. On its own it only lists the files it would send. The send needs a person: the assistant files it for approval, a manager approves it in kansei, and then the files are shared, the review link is made and the client is e-mailed, exactly as with the Send for review button.

register_delivery — for a studio whose editing machine renders into a job's Dropbox folder. The machine names the folder and the files it wrote, with each file's size and Dropbox content hash. kansei looks into the studio's connected Dropbox: while a file is still uploading it answers "not ready" and adds nothing; once every file matches it adds them to the task as drafts only the studio sees, starts the streaming copy of the videos and saves the folder's download link on the task. Nothing reaches the client until a person sends it for review. The Dropbox connection needs permission to create share links; a studio that connected Dropbox before 21 November 2026 connects it once more.

get_task_studio, log_ingest and set_task_studio — for a studio with the Footage & ingest module: read a job's folder, editing project and copied footage, record each camera card as it is copied in, and report where delivery stands. They carry paths and names only; kansei never holds the footage.

Tree mode — a short menu for ChatGPT and Grok

An assistant that does every job carries kansei's whole tool list in its context on every answer. Tree mode gives it eight tools instead: the orientation tools, kansei_toolbox and kansei_run. It is opt-in — switch it on for a token in Settings → Connections → Apps & tokens, or pick it on the connect screen (which recommends it for ChatGPT and Grok).

  1. kansei_toolbox — describe the goal in plain words, in Czech or English ("invoice Mlýnek for March"). Keywords pick the tools; you get each one's exact parameters and the order to call them.
  2. kansei_run — call a tool by name with { name, arguments }. It runs exactly as a direct call: same permissions, approvals, budgets and audit trail. Pass clientRequestId on writes.

A tool scope still applies in tree mode: it narrows what the toolbox searches. Asking for an exact tool name looks it up in everything your role allows.

Token & link safety FAQ

Is each token unique to me?
Yes. Every token is scoped to one (user, entity) pair and contains 36 bytes of cryptographic randomness — collision is astronomically unlikely. The plaintext is shown ONCE; only its SHA-256 hash is stored. You can mint as many as you want and revoke any of them individually.
Are these tokens safe to paste into Claude / ChatGPT?
Yes — they are designed exactly for this. Each token is bounded to whatever YOU can do in kansei: same role, same financial gates, same entity scope. Even if a client logs the token (none do, but assume worst case), the blast radius is one entity, fully revocable.
What happens if a token leaks?
Open /settings/mcp-tokens and click Revoke. Within 60 seconds the edge cache expires and any client using the token starts getting 401. The audit log keeps a record of every call made before revoke (token id, timestamp, tool, side-effect tier).
Can I see when a token is being used?
Yes. The token list shows "Last used" with timestamp. Every tool call is also written to the audit log with the token id and the agent surface ("mcp"). If you see activity you don't recognise, revoke immediately.
Does every user get the same Worker URL?
Yes — the Worker URL is per kansei deployment (one URL for your whole organization). What's unique per user is the bearer token. Two team members using the same Worker URL still see only their own entity's tools because the token determines scope.

Troubleshooting

401 Unauthorized
The token is missing, malformed, or revoked. Double-check the Authorization header is exactly “Bearer kmcp_...” with a single space. Mint a new one and update your config if the old one was revoked.
403 Forbidden
The token is valid but you no longer have access to the entity (e.g., your role was demoted). Mint a new token from the entity you actually have access to.
Tool not found
The tool name is misspelled, or the tool isn't exposed via MCP. Call “tools/list” to see what's available — only tools with mcp.exposed:true and agentGrade:true ship over MCP.
Request timed out
kansei caps tool execution at ~28 seconds. If a tool consistently times out, check entity-scoped data sizes (a 50k-row paper-database export is the usual culprit). The Worker will return a clear timeout error rather than hanging the client.
Tools list looks stale after a deploy
The Worker caches tools/list per-PoP for 60 seconds. If a new tool just shipped, wait a minute or restart the MCP client to force a fresh fetch.

Security model