XeniaXenia Docs

MCP server for AI assistants

PreviousNext

Connect your Xenia account to Claude Code, Cursor, Copilot, Windsurf, Codex or Gemini, so your assistant wires the SDK against your real journeys.

@xenia-martech/mcp connects your Xenia account to your AI coding assistant. The assistant reads your real journeys, trigger ids, request fields and content keys, and wires the SDK into your project with those values instead of guessing them.

It works with Claude Code, Cursor, GitHub Copilot in VS Code, Windsurf, OpenAI Codex CLI and Gemini CLI. It needs Node 20 or later.

you> connect my Xenia account
  Open  https://…/device   Code  WXYZ-1234
[approve in the dashboard, pick a workspace]
 
you> wire the abandoned-cart journey into my checkout
  → reads the journey's real trigger id, method and fields
  → detects your stack, writes .env, and edits your component

Install

claude mcp add xenia -- npx -y @xenia-martech/mcp

Restart the assistant, then ask it to "connect my Xenia account and wire the SDK".

Connecting your account

There are no API keys to paste. The assistant shows a short code and a link. You open it in the Xenia app you are already signed in to, approve, and choose which organization, workspace and environment to grant. Single sign-on and multi-factor authentication work as usual, and no credential passes through the chat.

Every connected assistant is listed in the app under API Tokens, in Connected assistants, and can be disconnected there at any time.

What it wires

After you choose how to get the SDK token, the assistant carries on without stopping:

  • One-time setup for your stack. In Next.js that is proxy.ts (merged into your existing one if you have it) for the visitor cookie and page URL, a server helper with a timeout and circuit breaker, consent from your cookie banner, and form conversions.
  • Each journey you name, in your real components. Server-side calls use { fallback: null } so an outage renders your default content. Event triggers use track().
  • Checks. A type check or build, a live verification against your account, and warnings about the journey itself, such as an A/B split that would show the same visitor different variants, or a journey that is stopped, along with the fix in the app.

It stops to ask only for the token choice, before writing to a production environment, and, if your site has no consent banner, whether analytics needs consent.

The SDK token

Before any token is created, the assistant asks how you want to get it:

  1. It mints one for you. The token is written straight to your env file and never appears in the chat. It does not expire unless you ask for an expiry, and it can always be revoked.
  2. You create one yourself in the app under API Tokens, and tell the assistant the name of the env variable you stored it in.

The token type comes from your project, not a guess: a server token stays on the server, and a browser token is restricted to your site's origin. One token covers everything, including webhook triggers that require auth.

Tools

ToolWhat it does
xenia_login / xenia_login_waitConnects your account through browser approval
xenia_statusWho is connected, and the active workspace
xenia_list_scopes / xenia_select_scopeLists and switches organization, workspace and environment
xenia_list_journeysJourneys in the workspace with their triggers, flagging any that cannot connect yet
xenia_get_journeyTrigger id, method, request fields, content keys, a snippet for your stack, and journey warnings
xenia_list_content_keysEvery personalization content key, and which journeys resolve it
xenia_detect_stackYour framework, the SDK entry point to use, and the token type this project needs
xenia_setup_projectThe one-time wiring plan for your stack
xenia_mint_sdk_tokenMints an SDK token and writes it to your env file
xenia_list_sdk_tokens / xenia_revoke_sdk_tokenLists and revokes SDK tokens
xenia_verifyReads journeys, resolves a content key, and optionally fires a test event
xenia_logoutDisconnects and forgets the local credential

Safety

  • No token value ever appears in the chat. Minted tokens go straight to your env file. The session credential stays in ~/.xenia/credentials.json, readable only by you.
  • Nothing is minted unasked. The assistant always asks how you want the token first.
  • Production writes need your confirmation.

Release channels

npx @xenia-martech/mcp       # latest stable
npx @xenia-martech/mcp@rc    # release candidate
npx @xenia-martech/mcp@dev   # development preview