- Built from scratch: apollo, chargebee, datadog, greenhouse, lever, loom, pandadoc, salesloft, sendgrid, supabase, typeform, webflow, zoho-crm, twilio, reonomy - TSC fixes: brevo, google-console, housecall-pro, meta-ads, rippling, bamboohr, close, fieldedge, freshdesk, helpscout, toast, touchbistro, hubspot, notion, quickbooks, airtable, gusto, intercom, linear, monday, salesforce, shopify, square, wave, xero - Entry points added: close, touchbistro - All 65 active servers compile with 0 TypeScript errors - 4 specialty servers skipped (competitor-research, compliance-grc, n8n-apps, product-analytics)
HubSpot MCP Server
Model Context Protocol (MCP) server for HubSpot CRM API v3. Provides comprehensive access to HubSpot CRM objects, marketing tools, CMS, and analytics.
Features
- CRM Objects: Contacts, Companies, Deals, Tickets, Line Items, Products, Quotes
- Associations: Manage relationships between objects
- Marketing: Email campaigns, forms, lists, workflows
- CMS: Blog posts, pages, HubDB tables
- Engagements: Notes, calls, emails, meetings, tasks
- Pipelines & Stages: Deal and ticket pipeline management
- Search API: Advanced filtering and search across all objects
- Batch Operations: Efficient bulk create/update/archive
- Rate Limiting: Automatic retry with exponential backoff
- Pagination: Automatic handling of cursor-based pagination
Installation
npm install
npm run build
Configuration
Create a .env file (see .env.example):
HUBSPOT_ACCESS_TOKEN=your-private-app-token-here
Getting a HubSpot Access Token
- Go to your HubSpot account settings
- Navigate to Integrations → Private Apps
- Click Create a private app
- Configure the required scopes:
crm.objects.contacts.read/crm.objects.contacts.writecrm.objects.companies.read/crm.objects.companies.writecrm.objects.deals.read/crm.objects.deals.writecrm.objects.owners.read- Additional scopes based on your needs
- Copy the generated access token
Usage
Development Mode
npm run dev
Production Mode
npm run build
npm start
MCP Configuration
Add to your MCP client configuration (e.g., Claude Desktop):
{
"mcpServers": {
"hubspot": {
"command": "node",
"args": ["/path/to/hubspot/dist/main.js"],
"env": {
"HUBSPOT_ACCESS_TOKEN": "your-token-here"
}
}
}
}
Available Tools
Contacts
hubspot_contacts_list- List all contacts with paginationhubspot_contacts_get- Get a contact by IDhubspot_contacts_create- Create a new contacthubspot_contacts_update- Update contact propertieshubspot_contacts_search- Search contacts with filters
Companies
hubspot_companies_list- List all companieshubspot_companies_get- Get a company by IDhubspot_companies_create- Create a new company
Deals
hubspot_deals_list- List all dealshubspot_deals_get- Get a deal by IDhubspot_deals_create- Create a new deal
Tickets
hubspot_tickets_list- List all ticketshubspot_tickets_create- Create a new ticket
Associations
hubspot_associations_get- Get associations for an objecthubspot_associations_create- Create an association between objects
Pipelines
hubspot_pipelines_list- List pipelines for an object type
Owners
hubspot_owners_list- List all owners in the account
Properties
hubspot_properties_list- List properties for an object type
Architecture
Core Components
src/types/index.ts- Comprehensive TypeScript type definitions for all HubSpot entitiessrc/clients/hubspot.ts- API client with retry logic, rate limiting, and paginationsrc/server.ts- MCP server implementation with lazy-loaded tool modulessrc/main.ts- Entry point with environment validation and graceful shutdown
API Client Features
- Authentication: Bearer token (Private App or OAuth)
- Rate Limiting: Automatic handling of 429 responses with retry-after headers
- Retry Logic: Exponential backoff for transient failures (max 3 retries)
- Pagination: Automatic cursor-based pagination (HubSpot uses
aftercursor) - Batch Operations: Efficient bulk operations for create/update/archive
- Type Safety: Full TypeScript type definitions for all API entities
HubSpot API Limits
- Free/Starter: 10 requests/second
- Professional/Enterprise: Higher limits based on tier
- Search API: Up to 10,000 results per search
- Batch API: Up to 100 objects per batch request
Error Handling
The server provides structured error responses:
{
content: [{
type: 'text',
text: 'Error: HubSpot API Error: {message} ({status}) [{correlationId}]'
}],
isError: true
}
Development
Type Safety
All HubSpot entities use branded types for IDs:
type ContactId = string & { readonly __brand: 'ContactId' };
type CompanyId = string & { readonly __brand: 'CompanyId' };
Adding New Tools
- Add tool definition in
src/server.ts→ListToolsRequestSchemahandler - Add routing in
handleToolCallmethod - Implement handler method (or lazy-load from separate module)
Testing
npm test # (tests not yet implemented)
Type Checking
npx tsc --noEmit
Resources
License
MIT
Support
For issues and feature requests, please open an issue on GitHub.