Chatra MCP by usefulapi
Read and update Chatra visitors; send, edit and delete chat and pushed messages.
¿Debería usar esto?
Calidad y seguridad
Basado en el análisis automatizado de las definiciones de herramientas y el cumplimiento del protocolo.
Costo de contexto
Este es el número aproximado de tokens que se consumen cada vez que las herramientas del servidor se cargan en el contexto de un modelo. Los recuentos más altos reducen la atención disponible para otras tareas.
Instalar
Instalación con un clic
Agrega esto a tu archivo `claude_desktop_config.json`:
{
"mcpServers": {
"chatra": {
"url": "https://chatra.usefulapi.io/mcp"
}
}
}Puntos de conexión remotos
https://chatra.usefulapi.io/mcpstreamable-httpQué puede hacer
Inventario de herramientas
Herramientas (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}.
Esquema de entrada
{
"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}.
Esquema de entrada
{
"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}.
Esquema de entrada
{
"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/.
Esquema de entrada
{
"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}.
Esquema de entrada
{
"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}.
Esquema de entrada
{
"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}.
Esquema de entrada
{
"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/.
Esquema de entrada
{
"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}.
Esquema de entrada
{
"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}.
Esquema de entrada
{
"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"
}Comunidad
Evidencia