Skip to main content
The ChatbotX MCP Server connects AI assistants to your self-hosted ChatbotX Workspace using the Model Context Protocol (MCP). Instead of manually typing commands, you can chat with an AI assistant to query contacts, update custom fields, send messages, or trigger automation flows — all through natural language. The MCP server runs as part of your ChatbotX backend and requires no additional infrastructure to operate.

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).
Keep your Workspace Token secret. Anyone who holds it can perform actions on your ChatbotX Workspace. Never share it in public repositories or chat messages.

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). 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:
If you are running a self-hosted instance, replace 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):
Token-in-URL (use when your client does not support custom headers):

Self-Hosted SSE URL

If you are self-hosting ChatbotX, replace the domain with your custom domain:
Or with token in URL:
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.
For step-by-step setup instructions for specific platforms (OpenClaw, Hermes, Claude Code, VS Code, and others), see Platform Setup.

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

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.
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.
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.
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.