Connect HubSpot to Claude: Automate marketing blogs and support
Learn how to natively connect HubSpot to Claude using a managed MCP server. This guide covers setup, tool generation, and real-world AI automation workflows.
If you need to connect HubSpot to Claude to automate marketing campaigns, blog content, or customer support triage, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between Claude's JSON-RPC tool calls and HubSpot's REST APIs. You can either spend weeks building, hosting, and maintaining this infrastructure yourself, or use a managed MCP integration platform like Truto to dynamically generate a secure, authenticated MCP server URL. If your team uses ChatGPT, check out our guide on connecting HubSpot to ChatGPT or explore our broader architectural overview on connecting HubSpot to AI Agents.
Giving a Large Language Model (LLM) read and write access to a sprawling ecosystem like HubSpot is an engineering challenge. You have to handle OAuth 2.0 token lifecycles, map massive, nested JSON schemas to MCP tool definitions, and deal with HubSpot's specific CRM object association patterns. Every time you want to expose a new endpoint or update a custom field, you have to update your server code, redeploy, and test the integration.
This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for HubSpot, connect it natively to Claude Desktop, and execute complex workflows using natural language.
The Engineering Reality of the HubSpot API
A custom MCP server is a self-hosted integration layer. While the open MCP standard provides a predictable way for models to discover tools, the reality of implementing it against vendor APIs is painful. You are not just integrating "HubSpot" - you are integrating an evolving data model with highly specific interaction patterns.
If you decide to build a custom MCP server for HubSpot, you own the entire API lifecycle. Here are the specific challenges you will face:
The CRM Object Association Model
HubSpot does not use simple foreign keys. When you want to link a Contact to a Deal or a Ticket to a Company, you cannot just pass a contactId in the creation payload. You must use the CRM Associations API v3 or v4. This requires your MCP server to orchestrate multi-step sequences: create the object, parse the returned ID, look up the exact associationTypeId for that specific object relationship, and execute a secondary request to link them. If you expect the LLM to figure this out raw, it will fail constantly.
Complex Pagination and Search Parameters
HubSpot does not use standard offset pagination. It relies heavily on an after cursor and strict limit caps. Worse, the CRM Search API requires a highly specific nested JSON payload using filterGroups and filters to run queries. Exposing this raw search schema to Claude often results in hallucinated filter structures. A managed MCP server handles this translation, allowing Claude to pass standard inputs while the proxy layers format the specific HubSpot search payloads.
Strict Rate Limits and HTTP 429 Handling
HubSpot enforces strict API quotas - typically a 10-second burst limit (e.g., 100 or 150 requests) and a daily maximum. If an autonomous agent loops through thousands of blog posts or attempts to batch-update contacts too quickly, HubSpot will return a 429 Too Many Requests error. Crucially, Truto does not retry, throttle, or apply backoff on rate limit errors. When HubSpot returns a 429, Truto immediately passes that error to the caller. However, Truto normalizes the upstream rate limit information into standardized IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). This explicitly shifts the responsibility of retry and backoff logic to the caller (your agent framework or Claude), providing it with the exact mathematical parameters needed to pause and resume without getting permanently blocked.
Instead of building this routing, normalization, and token-refresh infrastructure from scratch, you can use Truto. Truto exposes HubSpot's endpoints as ready-to-use MCP tools, handling the OAuth state machine silently in the background.
How to Generate a HubSpot MCP Server with Truto
Truto dynamically generates MCP tools based on the existing documentation and resource definitions of your integrated accounts. There are two ways to provision an MCP server for HubSpot: through the dashboard or programmatically via the API.
Method 1: Via the Truto UI
For internal workflows, manual testing, or rapid prototyping, generating a server via the dashboard takes seconds.
- Navigate to the Integrated Accounts page in your Truto environment.
- Click on the connected HubSpot account you want to use.
- Click the MCP Servers tab.
- Click Create MCP Server.
- Select your desired configuration (name, allowed methods like
readorwrite, and specific resource tags). - Copy the generated MCP server URL (e.g.,
https://api.truto.one/mcp/a1b2c3d4e5f6...).
Method 2: Via the REST API
For production usage where you are provisioning AI agents for your end-users, you should generate MCP servers programmatically.
The API validates that the integration has documented tools available, generates a secure cryptographic token, stores it in Cloudflare KV, and returns a ready-to-use URL.
Endpoint: POST /integrated-account/:id/mcp
Request body:
{
"name": "HubSpot Marketing Agent MCP",
"config": {
"methods": ["read", "write"],
"tags": ["crm", "marketing", "support"]
},
"expires_at": "2026-12-31T23:59:59Z"
}Response:
{
"id": "mcp-7f8a9b2c",
"name": "HubSpot Marketing Agent MCP",
"config": {
"methods": ["read", "write"],
"tags": ["crm", "marketing", "support"]
},
"expires_at": "2026-12-31T23:59:59Z",
"url": "https://api.truto.one/mcp/a1b2c3d4e5f6..."
}This URL is fully self-contained. The token embedded in the path encodes the specific integrated account, environment, and filtering configuration.
How to Connect the MCP Server to Claude
Once you have the Truto MCP URL, you need to register it with your Claude client. The protocol dictates that on startup, Claude will send an initialize request to this endpoint to discover capabilities, followed by tools/list to pull the dynamic JSON schemas derived from HubSpot's API.
Method 1: Via the Claude UI
If you are using Claude Desktop (or configuring similar clients like ChatGPT with custom actions):
- Open the Claude application.
- Navigate to Settings -> Integrations (or Custom Connectors).
- Click Add MCP Server.
- Paste the Truto MCP URL you generated.
- Click Save.
Claude will immediately ping the endpoint, validate the JSON-RPC response, and populate its context window with the available HubSpot tools.
Method 2: Via Manual Configuration File
For headless deployments, CLI usage, or strict Claude Desktop configurations, you can edit the claude_desktop_config.json file directly to establish the Server-Sent Events (SSE) transport layer.
Add the following block to your configuration file:
{
"mcpServers": {
"hubspot_truto": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sse",
"https://api.truto.one/mcp/a1b2c3d4e5f6..."
]
}
}
}Restart Claude Desktop. The model now has direct read and write access to the specific HubSpot resources defined by your token's filters.
HubSpot Hero Tools for Claude
When Claude lists the tools available on the Truto MCP server, it receives dynamically generated schemas based on the integration's configuration. Tool names are converted to descriptive snake_case formats. Here are the highest-leverage tools available for HubSpot workflows.
Search Contacts (list_all_hub_spot_contacts_search)
Standard list endpoints are often insufficient for CRM lookups because they require the agent to paginate through thousands of irrelevant records. The search tool accepts specific property filters, allowing Claude to execute precise queries against the CRM database in a single network hop.
"Find all contacts in HubSpot where the domain is acmecorp.com and their lead status is Open."
Create a Deal (create_a_hub_spot_deal)
This tool allows the LLM to generate a pipeline deal based on unstructured conversation context. Because Truto manages the schema, Claude knows exactly which properties (like dealname, amount, and pipeline) are required to successfully execute the POST request without trial and error.
"Create a new deal for $50,000 in the Enterprise pipeline named 'Acme Corp Q4 Expansion'."
Update a Deal (update_a_hub_spot_deal_by_id)
Agents need to move deals through stages based on email analysis or meeting transcripts. This tool performs a partial update on the deal record, overwriting only the specified properties. If the model attempts to write to a read-only or non-existent property, it receives a clear error response to self-correct.
"Update the 'Acme Corp Q4 Expansion' deal to Closed Won and change the close date to today."
Log a Note (create_a_hub_spot_note)
Essential for syncing meeting summaries or support interactions back to the CRM. The note tool writes rich text data into the CRM timelines. When combined with association tools, Claude can log a call summary and instantly attach it to the relevant contact and company records.
"Draft a summary of my recent call transcript and save it as a note on John Doe's contact record."
Manage Blog Posts (list_all_hub_spot_blog_posts)
HubSpot is not just a CRM; it is a CMS. This tool exposes the marketing side of the platform, allowing AI agents to pull content, audit SEO metadata, and analyze historical publishing data. Claude can paginate through results using standard limit parameters.
"Fetch the last 10 published blog posts and analyze them for missing meta descriptions."
Create a Ticket (create_a_hub_spot_ticket)
For support ops, this tool transitions unstructured customer complaints into tracked pipeline items. Claude maps the intent of a message into the required subject and hs_pipeline_stage fields, automating the first level of triage.
"The customer is reporting a critical login failure. Create a high-priority support ticket in the technical support pipeline."
For the complete inventory of HubSpot tools - including schemas for Line Items, Quotes, Custom Events, and Webhooks - see the HubSpot integration page.
Workflows in Action
Giving Claude raw API access is powerful, but orchestrating multi-tool sequences is where MCP drives business value. Here is exactly how Claude handles complex, multi-step HubSpot requirements.
Scenario 1: Sales Meeting Triage
Persona: Account Executive
"I just had a great call with Sarah from Initech. Find her in HubSpot, log a note saying we discussed the new enterprise tier, and create a new deal for $120k in the initial discovery stage. Link the deal to her contact record."
Tool Sequence:
list_all_hub_spot_contacts_search: Claude searches for "Sarah" with the domain "initech.com" to retrieve the exactcontactId.create_a_hub_spot_note: Claude writes the meeting summary into thehs_note_bodyproperty.create_a_hub_spot_deal: Claude generates the deal payload with amount120000and the correct pipeline stage ID.create_a_hub_spot_association: Claude links the newly created Deal ID to the retrieved Contact ID.
Result: The CRM is updated perfectly reflecting the context of the call, saving the rep 15 minutes of manual data entry and UI clicking.
Scenario 2: Technical Support Escalation
Persona: Support Operations Manager
"Check the support inbox for the recent thread about the API timeout issue. Create a critical ticket for it, assign it to the engineering team, and summarize the thread in an internal note attached to the ticket."
Tool Sequence:
list_all_hub_spot_threads: Claude retrieves the recent messages filtered by the support inbox ID.list_all_hub_spot_messages: Claude pulls the full message history for context extraction.create_a_hub_spot_ticket: Claude creates the ticket with a critical priority flag and a summarized subject line.create_a_hub_spot_note: Claude generates a highly technical summary of the timeout issue and logs it against the Ticket ID.
Result: An unstructured customer complaint is transformed into a structured, well-documented engineering escalation without human intervention.
Scenario 3: Content Marketing Audit
Persona: Marketing Manager
"Pull all blog posts published in the last 30 days. Identify any posts that have a missing author or a blank meta description, and generate a markdown table of the results."
Tool Sequence:
list_all_hub_spot_blog_posts: Claude requests the posts, applying acreatedAttimestamp filter.- Claude internally parses the JSON response, iterating over the records to check the
authorNameandpostSummaryproperties. - Claude uses its native reasoning to format the flagged records into the requested markdown table directly in the chat interface.
Result: A task that would require manually exporting a CSV and running spreadsheet logic is reduced to a single natural language prompt.
Security and Access Control
Exposing your CRM and marketing database to an autonomous AI requires strict access constraints. Truto provides multiple layers of security at the MCP token level:
- Method Filtering: Restrict servers to specific operation types. Set
methods: ["read"]to allow GET/LIST operations while entirely removing thecreate,update, anddeletetools from the server payload. - Tag Filtering: Scope access by functional area. Set
tags: ["marketing"]to expose blog posts and landing pages while completely hiding deals, quotes, and financial records. - TTL Expiration (
expires_at): Generate short-lived MCP servers for temporary access (e.g., granting a contractor a URL that strictly expires on Friday at 5 PM). Cloudflare KV automatically drops the token upon expiration. - Extra Authentication (
require_api_token_auth): By default, the obscure URL is the authentication. For high-security environments, setting this flag to true forces Claude to also pass a valid Truto API token in theAuthorizationheader, ensuring only authorized internal users can execute tools.
Moving Past Boilerplate
Connecting Claude to HubSpot natively fundamentally changes how teams interact with their go-to-market data. Instead of building endless custom UI dashboards or forcing teams to memorize rigid SOPs for CRM data entry, you turn your entire HubSpot instance into an interactive, natural-language database.
Building the infrastructure to support this - handling token refreshes, translating pagination cursors, parsing the association API, and normalizing HTTP 429 headers - is a massive distraction from building your core product. By leveraging Truto's dynamic MCP server generation, your engineering team can skip the boilerplate and immediately start orchestrating high-value, agentic workflows.
FAQ
- How does Truto handle HubSpot API rate limits?
- Truto does not automatically retry or absorb rate limit errors. Instead, it normalizes HubSpot's rate limit headers into the standard IETF format (ratelimit-limit, ratelimit-remaining, ratelimit-reset) and passes HTTP 429 errors directly to the caller, allowing the LLM or client agent to control retry and exponential backoff logic.
- Do I need to manually map HubSpot custom properties for Claude?
- No. Truto dynamically generates MCP tools based on the HubSpot integration's resource definitions and documentation records. Custom properties exposed by the underlying API are automatically formatted into the JSON Schema provided to the model.
- Can I restrict what HubSpot data Claude has access to?
- Yes. When generating an MCP server token via Truto, you can apply method filters (e.g., read-only access) and tag filters to restrict the server to specific resources. Only the allowed tools will be exposed to Claude during the tools/list handshake.
- Is an API token required to use the generated MCP server?
- By default, the unique MCP server URL acts as the authentication token. However, you can enforce the require_api_token_auth flag, which forces Claude to pass a valid Truto API token in the Authorization header for an additional layer of security.