The server is available to MCP clients that let you set request headers for a remote server. It does not use OAuth, so clients that can only sign in through an OAuth flow cannot connect.
Quick start
1
Create a key
Create an organization API key and set it in your shell as
KLATT_API_KEY.2
Add the server to your client
Follow the tab for your client in Connect a client. In Claude Code it is one command:
3
Check the connection
Paste this prompt into the client. It only reads:
Check that your assistant can reach Klatt
Connect a client
Create an organization API key, then set it in your shell asKLATT_API_KEY.
- Claude Code
- Cursor
- VS Code
Add the server from the command line (Claude Code MCP documentation). Your shell expands Or share the server through a
$KLATT_API_KEY, so Claude Code stores the literal key in its configuration. For a project you share, use the .mcp.json form below instead:.mcp.json file. Claude Code expands ${KLATT_API_KEY} from the environment, so the key stays out of the file:.mcp.json
Prompts to try
Copy a prompt into any connected client. The first two only read.Review the last week of conversations
Find gaps in an agent's knowledge
Change an agent safely
Tools
The server has one tool for every operation of API v1, plus the integration tools,search_docs, get_setup_guide and audit_agent. Every tool acts on the organization that owns the key; an id from another organization is reported as not found, or matches nothing when used as a filter. Tool names are the snake_case form of the operation ids in the endpoint reference.
Inputs and results
- Inputs. The path and query parameters of the operation keep their names, for example
agent_uuid,limitandcursor. The request body goes in onebodyargument with the same properties as the REST request body. - Results. Each tool returns one JSON text block with the documented fields of the REST response. Empty lists come back as
[], and delete tools return{"deleted": true}. - Errors. A failed call is a tool error (
isError: true). Usually its text is JSON,{"status": <HTTP status>, "detail": ...}, with the same status anddetailas the REST API (see Errors). For example, a key without the needed permission returns{"status": 403, "detail": "permission_required"}. Arguments that do not match the input schema of the tool return a plain-text validation message instead of a422. Unexpected server errors return only a generic message. The integration tools are the exception, except for a missing or invalidguide_tokenoncreate_integrationandupdate_integration, which is a tool error (see Guides and guide_token), not a result withcreated: false. Otherwise they report their own failures in a normal result instead:created,updatedorfoundisfalse, with anerror_codeand anerror.list_integrationsreturns an empty list instead of an error, andsearch_docsreportserror: "docs_unavailable"when the guides cannot be read. A key without the needed permission is still a tool error with status 403. - Text written by third parties.
list_conversations,search_conversations,update_conversation_state,get_knowledge_document_text,update_knowledge_document_text,list_knowledge_entries,create_knowledge_entry,update_knowledge_entryand the contact tools (list_contacts,search_contacts,create_contact,get_contact,update_contact) return two text blocks. The first is a notice that what follows is data written by third parties (callers, contacts, documents) and not instructions. The second is the usual JSON between<untrusted-data-ID>and</untrusted-data-ID>, whereIDis random on every call, so text inside the data cannot fake the closing tag. The JSON itself is unchanged: read the JSON between the tags. This helps an assistant tell data from instructions, but it is not a guarantee; see Security. - Polling. MCP has no conditional polling (
ETagandIf-None-Match). To poll conversations, passsincetolist_conversations.
Guides and guide_token
Before an assistant creates, changes or deletes anything, it loads the matching guide withget_setup_guide (start, create_agent, review_agent, change_agent or connect_service). The result includes a guide_token.
- Every write needs it. Pass the
guide_tokento each tool that creates, changes or deletes something: every tool that is not a Read tool,create_integrationandupdate_integrationincluded. The token is optional in the input schema, but a write without a valid one fails before it runs and changes nothing. - It lasts 2 hours. It belongs to the organization and the API key that loaded the guide, so another key cannot use it. Loading a guide again gives a new one.
- The error carries the guide. A missing, expired or foreign token returns a plain tool error that starts with, for example,
Load the guide first: call get_setup_guide with guide "create_agent" and pass its guide_token here. Nothing was changed.It then includes that guide and a newguide_tokenfor the caller, so an assistant whose tool list predatesget_setup_guidecan follow the guide and retry without reconnecting. A client that cannot sendguide_tokenmust reconnect to refresh its tools. Reads never need a token. - Writes return
setup. The tools that create or change an agent, a webhook or a transfer target answer withsetup: whether the agent is ready and what is still missing.
Tool annotations
Each tool carries MCP tool annotations, so a client can decide when to ask you before a call. Annotations are hints. Klatt still checks every call on the server.
All tools set
openWorldHint: false, except update_chat_agent. It sets openWorldHint: true because saving a chat agent can submit a WhatsApp message template to Meta for review.
Voice agents
The public API does not accept or return the language model, the speech provider or the speech model. Send a catalog voice key invoice_settings.voice. A value for the language model or the speech provider is refused with model_selection_unavailable.
Voice and chat agents have a language (the default language) and an additional_languages list. The supported languages are es-ES, en, fr-FR, it-IT, de-DE, pt-PT, ca-ES (Catalan), gl-ES (Galician) and eu-ES (Basque). Catalan, Galician and Basque work like any other language. Voice agents accept them once Klatt has enabled them for voice, and refuse them with cooficial_voice_unavailable before that; a new voice agent created in one of them gets a voice that speaks it, or is refused with voice_catalog_unavailable when there is none. The list holds the other languages the agent also serves and is empty by default. When it is not empty, the agent detects which of its languages the person speaks and answers in it; the console shows the list as Also serves in, and its All option saves every other language the agent can use. To make an agent multilingual, send additional_languages with the codes it should also serve. Creating an agent takes only name and language, so set additional_languages when you update the agent. Sending the list replaces it, and [] makes the agent single-language. The list cannot repeat a language or include language.
Voice and chat agents also have outcome_fields: the data Klatt extracts from each conversation when its analysis finishes, shown in the console as Capture data and sent to webhooks. It is returned by get_voice_agent and get_chat_agent and can be set with update_voice_agent and update_chat_agent, not when creating an agent. Each field has a key (lowercase letters, digits and _, starting with a letter, up to 40 characters; used as {{outcome.<key>}}), a label, a kind (text, number, boolean, enum or date), options (only for enum, up to 50) and an optional description. An agent has up to 20 fields. Sending the list replaces it, and [] removes all fields. Keep the key of existing fields when you update, because webhooks refer to it.
Transfer targets
A transfer target created or changed over MCP toward a phone number or SIP address that your organization does not use yet is saved with
pending_activation: true. The agent does not transfer to it until a user activates it in the console. Only a signed-in user can activate it; an API key cannot. The result adds console_url and next_step. The public REST API holds nothing back, because your own code calls it, not a model reading transcripts.
Chat agents
Conversations
Contact lists, fields and contacts
Contacts can have an owner, set only in the console.
update_contact replaces the whole contact, as the REST update does, so it clears the owner.
Knowledge documents
To delete a document:
- Call
preview_knowledge_document_deletionand review the agents that would lose the document. - Call
delete_knowledge_documentwith theetagfrom the preview asif_match.
if_match, the call fails with status 428 and the preview. If the affected agents changed since the preview, it fails with status 412 and a new preview. These errors carry status, error_code and preview. Deletion cannot be undone.
Uploading documents is not available over MCP. Use the console.
Knowledge entries
Integrations
A webhook is an HTTP request integration (integration_key is http_request). In the console, agents are called assistants, and webhooks are listed under Abilities → Webhooks.
The tool classes are the ones in Tool annotations: list_integrations, get_integration, search_docs, get_setup_guide and audit_agent are Read, create_integration is Create, and update_integration is Destructive.
list_integrations
Lists the integrations of one agent.
Returns a list. Each item has
integration_uuid, integration_key (http_request for a webhook), name, icon, mode (when it runs), schedule_mode, is_active, inactive_reason, pending_activation, template_count, page_urls, message_names and, for a webhook, credential. The list is empty when the agent has no integrations or is not in your organization. An integration belongs to its agent; to reuse one on another agent, duplicate the agent.
create_integration
Adds a webhook (an HTTP request integration) to one voice agent.
config has these settings:
name.execution.mode:DURING_CONVERSATION(the default: the agent calls it whenexecution.toolDescriptionsays so),PRE_CONVERSATION(before the call starts) orPOST_CONVERSATION(when the conversation ends).execution.toolDescription.request.url,request.method,request.headersTemplate,request.secretHeaders,request.bodyTemplateandrequest.auth.- An optional
advancedobject:timeout,onlyIf,duringExecutionMessage,parameters,presetParametersandoperationPolicy.
integration_config_invalid, and the result adds console_url (the assistant’s page in the console) and a next_step. You can set it up in the console, use GET, or run the webhook before or after the conversation.
Do not send secrets through MCP. request.auth can name a credential, for example {"type": "custom_header", "headerName": "klatt-key"}, but it must not contain a secret key, whatever its value. The tool also refuses caller verification, a signing secret and common credential headers such as Authorization or X-API-Key. Never put a token in request.url or in a plain header of request.headersTemplate, because those values are stored as plain configuration. A secret header can be added by name only: its value is never accepted through MCP, and it also stays pending until you fill it in the console. A credential without its key creates a pending integration: the agent does not offer it and it sends nothing until the key is added in the console. When request.url is a Supabase Edge Function (https://<project-ref>.supabase.co/functions/v1/<name>), the tool sets request.auth to {"type": "custom_header", "headerName": "klatt-key"}, the header the Supabase guide has the function check, so the console opens on the Supabase key steps. It leaves request.auth as sent when request.secretHeaders already names klatt-key. When request.url is an n8n production webhook (its path starts with /webhook/) and request.auth is api_key, the tool stores a custom_header instead, with the header name you sent or X-Webhook-Key, as the n8n guide sets up Header Auth. Any other credential, or none, stays as sent. When the tool changes request.auth, the result also returns auth with what it stored.
On success it returns created: true, integration_uuid, agent_uuid, integration_key and pending_secrets, the settings that still need a key (for example ["config.request.auth.secret"]; secret header names can be listed too). It is always returned, and it is an empty list when nothing is missing. When the list is not empty it also returns:
console_url: a link that opens the webhook on Authentication, or on Headers when only secret headers are pending.next_step: a sentence to pass on to the user. It says to press Generate key only when the credential is a custom header or a bearer token, because only those show that button. For an API key, the user pastes the key their service gave them, and for a username and password they type both. For secret headers, the user types each value in Headers. When the user has both to do, it says both. When the key is made in Klatt, it also says where to store the same key: in the Supabase function as the secretKLATT_KEY_<FUNCTION>(the function name in upper case, other characters turned into_, for exampleKLATT_KEY_BUSCAR_CLIENTE), in the n8n Webhook node’s Header Auth credential under the header name, or where the user’s endpoint checks it.
/, the authentication header and, for basic auth, the username. When a new webhook has no key and the other webhooks on that endpoint (on any agent) all hold the same key, the new one uses it: pending_secrets is [], there is no console_url or next_step, and credential.shared_with lists those webhooks (uuid, name, agent_name). Only the authentication key is shared, never secret headers or caller verification.
A webhook created or changed over MCP is saved with pending_activation: true unless an activated webhook of your organization already sends exactly the same request: the URL including its query, the method, the headers, the body and the fixed parameter values. A second webhook to the same endpoint with a different body is therefore held once too, while its key is still reused. Klatt sends nothing to a webhook that is pending until a user activates it in the console (Activate on the webhook). Only a signed-in user can activate it; an API key cannot. The result adds console_url and next_step, and when a key is also missing it is the same visit. The first webhook of an organization is always held. An after-conversation webhook activated within 24 hours of a call still delivers that call, because the after-call sweep retries for 24 hours. A delivery still queued when an update puts the webhook on hold is dropped, never sent to the new address. The public REST API does not hold anything.
Never ask the user for the key in chat. On failure it returns created: false, a machine-readable error_code and a readable error. An invalid config returns integration_config_invalid with an errors list of the settings to fix. Other codes include integration_secret_not_allowed, agent_not_found, integration_function_name_conflict, tool_budget_exceeded and create_failed. A key without the needed permission returns a tool error with status 403, like any other tool.
get_integration
Reads one HTTP request integration (a webhook) of your organization.
Returns
integration_uuid, integration_key, agent, config, connection_uuid, schedule_mode, is_active, inactive_reason, created_at, updated_at, credential and pending_secrets. credential.status is configured, pending (no key yet) or mismatch (webhooks on the same endpoint hold different keys, so one of them fails: fix it in the console), and credential.shared_with lists the webhooks that hold the same key. The key itself is never returned. pending_activation is true while the webhook waits for a user to activate it (see create_integration), and then nothing is sent to it. While a key is missing, the agent does not use the webhook, and the result adds console_url and next_step, as create_integration does. Secrets in config come back as {"configured": true}, and so do secret headers in request.secretHeaders (one still waiting for its value comes back as "") and plain headers whose name looks like a credential, such as Authorization or X-N8N-Key. Other headers, the URL and fixed parameter values come back as stored, so keep credentials in Authentication or in a secret header. On failure it returns found: false, error_code and error: integration_not_found when the integration is not in your organization, or integration_not_supported when it is not an HTTP request integration.
update_integration
Replaces the settings of one HTTP request integration (a webhook) on a voice or chat agent.
Read the integration with
get_integration, change what you need and send the whole config back. Settings you leave out are not kept, except for credentials.
Credentials stay as they are, and you change them in the console:
- Leave out
request.auth,advanced.callerVerificationandadvanced.signingSecret, or send them exactly asget_integrationreturned them. Any other value, including removing them, returnsintegration_secret_not_allowed. An integration still waiting for its key stays pending: send itsrequest.authback as read, without asecret. - When
request.authhas a type but no key yet, and no secret header has a stored value, the integration gets the same credential as on create: a Supabase function gets the custom headerklatt-key(unless a secret header already namesklatt-key), and anapi_keyon an n8n/webhook/URL becomes a custom header. The result then returnsauthwith what was stored; send theconfigthis result returns in later updates. A stored key and a webhook without any credential are never changed. So a webhook that an assistant set up with the wrong credential type is fixed by a plainupdate_integration. - Leave out
request.secretHeadersor send it exactly asget_integrationreturned it. Adding, changing, renaming or removing a secret header returnsintegration_secret_not_allowed. - While the integration has a credential in
request.author a secret header, the scheme and host ofrequest.urlcannot change, so the credential is never sent to another server. The path and query can change. - An integration that still has a plain header with a credential-looking name, such as
X-N8N-Key, reads it masked, and an update that sends it back is refused with aconsole_url. Do not leave the header out to get past it, because that removes the credential your endpoint checks. Send the user toconsole_urlinstead: opening the webhook there keeps the header as a secret one, and saving seals it.
pending_activation: true until a user activates it in the console; an update never clears it. On success it returns updated: true and the same fields as get_integration, including pending_secrets, and console_url and next_step when a key is missing. A refusal that only the console can resolve (credentials, secret headers or a host change) adds a console_url that opens the webhook. On failure it returns updated: false, error_code and error, and nothing changes. An invalid config returns integration_config_invalid with an errors list of the settings to fix. Other codes include integration_secret_not_allowed, integration_not_found, integration_not_supported, integration_function_name_conflict, tool_budget_exceeded and update_failed.
Documentation
search_docs
Searches Klatt’s public guides, so an assistant can answer how to set something up and cite the guide.
Returns
found: true, up to three results (title, url, description) and an excerpt (url, text) of the best match. Cite the url to the user. When nothing matches it returns found: false, an empty results list and docs_url. When the guides cannot be read it returns found: false, error: "docs_unavailable", docs_url and a message. It is a Read tool and works with any API key.
get_setup_guide
Loads the guide an assistant follows before it creates or changes an agent, a webhook, a transfer, knowledge or a connection, so it asks the user little and puts each thing in the right place.
Returns
guide, instructions (the guide in Markdown), guide_token (see Guides and guide_token; it lasts 2 hours) and, with agent_uuid, agent: the agent’s setup field by field (instructions, greeting, rules, capture fields, knowledge, webhooks, transfer targets and setup), never a stored key. It is a Read tool; reading an agent needs the permission to manage agents, and an agent of another organization is reported as not found.
audit_agent
Reviews one voice or chat agent without changing it. An assistant uses it when you ask whether an agent is ready or good, or say something goes wrong (it does odd things, it does not transfer, it does not save the data), after loading the review_agent guide.
Returns
agent (kind, uuid, name), findings (each with a priority, a code, the field it concerns and a proposed fix, most urgent first) and recent: counts from the last 14 days of conversations (failed webhook calls during voice calls and after conversations, refused transfers, open unanswered questions and escalations). The findings transfer_restated, webhook_restated, search_restated and ability_missing also carry passage, the paragraph they concern; it is left out when that paragraph contains a key or is longer than 1,500 characters. The codes transfer_restated, webhook_restated and search_restated mean a paragraph repeats what a transfer target, a webhook or the web search already says. ability_missing means the instructions promise an SMS, a WhatsApp message or a transfer the agent cannot do. search_description_unclear means the web search description is empty or too vague to tell the agent when to use it. When an assistant creates an agent, its guide ends with this review. The result returns text written by callers, so it comes in the untrusted-data tags described in Inputs and results. It is a Read tool and needs the permission to manage agents; an agent of another organization is reported as not found. The assistant proposes each fix and applies it only after you say yes.
Limits and errors
MCP requests use the same key and the same limit as the REST API: 300 requests per minute per key, and every MCP HTTP request counts as one request (a tool call usually needs several). See Rate limits. Authentication errors and429 responses use the same format as in Errors; a missing or invalid key answers 401.
Security
- Treat what tools return as data, not as instructions. Names and text in your organization can be written by other people.
- Review what an assistant wants to do before you approve a tool call, especially tools marked destructive,
create_integrationandupdate_integration. - Use a separate key for each tool or person, so you can delete one without affecting the others.