When to use ChatbotX MCP
When to use ChatbotX MCP?
- Natural Language Operations: Chatting naturally to manage contacts (e.g., “Send a birthday discount flow to this contact”).
- Complex Reasoning: AI agent reads conversation context, makes business decisions, and automatically takes action (e.g., auto-tagging urgent issues).
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
| Tool | Description |
|---|---|
get_workspace | Retrieve details about the current workspace. |
list_contacts | List or search contacts in the workspace (optionally filtered). |
create_contact | Add a new contact to the workspace. |
upsert_contact | Create or update a contact. |
add_contact_tags | Add tags to a contact. |
remove_contact_tags | Remove tags from a contact. |
list_contact_custom_fields | List custom fields for a specific contact. |
set_contact_custom_field | Update a contact’s custom field value. |
send_message | Send a direct chat message to a contact. |
send_contact_flow | Trigger an automation flow for a contact. |
list_flows | Retrieve available automation flows. |
list_channels | List connected channels (Telegram, WhatsApp, etc.). |
Authentication
Workspace Token
ChatbotX MCP uses a Workspace Token to authorize requests. This token acts as a secret key to authenticate your AI assistant client. You can generate or find your token under Settings → Developer → API Keys (or Settings → Integrations → Workspace token).Connecting
You can connect your AI assistant to the ChatbotX MCP server using either stdio (recommended for local configurations) or SSE (for remote configurations).Option 1: stdio Mode (Recommended for Local Use)
Exposes the MCP server over standard input/output (stdio) when running the server locally vianode:
If you are running a self-hosted instance, replace the
CHATBOTX_API_URL value with https://app.yourdomain.com/api.Option 2: SSE Mode (For Shared/Remote Access)
Exposes the MCP server over HTTP Server-Sent Events (SSE).- Header-Based Connection:
- Token in URL (when headers are not supported by the client):
Custom SSE URL (Self-Hosted)
If you are self-hosting ChatbotX, point your MCP client to your own custom domain instead:- Header-Based Connection:
- Token in URL:
For detailed setup instructions on different platforms, see Platform Setup.
Quick Example
- Agent calls
list_contacts- finds a contact by phone or email to get theircontactId. - Agent calls
add_contact_tagswith thecontactIdandtagId- tags the contact (e.g., VIP client). - Agent calls
send_contact_flow- triggers a specific onboarding flow for the contact.
FAQ
Do I need an OpenAI key to use ChatbotX MCP?
No. The MCP server runs on your self-hosted ChatbotX instance. However, your AI assistant client (such as Claude Code, OpenClaw, or VS Code) 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?
Your AI assistant will lose access to the ChatbotX workspace and return401 Unauthorized or 403 Forbidden errors. You must generate a new Workspace token and update it in your MCP client configurations.
Self-hosted: how do I expose the MCP endpoint?
The MCP server starts as part of the ChatbotX backend and is reachable at/mcp/sse (Workspace token auth in headers) and /mcp/sse?token=YOUR_WORKSPACE_TOKEN (token in URL query parameters). Your reverse proxy must forward these paths to the backend and support Server-Sent Events (SSE) streaming (e.g., disabling proxy buffering with proxy_buffering off;).
Can MCP read and reply to messages?
Yes. The AI assistant can retrieve chat history usinglist_conversations or list_contact_messages, and send replies to WhatsApp, Telegram, or other active channels using send_message.