Chatra MCP by usefulapi
Read and update Chatra visitors; send, edit and delete chat and pushed messages.
我该使用它吗
质量与安全性
基于对工具定义和协议合规性的自动分析。
上下文开销
这是每次将服务器的工具加载到模型上下文窗口时所消耗的大致 token 数。数值越高,可用于其他任务的注意力就越少。
安装
一键安装
将以下内容添加到你的 `claude_desktop_config.json` 文件中:
{
"mcpServers": {
"chatra": {
"url": "https://chatra.usefulapi.io/mcp"
}
}
}远程端点
https://chatra.usefulapi.io/mcpstreamable-http它能做什么
工具清单
工具(10)
🟢chatra_get_visitor(client_id)
A chat visitor by id: name and contact details (basicInfo, integrationData and the merged `info`), custom form answers, location, browser, the link to the chat in the Chatra dashboard, the agent group, and the pages viewed in the latest visit. The id is the `clientId` your website passed to the widget or the visitor id from a Chatra webhook; Chatra has no endpoint to list or search visitors. GET /clients/{id}.
输入模式
{
"type": "object",
"properties": {
"client_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Chatra visitor id: the `clientId` your website passed to the chat widget (ChatraSetup.clientId) or the visitor id from a Chatra webhook (client.id)."
}
},
"required": [
"client_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🔴chatra_update_visitor(client_id, name, email, phone, notes)
WRITE: edit a visitor's basic info (name, email, phone, notes) exactly as if an agent edited it in the Chatra dashboard. Only the fields you pass change; `null` removes a value. Returns the updated visitor. PUT /clients/{id}.
输入模式
{
"type": "object",
"properties": {
"client_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Chatra visitor id: the `clientId` your website passed to the chat widget (ChatraSetup.clientId) or the visitor id from a Chatra webhook (client.id)."
},
"name": {
"description": "Visitor name; null removes it.",
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 200
},
{
"type": "null"
}
]
},
"email": {
"description": "Visitor email; null removes it.",
"anyOf": [
{
"type": "string",
"minLength": 3,
"maxLength": 320
},
{
"type": "null"
}
]
},
"phone": {
"description": "Visitor phone number; null removes it.",
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 50
},
{
"type": "null"
}
]
},
"notes": {
"description": "Agent notes about the visitor; null removes them.",
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 5000
},
{
"type": "null"
}
]
}
},
"required": [
"client_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢chatra_get_message(message_id)
One chat message by id (a visitor's or an agent's): type (agent or client), text, visitor id, agent id, timestamp (ms) and receivedFrom. Chatra has no endpoint to list a conversation, so the id must come from a send call or a webhook. GET /messages/{id}.
输入模式
{
"type": "object",
"properties": {
"message_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Chatra message id (from the reply of a send call or from a webhook)."
}
},
"required": [
"message_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🔴chatra_send_message(client_id, text, agent_id, agent_email, agent_name, ...)
WRITE: send a chat message to a visitor as a Chatra agent. The visitor sees it immediately in their chat window as if the agent typed it, so only call it with text the user asked you to send. It cannot be unsent except by deleting it. Say which agent writes: agent_id, or agent_email + agent_name + received_from (a dummy agent is created in Chatra when the email is unknown). For automated notices (order status, announcements) use chatra_push_message instead. Returns the new message with its id. POST /messages/.
输入模式
{
"type": "object",
"properties": {
"client_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Chatra visitor id: the `clientId` your website passed to the chat widget (ChatraSetup.clientId) or the visitor id from a Chatra webhook (client.id)."
},
"text": {
"type": "string",
"minLength": 1,
"maxLength": 5000,
"description": "Message text (plain text, 1-5000 characters)."
},
"agent_id": {
"description": "Chatra agent id (shown on the agent's page in Chatra).",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"agent_email": {
"description": "Agent email (instead of agent_id; needs agent_name and received_from).",
"type": "string",
"minLength": 3,
"maxLength": 320
},
"agent_name": {
"description": "Agent display name (with agent_email).",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"received_from": {
"description": "Short name of the sending system, e.g. 'usefulapi-mcp'; marks the message in webhooks.",
"type": "string",
"minLength": 1,
"maxLength": 100
}
},
"required": [
"client_id",
"text"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🔴chatra_edit_message(message_id, text)
WRITE: replace the text of an agent message that was sent earlier. Only agents' messages can be edited, not visitors'. The visitor sees the edited text. Returns the updated message. PUT /messages/{id}.
输入模式
{
"type": "object",
"properties": {
"message_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Chatra message id (from the reply of a send call or from a webhook)."
},
"text": {
"type": "string",
"minLength": 1,
"maxLength": 5000,
"description": "Message text (plain text, 1-5000 characters)."
}
},
"required": [
"message_id",
"text"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🔴chatra_delete_message(message_id)
WRITE, IRREVERSIBLE: delete an agent message from the conversation. Only agents' messages can be deleted, not visitors'. Returns the deleted message. DELETE /messages/{id}.
输入模式
{
"type": "object",
"properties": {
"message_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Chatra message id (from the reply of a send call or from a webhook)."
}
},
"required": [
"message_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢chatra_get_pushed_message(message_id)
One pushed (automated) message sent earlier by id: text, visitor id, agent id, timestamp (ms), isPushed. GET /pushedMessages/{id}.
输入模式
{
"type": "object",
"properties": {
"message_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Chatra message id (from the reply of a send call or from a webhook)."
}
},
"required": [
"message_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🔴chatra_push_message(client_id, text, agent_id, group_id)
WRITE: send an automated message (order status, product update, announcement) to a visitor whose account is bound to Chatra through a clientId. It is delivered into the visitor's chat on behalf of a random agent, a given agent (agent_id) or a random agent of a group (group_id). It reaches a real customer and cannot be unsent except by deleting it, so only call it with text the user asked you to send. Returns the new message with its id. POST /pushedMessages/.
输入模式
{
"type": "object",
"properties": {
"client_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Chatra visitor id: the `clientId` your website passed to the chat widget (ChatraSetup.clientId) or the visitor id from a Chatra webhook (client.id)."
},
"text": {
"type": "string",
"minLength": 1,
"maxLength": 5000,
"description": "Message text (plain text, 1-5000 characters)."
},
"agent_id": {
"description": "Chatra agent id (shown on the agent's page in Chatra).",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"group_id": {
"description": "Chatra agent group id (on the group's page); a random agent of the group writes.",
"type": "string",
"minLength": 1,
"maxLength": 200
}
},
"required": [
"client_id",
"text"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🔴chatra_edit_pushed_message(message_id, text)
WRITE: replace the text of a pushed message sent earlier; the visitor sees the edited text. Returns the updated message. PUT /pushedMessages/{id}.
输入模式
{
"type": "object",
"properties": {
"message_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Chatra message id (from the reply of a send call or from a webhook)."
},
"text": {
"type": "string",
"minLength": 1,
"maxLength": 5000,
"description": "Message text (plain text, 1-5000 characters)."
}
},
"required": [
"message_id",
"text"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🔴chatra_delete_pushed_message(message_id)
WRITE, IRREVERSIBLE: delete a pushed message sent earlier. Returns the deleted message. DELETE /pushedMessages/{id}.
输入模式
{
"type": "object",
"properties": {
"message_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Chatra message id (from the reply of a send call or from a webhook)."
}
},
"required": [
"message_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}社区
证据