Ir al contenido

Estas fiestas, no te pierdas ningún mensaje: reconexión gratis

Elegir un plan

The API docs are available in English, Romanian and Russian. This is the English version.

MCP (AI agents)

MCP: aichat.md in your AI agent

Connect your aichat.md account to Claude, ChatGPT, Cursor or any MCP client and run it in plain words: leads, conversations, agents and knowledge.

What MCP is

MCP (Model Context Protocol) is an open standard that lets an AI assistant use outside tools. aichat.md runs an MCP server for every account: once you connect it, your assistant (Claude, ChatGPT, Cursor…) can read your leads and conversations and act in your account when you ask it to, in plain words, without code.

Server URLhttps://aichat.md/api/public/v1/mcp
TransportStreamable HTTP (POST, JSON answers, no session)
ProtocolMCP 2026-07-28 (stateless, server/discover) and 2025-11-25 / 2025-06-18 / 2025-03-26
Sign-in (OAuth 2.1)Client ID Metadata Documents (preferred) or dynamic registration; PKCE S256
LoginOAuth (claude.ai, ChatGPT) or an API key in the Authorization: Bearer aik_live_… header
Toolsevery API operation, filtered by the key's permissions

What you can ask

  • “What new leads came in today? Group them by channel.”
  • “Show me the conversations waiting for an operator.”
  • “Take over the conversation with Ana and tell her I will call her in 10 minutes.”
  • “Mark lead Ion Rusu as qualified and tag him vip.”
  • “Pause the sales agent: we are closed for inventory today.”
  • “Add our pricing page https://example.com/prices to the agent's knowledge.”
  • “How many credits do I have left?”

The assistant picks the right tools by itself. Before any change (sending a message, pausing an agent, editing a lead) most clients ask you to confirm.

Connect in 2 minutes

claude.ai (and Claude Desktop) — custom connector

  1. In Claude open Settings → Connectors and click Add custom connector.
  2. Name: aichat.md. URL: https://aichat.md/api/public/v1/mcp. Save.
  3. Click Connect: an aichat.md window opens. Log in with your aichat.md account.
  4. On the consent page check the workspace and choose the permissions (only reading is ticked by default), then Allow access.
  5. In a chat, turn on the aichat.md tools from the tools menu and ask your question.

Behind the scenes OAuth creates a normal API key named MCP: <app name> with exactly the permissions you approved. Only the workspace admin (or the account owner) can approve. On Claude Team and Enterprise plans an owner may need to add the connector for the organisation first.

Claude Code

Create a key in Settings → Developers (section AI connectors (MCP)) and keep it in the AICHAT_API_KEY environment variable, then:

claude mcp add --transport http aichat https://aichat.md/api/public/v1/mcp \
  --header "Authorization: Bearer $AICHAT_API_KEY"

# check it: the server should show as connected
claude mcp list

Cursor and Claude Desktop (config file)

Cursor reads remote servers straight from .cursor/mcp.json. Claude Desktop's config file only starts local programs, so it goes through the mcp-remote bridge (Node.js 18+). Without a config file, the custom connector above works in Claude Desktop too.

{
  "mcpServers": {
    "aichat": {
      "url": "https://aichat.md/api/public/v1/mcp",
      "headers": { "Authorization": "Bearer aik_live_…" }
    }
  }
}

ChatGPT

  1. In ChatGPT open Settings → Apps & Connectors → Advanced settings and turn on Developer mode (on plans that offer it).
  2. Click Create, give it a name (aichat.md), paste the URL https://aichat.md/api/public/v1/mcp and choose OAuth authentication.
  3. Log in to aichat.md, choose the permissions and click Allow access, as for Claude.
  4. In a chat, enable the connector from the + menu (developer mode) and ask.

Any other MCP client

Any client that speaks Streamable HTTP works: give it the URL and either OAuth or the Authorization: Bearer header. To check the server from a terminal:

curl https://aichat.md/api/public/v1/mcp \
  -H "Authorization: Bearer $AICHAT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "initialize",
       "params": {"protocolVersion": "2025-06-18", "capabilities": {},
                  "clientInfo": {"name": "curl", "version": "1.0"}}}'

Security

  • Same key, same rules. An MCP connection is an ordinary API key: same permissions, same limits, same idempotency.
  • Permissions decide the tools. A key with only leads:read sees only the lead-reading tools (and get_me); the assistant cannot even see the rest. Start read-only and add :write permissions only when you need them.
  • Isolation. Every action runs inside the workspace that owns the key; another account's data answers 404, as if it did not exist.
  • Revoke at any time. Connections appear in Settings → Developers as keys named MCP: …. Revoke one and the assistant loses access immediately. Every new connection sends a security e-mail. Keys created by connecting expire after 90 days; the assistant then asks you to reconnect.
  • Nothing hidden. The assistant can only do what the API can do; there are no extra MCP-only powers.

Assistants can be tricked by text they read (a customer message, a web page) into calling tools you did not intend. Keep write permissions to the minimum and read the confirmation before approving a change.

Available tools

Each operation of the API reference is one tool, named after its operationId in snake_case. New API operations show up in MCP automatically.

AreaToolsPermission
Accountget_me—
Agentslist_agents, get_agent, update_agent, pause_agent, resume_agentagents:read / agents:write
Conversationslist_conversations, get_conversation, list_messages, send_message, handoff_conversation, release_conversationconversations:read / conversations:write
Leadslist_leads, get_lead, update_leadleads:read / leads:write
Contactslist_contacts, get_contact, update_contactcontacts:read / contacts:write
Channelslist_channels, get_channelchannels:read
Knowledgelist_knowledge_sources, get_knowledge_source, create_knowledge_source, archive_knowledge_sourceknowledge:read / knowledge:write
Webhooks and eventslist_webhook_endpoints, create_webhook_endpoint, get_webhook_endpoint, update_webhook_endpoint, delete_webhook_endpoint, rotate_webhook_secret, test_webhook_endpoint, list_webhook_deliveries, list_events, get_eventwebhooks:manage

Tool arguments are the path and query parameters, plus body for the JSON body and an optional idempotency_key on actions. Reading tools are marked read-only; delete_webhook_endpoint is marked destructive. The server also offers a few ready-made prompts (new leads today, conversations waiting for an operator, account summary).

Troubleshooting

SymptomWhat to do
401 / “authentication failed”The key is missing, wrong, expired or revoked. Reconnect the connector or create a new key.
A tool is missingThe key lacks that permission. Reconnect and tick it, or create a key with that scope. Some clients cache the tool list: restart them.
403 scope_missing in a tool resultSame cause: the action needs a permission the key does not have.
The consent page refusesOnly the workspace admin or the account owner can approve a connection.
405 on connectThe client uses the old SSE transport. Choose Streamable HTTP (or update the client).
403 “Origin not allowed”A browser page on another site called the server. Call it from an MCP client or your backend.
429 / “rate limited”The API limits apply (120 requests/minute per key). Ask for fewer items at once or wait a minute.
“Response truncated”Results over 1 MB are cut. Use limit and filters (e.g. status, updated_after).
Claude Desktop shows no toolsCheck that Node.js 18+ is installed (npx must work) and restart Claude Desktop after editing the file.
NextZapier