Claude Code HubSpot MCP: Set Up Your CRM Connection in 2026
By Kushal Magar · April 26, 2026 · 15 min read
Key Takeaway
The HubSpot MCP server connects Claude Code to your CRM in under 20 minutes. Install the HubSpot CLI, run hs mcp setup, select Claude Code as the client, and Claude can create contacts, update deals, log activities, and query engagement data — all from natural language. For enrichment workflows, pair it with SyncGTM.
This guide covers the complete Claude Code HubSpot MCP setup — from installing the CLI to running your first CRM automation. The HubSpot MCP server gives Claude Code natural language access to your CRM: contacts, deals, companies, activities, and engagement history. Setup takes under 20 minutes.
Most tutorials only cover the happy path. This guide covers the parts that trip people up: choosing the right MCP server for your use case, understanding which OAuth scopes to approve, troubleshooting authentication failures, and structuring automation prompts that actually work in production.
It also covers five real-world automation examples — from bulk contact updates to deal pipeline reporting — so you can start extracting value immediately after setup.
TL;DR
- What it is: The HubSpot MCP server connects Claude Code to your HubSpot account via Model Context Protocol — read, write, and automate CRM data from natural language
- Two server options: HubSpot Developer MCP (local CLI, free) and HubSpot Connector for Claude (remote OAuth, requires paid Anthropic plan)
- Setup time: 10–20 minutes for a clean install; under 10 minutes if HubSpot CLI is already installed
- Key command:
hs mcp setup— installs the MCP server and configures it for Claude Code automatically - Scopes that matter: contacts, crm.objects.deals, engagements, crm.schemas.custom.read — approve only what you need
- For enrichment: SyncGTM handles what MCP cannot — adding verified emails, phone numbers, and firmographics to your HubSpot records automatically
What Is the HubSpot MCP Server?
The HubSpot MCP server is an implementation of the Model Context Protocol standard that gives Claude Code structured, secure access to your HubSpot account. It bridges the gap between Claude's AI capabilities and your live CRM data.
Without MCP, Claude has no access to your HubSpot records. With MCP configured, Claude can execute CRM operations from a single natural language prompt — no API calls, no code, no context switching between tools.
What Claude Code can do after HubSpot MCP setup
- Create and update contacts, companies, deals, and tickets
- Log calls, meetings, notes, tasks, and emails as CRM activities
- Query pipeline data and return formatted summaries
- Search contacts by any property (email, company, job title, lifecycle stage)
- Associate records (link a contact to a company or deal)
- Read and write custom properties on any object
- Pull engagement history for a contact or deal
- Batch-update properties across many records at once
According to HubSpot's developer documentation, the MCP server is part of HubSpot's local development tooling and is configurable for Claude Code, Cursor, VS Code, Codex CLI, Gemini CLI, and Windsurf. This guide focuses specifically on the Claude Code setup.
Which HubSpot MCP Server Should You Use?
There are two distinct HubSpot MCP integrations for Claude. They serve different use cases and have different setup paths.
| Feature | Developer MCP Server | HubSpot Connector (Claude.ai) |
|---|---|---|
| Setup method | hs mcp setup CLI command | Claude.ai Settings → Connectors |
| Works with Claude Code | Yes | Claude.ai chat only |
| Authentication | HubSpot CLI OAuth token | OAuth 2.0 via HubSpot.com |
| Cost | Free (HubSpot account required) | Requires paid Anthropic plan |
| Automation scripting | Yes — full Claude Code access | Chat-based only |
| Best for | Developers, RevOps, GTM engineers | Sales reps using Claude.ai chat |
This guide focuses on the Developer MCP Server— the right choice for Claude Code users who want programmatic CRM access and automation. If you only use Claude.ai's chat interface, the HubSpot Connector for Claude is the simpler option.
Prerequisites
Confirm these before starting. Missing any one of them causes the most common setup failures.
- Node.js 18+ — required by the HubSpot CLI. Check:
node --version. Install via nodejs.org or use nvm:nvm install 20 && nvm use 20 - HubSpot CLI — install:
npm install -g @hubspot/cli. Check:hs --version - Claude Code — install:
npm install -g @anthropic-ai/claude-code - HubSpot account with API access — any HubSpot account tier works, but free accounts have daily API rate limits. A portal ID is required during CLI authentication
- HubSpot user permissions — the authenticated user needs at minimum read access to CRM objects. Write operations require corresponding object-level write permissions
HubSpot CLI vs HubSpot npm package
The MCP server requires the official @hubspot/cli package (command: hs). It is different from the hubspot-api-client npm package used for direct API calls. If hs --version does not work, run the install command above.
Step 1: Install the HubSpot CLI
If you already have Node.js 18+ and the HubSpot CLI installed, skip to Step 2.
Install Node.js (if needed)
# Check current Node version node --version # If below 18, install via nvm (recommended) nvm install 20 nvm use 20 nvm alias default 20 # Verify node --version # Should show v20.x.x
Install the HubSpot CLI
# Install globally via npm npm install -g @hubspot/cli # Verify installation hs --version # Expected output (version numbers vary): # @hubspot/cli/6.x.x ...
Verify MCP subcommand availability
Confirm the hs mcp subcommand is available before proceeding. Older CLI versions may not include it.
hs mcp --help # Expected output shows: # hs mcp setup Configure MCP servers # hs mcp install Install MCP dependencies
If hs mcp returns “command not found”, update to the latest CLI version: npm install -g @hubspot/cli@latest.
Step 2: Authenticate with HubSpot
The HubSpot MCP server uses the CLI's stored authentication. Set this up before running hs mcp setup.
Initialize the CLI and authenticate
# Initialize the CLI for a HubSpot portal hs init # This command will: # 1. Open your browser to HubSpot OAuth # 2. Prompt you for a personal access token OR OAuth login # 3. Ask for your HubSpot portal ID (account ID) # 4. Store credentials in ~/.hubspot/config.yml
Personal Access Token vs OAuth
HubSpot CLI supports two authentication methods. Use OAuth for interactive developer work. Use a Personal Access Token for automated environments or CI pipelines.
| Method | Setup | Best for |
|---|---|---|
| OAuth (browser) | hs init → browser login | Individual developers, RevOps teams |
| Personal Access Token | HubSpot Settings → Integrations → Private Apps | CI/CD, shared environments |
Generate a Personal Access Token (optional)
For non-interactive environments, create a Private App token in HubSpot:
- Go to HubSpot Settings → Integrations → Private Apps → Create a private app
- Name the app (e.g., Claude Code MCP)
- Under Scopes, select the objects Claude needs access to (see Step 4 for scope recommendations)
- Click Create app and copy the token
- Authenticate the CLI with the token:
hs auth --auth-type personalaccesskey
# Verify authentication hs accounts list # Expected output shows your portal name and ID: # Account Name | Portal ID | Auth Type # ───────────────────|───────────|────────── # My HubSpot Account | 12345678 | personalaccesskey
Step 3: Configure .mcp.json for Claude Code
The fastest path is the built-in hs mcp setup command. It detects Claude Code on your machine and writes the .mcp.json configuration automatically.
Automatic setup via hs mcp setup
# Run from your project directory hs mcp setup # Interactive prompts: # 1. Select clients: [x] Claude Code [ ] Cursor [ ] VS Code ... # (Use arrow keys to navigate, spacebar to select) # 2. Choose mode: Standalone (recommended) or Global CLI # 3. The command writes .mcp.json to your project root
Choose standalone mode unless you want the HubSpot MCP server available globally across all projects. Standalone mode installs the server locally per project — cleaner for team repos where not everyone uses HubSpot.
Manual .mcp.json configuration
If you prefer manual configuration, create .mcp.json in your project root:
{
"mcpServers": {
"hubspot": {
"command": "npx",
"args": [
"-y",
"@hubspot/mcp-server"
]
}
}
}With explicit portal ID
If you work with multiple HubSpot portals, pass the portal ID explicitly to prevent the server from using the wrong account:
{
"mcpServers": {
"hubspot": {
"command": "npx",
"args": [
"-y",
"@hubspot/mcp-server",
"--portalId",
"12345678"
]
}
}
}With Personal Access Token via environment variable
{
"mcpServers": {
"hubspot": {
"command": "npx",
"args": [
"-y",
"@hubspot/mcp-server"
],
"env": {
"HUBSPOT_ACCESS_TOKEN": "pat-na1-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
}
}
}Security note: avoid committing tokens
Never commit .mcp.json with a hardcoded token to version control. Use environment variables injected at runtime, or rely on the CLI credential store (the hs mcp setup default). Add .mcp.json to .gitignore if it contains sensitive values.
Step 4: Understand OAuth Scopes
HubSpot scopes control exactly what Claude Code can read and write. Approving too few scopes causes MCP tool calls to fail with permission errors. Approving too many creates unnecessary data exposure.
Use the following scope sets as starting points, depending on your use case.
Minimum scope set for RevOps use cases
crm.objects.contacts.read— read contactscrm.objects.contacts.write— create and update contactscrm.objects.deals.read— read dealscrm.objects.deals.write— create and update dealscrm.objects.companies.read— read companiescrm.objects.companies.write— create and update companiesengagements— log calls, meetings, notes, emails, tasks
Extended scopes for full CRM automation
crm.schemas.custom.read— read custom object schemascrm.objects.custom.read— read custom object recordscrm.objects.custom.write— write to custom objectstickets— create and update support ticketstimeline— create custom timeline eventscontent— read blog posts and landing pages (read-only)
| Object | Read scope | Write scope |
|---|---|---|
| Contacts | crm.objects.contacts.read | crm.objects.contacts.write |
| Companies | crm.objects.companies.read | crm.objects.companies.write |
| Deals | crm.objects.deals.read | crm.objects.deals.write |
| Tickets | tickets | tickets |
| Engagements | engagements | engagements |
| Custom objects | crm.objects.custom.read | crm.objects.custom.write |
Step 5: Verify the Connection
Start Claude Code from the directory containing your .mcp.json. Claude reads the config on launch and connects to the HubSpot MCP server automatically.
# Launch Claude Code from your project root claude
Use these four starter prompts to confirm end-to-end connectivity. Each tests a different part of the MCP setup.
Test 1: Verify HubSpot connection
Prompt
“What HubSpot portal are you connected to? Show the portal ID and account name.”
A successful response shows your portal name and ID. This confirms the CLI credential is valid before running data queries.
Test 2: Query recent contacts
Prompt
“Show me the 5 most recently created contacts in HubSpot. Include their name, email, company, lifecycle stage, and create date.”
Test 3: Query open deals
Prompt
“List all open deals in the pipeline. Show deal name, amount, stage, owner, and expected close date. Sort by close date ascending.”
Test 4: Create a test contact
Prompt
“Create a test contact in HubSpot: first name Test, last name MCPVerify, email test-mcp-verify@example.com, company TestCorp. Confirm it was created.”
If all four prompts return correct results, your claude code hubspot mcp setup is complete. Delete the test contact after verification.
For more advanced automation patterns, see top GTM MCPs for Claude Code in 2026 and how GTM teams use Claude Code for revenue operations.
Real-World Automation Examples
These five examples demonstrate what Claude Code can do once connected to HubSpot via MCP. Each is a single natural language prompt that would otherwise require multiple API calls or manual CRM work.
Example 1: Deal pipeline report
Prompt
“Give me a pipeline summary for this week. Total deal value by stage, number of deals in each stage, and any deals with close dates in the next 7 days. Format as a table.”
This replaces a manual HubSpot report build. Claude queries, groups, and formats the data in one step — useful for Monday morning pipeline reviews.
Example 2: Bulk lifecycle stage update
Prompt
“Find all contacts with lifecycle stage ‘Lead’ who have not had any engagement activity in the last 90 days. Update their lifecycle stage to ‘Other’ and add a note: ‘Auto-recycled by Claude Code on [today's date] — no activity in 90 days.’”
A complete lifecycle hygiene workflow. Without MCP, this requires a HubSpot workflow, a list, and a manual export. Claude handles it in a single prompt.
Example 3: Meeting activity logging
Prompt
“Log a meeting activity on the contact john.doe@example.com. Meeting date: today at 2pm. Duration: 30 minutes. Title: Discovery Call. Notes: Discussed pain points around CRM data quality, interested in enrichment solutions, requested a follow-up demo next week. Associate with deal ID 123456.”
CRM logging after calls is the most skipped sales task. This prompt takes 10 seconds from a voice transcript or call notes.
Example 4: Contact enrichment from custom properties
Prompt
“Find all contacts where the custom property ‘ICP Score’ is empty. Export their email and company as a CSV list so I can run enrichment on them.”
This extracts a gap report for your enrichment pipeline. Pair it with SyncGTM's HubSpot integration to auto-fill missing ICP scores and firmographic data.
Example 5: Deal creation from inbound form data
Prompt
“A new inbound lead came in with email sarah@techcorp.com, company TechCorp, role VP Sales, team size 50. Create a HubSpot contact if one doesn't exist, create a new deal with name ‘TechCorp — Inbound 2026-04-26’, amount $5000, stage ‘Appointment Scheduled’, and associate the contact with the deal.”
A complete inbound lead-to-deal workflow in one prompt. This is the kind of automation that previously required a custom HubSpot workflow or Zapier chain.
For the full picture of how GTM engineers use Claude Code with CRM and enrichment, see the Claude Code for sales teams guide and the best HubSpot enrichment tools in 2026.
Troubleshooting Common Issues
These are the issues that appear most often during HubSpot MCP setup and how to fix them.
Issue 1: “ENOTFOUND” or connection refused
Claude returns an error when calling any HubSpot MCP tool. This means the MCP server process failed to start or cannot reach the HubSpot API.
- Confirm
hs accounts listshows a connected portal - Re-run
hs initif the auth token has expired - Check network connectivity to
api.hubapi.com - Verify
npx -y @hubspot/mcp-server --helpruns without errors
Issue 2: “Scope not authorized” errors
Claude gets scope errors when trying to read or write specific objects. The authenticated private app or OAuth token is missing required scopes.
- Go to HubSpot Settings → Integrations → Private Apps
- Edit your Claude Code app and add the missing scope (see Step 4 table)
- Rotate the access token after adding scopes (HubSpot requires this)
- Update the token in your
.mcp.jsonor re-runhs init
Issue 3: Rate limit errors (429)
HubSpot free accounts are limited to 110 API calls per 10 seconds per portal. Claude Code may hit this during bulk operations.
- Break bulk operations into smaller batches (50 records at a time)
- Ask Claude to process records in batches with pauses between them
- Upgrade to a paid HubSpot tier for higher rate limits (10x on Starter)
- Use HubSpot's Batch API for operations on 100+ records
Issue 4: “hs” not recognized on Windows
After installing @hubspot/cli on Windows, the hs command may not resolve in PowerShell.
# Find npm global bin directory npm config get prefix # Add <prefix>in to Windows PATH # System Properties > Environment Variables > Path > New
Close and reopen all terminal windows after updating PATH. If using Git Bash on Windows, the hs command may need an explicit extension: hs.cmd --version.
Pair With SyncGTM for Enrichment Workflows
The HubSpot MCP server is a read/write tool for existing CRM data. It does not source new contact data from the web or external databases.
If your HubSpot contacts are missing emails, phone numbers, LinkedIn URLs, or firmographic properties — that is an enrichment problem, not an MCP problem. SyncGTM connects to HubSpot and waterfall-enriches every contact and company with data from 50+ providers. See SyncGTM pricing for plans starting at $99/mo.
| Workflow | HubSpot MCP | SyncGTM |
|---|---|---|
| Pipeline queries and reporting | Yes | No |
| Contact and deal CRUD | Yes | Partial |
| Activity logging (calls, meetings, notes) | Yes | No |
| Email enrichment from 50+ providers | No | Yes |
| Phone number waterfall enrichment | No | Yes |
| ICP scoring and firmographic data | No | Yes |
| Buying signal detection | No | Yes |
A practical pattern: use Claude Code with the MCP server to find contacts missing enrichment data (custom properties empty), export the list, run SyncGTM enrichment to fill the gaps, then use MCP again to verify the update landed correctly.
For full details on the integration, see the SyncGTM + HubSpot integration guide. For a comparison of HubSpot enrichment tools that work alongside MCP, see the best HubSpot enrichment tools in 2026.
For GTM engineers building a full MCP stack across multiple tools, the top GTM MCPs for Claude Code covers what to add alongside HubSpot — including Salesforce, Linear, and Slack MCPs.
MCP Queries Your HubSpot Data. SyncGTM Fills What's Missing.
The HubSpot MCP setup connects Claude to the records you already have. SyncGTM enriches those records with verified emails, phone numbers, and firmographics from 50+ providers — automatic HubSpot sync at $99/mo.
Try SyncGTM Free — No Credit Card