When to Use ChatbotX MCP
For scripting, cronjobs, and zero-token-cost automation, use the ChatbotX CLI instead.
How It Works
The ChatbotX MCP server is built into your self-hosted instance and runs alongside the workspace. It exposes a Server-Sent Events (SSE) endpoint that acts as a bridge. When you connect an AI assistant (such as OpenClaw, Hermes, or Claude Code), the assistant queries the endpoint to discover available tools and execute actions on your behalf.Available Tools
All 12 tools are generated dynamically from your system’s OpenAPI spec. When new APIs are added and the MCP Server is restarted, new tools appear automatically.Authentication
Workspace Token
ChatbotX MCP uses a Workspace Token to authorize all requests. This token acts as a secret key for your AI assistant client. Generate or find your token under Settings → Developer → API Keys (or Settings → Integrations → Workspace token).Connecting Your AI Assistant
You can connect your AI assistant to the ChatbotX MCP server using either stdio (recommended for local configurations) or SSE (for remote or shared configurations).Option 1: stdio Mode (Recommended for Local Use)
The stdio transport runs the MCP server over standard input/output when you launch the server locally via Node.js. This is the recommended approach for development and personal setups:CHATBOTX_API_URL with https://app.yourdomain.com/api.
Option 2: SSE Mode (For Shared or Remote Access)
The SSE transport exposes the MCP server over HTTP Server-Sent Events, making it accessible from any client that supports SSE. Header-based authentication (recommended when your client supports custom headers):Self-Hosted SSE URL
If you are self-hosting ChatbotX, replace the domain with your custom domain:Your reverse proxy must forward the
/mcp/sse path to the backend and support Server-Sent Events (SSE) streaming. In Nginx, add proxy_buffering off; to your location block.Quick Example
Here is a three-step agentic flow that demonstrates what an AI assistant connected via MCP can do:1
Find the contact
The agent calls
list_contacts and searches by phone or email to retrieve the target contact’s contactId.2
Tag the contact
The agent calls
add_contact_tags with the contactId and the relevant tagId — for example, tagging a contact as a VIP client.3
Trigger a flow
The agent calls
send_contact_flow to launch a specific onboarding or remarketing flow for that contact.FAQ
Do I need an OpenAI key to use ChatbotX MCP?
Do I need an OpenAI key to use ChatbotX MCP?
No. The MCP server runs on your self-hosted ChatbotX instance and does not require any OpenAI key. However, your AI assistant client (such as Claude Code, OpenClaw, or VS Code Copilot) will require an API key from an LLM provider (Anthropic, OpenAI, Google Gemini, etc.) to understand and process your chat prompts.
What happens when my Workspace token expires or is rotated?
What happens when my Workspace token expires or is rotated?
Your AI assistant will lose access to the ChatbotX workspace and return
401 Unauthorized or 403 Forbidden errors. You must generate a new Workspace token and update it in all of your MCP client configurations.Self-hosted: how do I expose the MCP endpoint?
Self-hosted: how do I expose the MCP endpoint?
The MCP server starts automatically as part of the ChatbotX backend. It is reachable at
/mcp/sse (with the Workspace token in the x-workspace-token header) and at /mcp/sse?token=YOUR_WORKSPACE_TOKEN (with the token in the URL). Your reverse proxy must forward these paths to the backend and support SSE streaming — disable proxy buffering with proxy_buffering off; in Nginx.Can MCP read and reply to messages?
Can MCP read and reply to messages?
Yes. The AI assistant can retrieve chat history using
list_conversations or list_contact_messages, and send replies to WhatsApp, Telegram, or other active channels using send_message.