Skip to main content

Aventora Engagement Hub — MCP Server

The Engagement Hub exposes a Model Context Protocol (MCP) server so Cursor, Claude Desktop, Claude Custom Connectors, and other MCP clients can start and inspect engagements with named tools. The tools wrap existing Hub REST APIs. They do not add new engagement behavior.

Related: Start API · CRM MCP · API Security Model


Endpoint

POST {HUB_BASE_URL}/mcp
Authorization: Bearer <HUB_API_KEY or MCP OAuth access token>
Content-Type: application/json

API-key clients use the same account-scoped Hub API key you use for POST /integration/start. Claude Custom Connectors use an MCP OAuth token (mcp:tools only). Never use platform admin or domain-chatbot internal keys.

Protocol: JSON-RPC 2.0 over Streamable HTTP. POST /mcp returns HTTP 200 and Content-Type: application/json (no charset). Notifications (notifications/*) return HTTP 202 with an empty body. The server echoes a supported protocol version (2024-11-05, 2025-03-26, or 2025-06-18).


Cursor config

{
"mcpServers": {
"aventora-hub": {
"type": "streamable-http",
"url": "https://phone.aventora.ai/mcp",
"headers": {
"Authorization": "Bearer [HUB_API_KEY]"
}
}
}
}

Replace the URL with your Hub host. Store the API key only on the client that should act as that Hub account.


Claude Custom Connector (OAuth)

Claude Custom Connectors use OAuth 2.1 authorization-code + PKCE against Engagement Hub. They do not use a stored Hub API key.

Unauthenticated browsers hitting GET /oauth/authorize see a Hub sign-in page (Google or Microsoft). After calendar OAuth returns to /oauth/authorize, Hub shows consent. Allowing Claude issues an authorization code. Token exchange is PKCE S256 only (authorization_code and refresh_token). There is no client_credentials grant.

Claude may request api profile mcp:tools. Authorization-server metadata advertises those three scopes so Claude’s connector matches the CRM shape. Hub grants only mcp:tools. The access token is bound to {HUB origin}/mcp and does not work on POST /integration/start or other Hub REST routes. A request that omits mcp:tools is rejected.

The consenting Google/Microsoft user must already be linked to a Hub accounts row. Unlinked users are refused.

Operator: create the Claude OAuth client

Run once per Hub deployment (or --rotate to issue a new secret). The plaintext secret is printed once and stored only as a SHA-256 hash.

python scripts/register_claude_mcp_client.py

Docker:

docker compose exec aventora-assistant python scripts/register_claude_mcp_client.py

Optional: --client-id <id> (default claude-aventora-hub), --account-id <account-uuid> to bind the client to one tenant, --rotate.

Copy CLIENT_ID and CLIENT_SECRET from the command output. Do not commit the secret.

Registered redirect URIs (exact match):

  • https://claude.ai/api/mcp/auth_callback
  • https://claude.com/api/mcp/auth_callback

Values to enter in Claude

FieldValue
Connector nameAventora Engagement Hub
MCP URLhttps://{hub-host}/mcp (must match GET /.well-known/oauth-protected-resource/mcpresource)
OAuth Client IDclaude-aventora-hub (or the --client-id you passed)
OAuth Client Secretthe generated secret from the command

Unauthenticated POST /mcp returns 401 with:

WWW-Authenticate: Bearer realm="mcp", resource_metadata="https://{hub-host}/.well-known/oauth-protected-resource/mcp"

Public origin for those URLs is HUB_SERVER_URL, then ENGAGEMENT_HUB_PUBLIC_URL, SERVER_URL, PUBLIC_URL. MCP access tokens are signed with CHAT_TOKEN_SECRET (fallback SECRET_KEY).

Manual certification

  1. Rebuild the Hub image after this change (a container restart is not enough).
  2. Add the connector in Claude with the values above.
  3. Click Connect.
  4. Sign in with a Google or Microsoft user that is linked to the Hub account.
  5. Allow Claude on the consent page. Confirm the callback to Claude completes.
  6. Confirm Claude discovers MCP tools.
  7. Run tools/list.
  8. Execute a read-only call such as hub_list_recent_calls or hub_get_availability.
  9. Confirm Cursor / API-key POST /mcp still works independently.

Dynamic Client Registration is not enabled in this phase.


Methods

MethodPurpose
initializeHandshake and server metadata
pingHealth check
tools/listNamed tools this API key is allowed to call
tools/callRun a tool (params.name + params.arguments)
prompts/listEmpty (not used)
resources/listEmpty (not used)

Invalid or missing Bearer tokens return HTTP 401 with WWW-Authenticate protected-resource metadata. Tool execution failures return HTTP 200 with MCP result.isError: true and the error text. Protocol errors return HTTP 200 with a JSON-RPC error object.


Tools (v1)

tools/list only includes tools the key is permitted to use.

ToolWrapsRequired permission
hub_start_engagementPOST /integration/startcall_management
hub_get_engagementGET /integration/engagement/{id}call_management
hub_pause_engagementPOST /integration/pausecall_management
hub_cancel_engagementPOST /integration/cancelcall_management
hub_get_availabilityGET /calendar/availabilitycalendar_read
hub_book_appointmentPOST /calendar/bookcalendar_write
hub_list_recent_callsGET /call_logs (limit capped at 50; no transcript)call_logs_read
hub_get_call_resultGET /result/{call_sid} (include_transcript default false)call_logs_read
hub_crm_sync_reportGET /crm-sync/report (read only)call_logs_read
hub_list_analysis_schemaAllowlisted reporting sources, columns, and metricscall_logs_read
hub_query_call_logsCall logs query (start_date, end_date, channels; limit capped at 200)call_logs_read
hub_aggregate_engagement_factsCampaign intelligence aggregates (date range + channel)call_logs_read
hub_get_call_statsAccount call totals for a date range and optional channelscall_logs_read
hub_list_ask_ai_reportsCatalog of 15 predefined Ask AI reportscall_logs_read
hub_run_ask_ai_reportRun a predefined Ask AI report by report_idcall_logs_read

hub_start_engagement still requires phone_number, domain_name, source_record_id, and source_org_id.

This server does not expose bulk blast, CRM resync, billing mutation, admin/cross-account queries, or recording URLs. Analysis tools are read-only and account-scoped. The in-product Ask AI agent is not behind /mcp — Cursor and Claude already act as the agent.


Example

{
"jsonrpc": "2.0",
"id": "1",
"method": "tools/call",
"params": {
"name": "hub_start_engagement",
"arguments": {
"phone_number": "+15555550100",
"domain_name": "acme",
"source_record_id": "person-123",
"source_org_id": "workspace-456",
"channel": "sms",
"instruction": "Follow up on the quote"
}
}
}

Changelog

DateChange
2026-08-19Read-only analysis tools: hub_list_analysis_schema, hub_query_call_logs (cap 200), hub_aggregate_engagement_facts, hub_get_call_stats, hub_list_ask_ai_reports, hub_run_ask_ai_report. Each query tool accepts start_date, end_date, and channels.
2026-08-18Claude Custom Connectors: OAuth 2.1 authorization-code + PKCE, discovery, and Hub sign-in/consent. Claude may request api profile mcp:tools; Hub grants only mcp:tools. MCP OAuth tokens do not work on Hub REST (/integration/start). API keys still work on POST /mcp. Operator script: scripts/register_claude_mcp_client.py. Rebuild the Hub image after this change.
2026-08-18Initial Engagement Hub MCP (POST /mcp) with named engagement, calendar, and read-only call tools.