MCP Integration (Claude Desktop & Cursor)

Expose your Chatsby AI agent as a tool to Claude Desktop, Cursor, and any MCP-compatible host using the Model Context Protocol (MCP).

MCP Integration

The Model Context Protocol (MCP) is an open standard that lets AI hosts like Claude Desktop and Cursor connect to external tools and data sources. With Chatsby's MCP endpoint, you can expose your trained AI agent directly to any MCP-compatible client — so developers, support teams, and power users can query your agent from inside their own AI workflow.

MCP Endpoint: https://chatsby.co/api/mcp

This endpoint implements the MCP JSON-RPC 2.0 specification over HTTP. It is available on all Chatsby plans.

What You Can Do

Once your agent is connected via MCP, any MCP client gains access to the following tools:

ToolDescription
chat_with_agentSend a message to your agent and receive a response. Maintains conversation history across turns.
create_agentCreate a new agent in your Chatsby workspace.
update_agentUpdate an agent's name, description, or status.
list_agentsList all agents in your workspace.
get_agentFetch details for a specific agent by ID.
list_conversationsList recent conversations for an agent, with optional status/channel filters.
get_conversation_messagesRetrieve the message history for a specific conversation.
get_analyticsPull conversation counts, event breakdowns, and daily activity data.

Step 1: Generate an API Key

  1. Go to your agent's dashboard and open the Integrations tab.
  2. Scroll to the MCP (Claude Desktop) card.
  3. Click Generate API key.
  4. Copy the generated key — you will use it in the next step.

Your API key is scoped to the agent it was created for. All MCP requests made with that key will use that agent's knowledge base, personality, and configuration.

Step 2: Add to Claude Desktop

Open (or create) the Claude Desktop configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the following block, replacing YOUR_API_KEY with the key you copied:

{
  "mcpServers": {
    "chatsby": {
      "url": "https://chatsby.co/api/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

Save the file and restart Claude Desktop. The Chatsby tools will appear automatically in Claude's tool list.

The Copy Claude Desktop config button in the Integrations dashboard generates this JSON with your API key already filled in, so you can paste it directly.

Step 3: Add to Cursor

In Cursor, open Settings → Features → MCP and add a new server:

  • Name: chatsby
  • Type: http
  • URL: https://chatsby.co/api/mcp
  • Header — Authorization: Bearer YOUR_API_KEY

Save and enable the server. Cursor will discover the available tools automatically.

Step 4: Chat with Your Agent

In Claude Desktop or Cursor, you can now call your agent directly:

Use the chat_with_agent tool to ask: "What is your return policy?"

The tool accepts:

ParameterTypeDescription
messagestring (required)The message to send to the agent.
conversation_idstring (optional)Pass an existing conversation ID to continue a thread. Omit to start a new conversation.

The response includes reply, conversation_id, and message_id so you can maintain multi-turn conversations across calls.

Authentication

Every MCP request must include your API key as a Bearer token in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Requests without a valid key return 401 Unauthorized. API keys can be revoked at any time from the Integrations dashboard.

Available Tools Reference

chat_with_agent

Send a message and receive a response from your trained agent.

{
  "method": "tools/call",
  "params": {
    "name": "chat_with_agent",
    "arguments": {
      "message": "How do I reset my password?",
      "conversation_id": "optional-existing-id"
    }
  }
}

Response:

{
  "reply": "To reset your password, visit the login page and click…",
  "conversation_id": "uuid",
  "message_id": "uuid"
}

get_analytics

Pull usage metrics for your agent.

{
  "method": "tools/call",
  "params": {
    "name": "get_analytics",
    "arguments": {
      "days": 30
    }
  }
}

Response:

{
  "period_days": 30,
  "total_conversations": 142,
  "by_event_type": [
    { "event_type": "message_sent", "count": 580 }
  ],
  "daily_activity": [
    { "date": "2026-04-30", "count": 12 }
  ]
}

Troubleshooting

Tools do not appear in Claude Desktop

Restart Claude Desktop after saving claude_desktop_config.json. The file must be valid JSON — use a JSON validator if you see parse errors.

401 Unauthorized

Your API key is missing, incorrect, or has been revoked. Generate a new key from the Integrations dashboard.

404 Not Found on agent tools

The API key is valid but the agent referenced cannot be found. This can happen if the agent was deleted. Regenerate the key from the correct agent's Integrations tab.

Responses seem outdated

The agent's knowledge base may need to be updated. Go to your agent's Sources tab and re-sync or re-upload your documents.