MCP Server
The Aimdoc MCP server is available on the Convert plan only, using the same credentials as the External API.
Aimdoc exposes a remote Model Context Protocol (MCP) server so AI assistants like Claude can read your account data — conversations, contacts, visitor profiles, and activity timelines — directly in chat.
Use it to ask questions like "How did this week go?", "Show me recent leads from Acme Corp", or "What did this visitor do before they booked a demo?"
Overview
Server URL:
https://api.aimdoc.ai/mcp
The server uses Streamable HTTP transport and exposes read-only tools backed by the same data layer as the External API. All tools are annotated as read-only — the MCP server does not modify your Aimdoc data.
When connected, your assistant can:
- Summarize activity with aggregate counts
- Search and read conversation transcripts
- Look up captured contacts and leads
- Explore visitor profiles and enrichment data
- Review visitor journeys and on-site activity
Connect with Claude
The recommended way to connect is through an MCP client that supports OAuth 2.1, such as Claude or Claude Code.
- In your MCP client, add a remote MCP server with URL
https://api.aimdoc.ai/mcp - The client discovers Aimdoc's OAuth endpoints automatically and starts the authorization flow
- Sign in to your Aimdoc dashboard if prompted
- Review the consent screen and approve access for your organization
- The client receives an access token and can call MCP tools on your behalf
During consent, you grant read access to conversations, contacts, and visitor data for your organization.
OAuth access tokens expire after 1 hour. MCP clients that support refresh tokens will rotate them automatically. You can revoke access at any time from your Aimdoc dashboard.
If you are testing locally, the MCP server is also available at http://localhost:8000/mcp when running the Aimdoc backend in development.
Connect with an API key
For custom MCP clients or programmatic access, authenticate with an API key instead of OAuth.
Server URL:
https://api.aimdoc.ai/mcp
Authorization header:
Authorization: Bearer ak_your_api_key_here
Create an API key the same way as the REST API:
- Go to Integrations
- Open API Keys
- Click Create new key
- Copy and store the key securely
You can only view your API key at the time of creation. Save it securely — you won't be able to view it again.
API keys share the same rate limits and data access as OAuth tokens.
Available tools
The server exposes eight read-only tools. Start with get_usage_summary for aggregate questions, then drill into specific records.
get_account_info
Confirm which Aimdoc organization the connection is authenticated as. Returns the organization id, name, and created_at.
No parameters.
get_usage_summary
Get aggregate activity counts for a date range: total conversations, conversations with visitor interaction, contacts created, and journey event counts by type (meetings booked, escalations, buyer intent, and more).
| Parameter | Description |
|---|---|
start_date | Start of range (YYYY-MM-DD). Defaults to 30 days ago. |
end_date | End of range (YYYY-MM-DD). Defaults to today. |
This tool is available on MCP only — there is no matching REST endpoint.
search_conversations
Search chat sessions between your AI sales agent and website visitors. Results are newest first and paginated.
| Parameter | Description |
|---|---|
start_date, end_date | Date range (YYYY-MM-DD). Default: last 30 days. |
agent_id | Filter by agent. |
contact_id | Filter by contact. |
visitor_id | Filter by visitor. |
page, per_page | Pagination (max 100 per page). |
REST equivalent: GET /api/v1/conversations
get_conversation
Get one conversation with its full message transcript in chronological order. Use conversation IDs from search_conversations.
| Parameter | Description |
|---|---|
conversation_id | Required. The conversation to fetch. |
REST equivalent: GET /api/v1/messages?conversation_id=... (MCP bundles conversation metadata and messages together).
search_contacts
Search contacts who shared their details — name, email, company — with your agent.
| Parameter | Description |
|---|---|
search | Match name, email, or company. |
start_date, end_date | Filter by contact creation date (YYYY-MM-DD). Default: last 30 days. |
agent_id | Filter by agent. |
page, per_page | Pagination (max 100 per page). |
REST equivalent: GET /api/v1/contacts
list_visitor_profiles
List visitor profiles with identity and company enrichment, whether or not the visitor became a contact.
| Parameter | Description |
|---|---|
search | Match person, company, or contact fields. |
contact_id | Filter by associated contact. |
first_seen_after, first_seen_before | Filter by first seen date (YYYY-MM-DD). |
last_seen_after, last_seen_before | Filter by last seen date (YYYY-MM-DD). |
page, per_page | Pagination (max 100 per page). |
REST equivalent: GET /api/v1/visitor-profiles
get_visitor_profile
Get the full profile for one visitor: person identity, company enrichment, referrer context, associated contact, and latest conversation.
| Parameter | Description |
|---|---|
visitor_id | Required. Use IDs from list_visitor_profiles, search_conversations, or get_visitor_journey. |
REST equivalent: GET /api/v1/visitor-profiles/{visitor_id}
get_visitor_journey
Get a visitor's activity timeline: journey events (session started, contact created, meeting booked, escalation, buyer intent, identification) and browser activity (page views, clicks).
| Parameter | Description |
|---|---|
visitor_id | Provide exactly one of visitor_id or conversation_id. |
conversation_id | Provide exactly one of visitor_id or conversation_id. |
start_date, end_date | Date range (YYYY-MM-DD). Default: last 30 days. |
Returns the most recent 50 of each event kind. Check each section's pagination.total to see if more events exist.
REST equivalent: GET /api/v1/visitor-journey-events and GET /api/v1/browser-events (MCP merges both into one response).
Authentication
The MCP server is an OAuth 2.1 resource server. It accepts two types of bearer tokens:
| Token type | Prefix | How to obtain |
|---|---|---|
| OAuth access token | oat_ | Authorize through an MCP client (recommended for Claude) |
| API key | ak_ | Create in Integrations → API Keys |
Both token types grant the api scope and access the same organization data.
Discovery endpoints
MCP clients use these well-known URLs to discover authentication:
GET https://api.aimdoc.ai/.well-known/oauth-protected-resource/mcp— protected resource metadataGET https://api.aimdoc.ai/.well-known/oauth-authorization-server— authorization server metadata
Unauthenticated requests to /mcp return 401 with a WWW-Authenticate challenge pointing clients to these discovery documents.
Rate limits
MCP tool calls share the same rate limits as the External API:
- 1,000 requests per hour
- 10,000 requests per day
Limits are tracked per credential (API key or OAuth token family). When a limit is exceeded, the tool returns an error with a retry hint rather than an HTTP 429 response.
Related docs
- API & Webhooks Overview for REST API authentication and endpoints
- Webhooks Guide for real-time event delivery
- API Reference (Redoc) for full REST schemas and examples