HubSpot MCP Server
Provides tools for interacting with HubSpot CRM, enabling management of contacts, companies, deals, and emails. Supports creating, reading, updating, and searching records, as well as sending emails and retrieving engagement data.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@HubSpot MCP Server Create a contact for Jane Doe at jane@example.com as a lead"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
HubSpot MCP Server
A Model Context Protocol (MCP) server that provides seamless integration with HubSpot CRM. This server enables AI assistants like Claude to interact with your HubSpot data, allowing for efficient management of contacts, companies, deals, and more.
🚀 Features
Contacts Management: Create, read, update, and search contacts in HubSpot
Companies Management: Manage company records and information
Deals Management: Track and update sales opportunities
Email Integration: Send emails and track engagement (requires setup)
Type-Safe: Built with TypeScript for better development experience
Comprehensive Testing: Includes unit tests and integration examples
Easy Setup: Simple configuration with environment variables
Related MCP server: HubSpot CRM MCP Server
📋 Available Tools
Contacts
get_contacts- Retrieve a list of contactsget_contact- Get a specific contact by IDcreate_contact- Create a new contactupdate_contact- Update an existing contactsearch_contacts- Search for contacts
Companies
get_companies- Retrieve a list of companiesget_company- Get a specific company by IDcreate_company- Create a new companyupdate_company- Update an existing company
Deals
get_deals- Retrieve a list of dealsget_deal- Get a specific deal by IDcreate_deal- Create a new dealupdate_deal- Update an existing deal
Emails
send_email- Send emails through HubSpot (requires Marketing Email API)get_email_events- Get email engagement data (requires Events API)
🛠️ Prerequisites
Node.js 18+ and npm
HubSpot account with API access
HubSpot API key or OAuth credentials
📦 Installation
Clone the repository:
git clone https://github.com/yourusername/hubspot-mcp-server.git cd hubspot-mcp-serverInstall dependencies:
npm installConfigure environment variables:
cp .env.example .envEdit
.envwith your HubSpot credentials:HUBSPOT_API_KEY=your_hubspot_api_key_here # OR use OAuth (if you prefer) HUBSPOT_CLIENT_ID=your_client_id HUBSPOT_CLIENT_SECRET=your_client_secret HUBSPOT_ACCESS_TOKEN=your_access_tokenBuild the project:
npm run build
🔧 Getting HubSpot API Credentials
Option 1: API Key (Recommended for testing)
Go to HubSpot Settings → Integrations → API key
Generate a new API key
Add it to your
.envfile asHUBSPOT_API_KEY
Option 2: OAuth App (Recommended for production)
Go to HubSpot Developer Account → Apps
Create a new app
Note your Client ID and Client Secret
Configure OAuth redirect URI
Add credentials to your
.envfile
🚀 Usage
With Claude Desktop
Configure Claude Desktop by adding to your MCP settings:
{ "mcpServers": { "hubspot": { "command": "node", "args": ["dist/index.js"], "cwd": "/path/to/hubspot-mcp-server", "env": { "HUBSPOT_API_KEY": "your_api_key_here" } } } }Restart Claude Desktop
Start using HubSpot tools in Claude:
"Show me my recent contacts"
"Create a new contact for John Doe with email john@example.com"
"Search for companies in the technology industry"
Direct Usage
You can also run the server directly:
npm startOr for development with auto-reload:
npm run dev🧪 Testing
Run the test suite:
npm testRun tests in watch mode:
npm run test:watchRun a manual test of the server:
npm run dev
# In another terminal:
node tests/test-server.js📖 Examples
Creating a Contact
// Using the MCP tool
{
"tool": "create_contact",
"arguments": {
"email": "jane.doe@example.com",
"firstname": "Jane",
"lastname": "Doe",
"phone": "+1-555-123-4567",
"company": "Example Corp",
"lifecyclestage": "lead"
}
}Searching for Companies
// This would be handled automatically by Claude when you ask:
// "Find all companies in the software industry"
{
"tool": "get_companies",
"arguments": {
"limit": 20,
"properties": ["name", "domain", "industry", "city", "state"]
}
}🏗️ Development
Project Structure
src/
├── index.ts # Main MCP server
├── services/
│ └── hubspot.ts # HubSpot API wrapper
├── tools/
│ ├── base.ts # Base tool class
│ ├── contacts.ts # Contact management tools
│ ├── companies.ts # Company management tools
│ ├── deals.ts # Deal management tools
│ └── emails.ts # Email tools
└── types/
└── index.ts # Type definitions
tests/
├── setup.ts # Test configuration
├── hubspot.service.test.ts
├── contacts.tool.test.ts
└── test-server.ts # Manual testing scriptAdding New Tools
Create a new tool class extending
BaseToolImplement
getTools()andexecuteTool()methodsRegister the tool in
src/index.tsAdd tests for the new tool
Code Style
This project uses TypeScript with strict mode enabled. Make sure to:
Use proper type annotations
Follow existing naming conventions
Add JSDoc comments for public methods
Write tests for new functionality
🔒 Security Considerations
API Keys: Never commit API keys to version control
Environment Variables: Use
.envfiles for local developmentProduction: Use proper secret management in production
Rate Limiting: Be aware of HubSpot API rate limits
Permissions: Only request necessary HubSpot scopes
📚 Resources
🤝 Contributing
Fork the repository
Create a feature branch:
git checkout -b feature/amazing-featureCommit your changes:
git commit -m 'Add amazing feature'Push to the branch:
git push origin feature/amazing-featureOpen a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🐛 Troubleshooting
Common Issues
"API key not found" error:
Ensure your
.envfile is properly configuredCheck that the API key is valid and has necessary permissions
"Module not found" errors:
Run
npm installto ensure all dependencies are installedRun
npm run buildto compile TypeScript
Rate limiting errors:
HubSpot has API rate limits. Implement proper retry logic for production use
Consider using exponential backoff for failed requests
Connection timeouts:
Check your internet connection
Verify HubSpot service status
For more help, please open an issue.
🚀 Deployment
Production Considerations
Environment Variables: Use a proper secrets management system
Logging: Configure appropriate log levels
Monitoring: Set up health checks and monitoring
Scaling: Consider rate limiting and caching for high-volume usage
Docker Support (Coming Soon)
Docker support will be added in a future release for easier deployment.
Built with ❤️ for the HubSpot and AI community
Available Tools
15 toolscreate_companyC
Create a new company in HubSpot
Inputs: name (required), city, phone, state, +4 more.
create_contactC
Create a new contact in HubSpot
Inputs: email (required), phone, company, lastname, +3 more.
create_dealC
Create a new deal in HubSpot
Inputs: dealname (required), dealstage (required), amount, dealtype, +3 more.
get_companiesC
Get a list of companies from HubSpot
Inputs: limit, properties.
get_companyB
Get a specific company by ID from HubSpot
Inputs: companyId (required), properties.
get_contactC
Get a specific contact by ID from HubSpot
Inputs: contactId (required), properties.
get_contactsC
Get a list of contacts from HubSpot
Inputs: limit, properties.
get_dealB
Get a specific deal by ID from HubSpot
Inputs: dealId (required), properties.
get_dealsC
Get a list of deals from HubSpot
Inputs: limit, properties.
get_email_eventsC
Get email events and engagement data (placeholder - requires specific API setup)
Inputs: contactId (required), limit.
search_contactsC
Search for contacts in HubSpot
Inputs: query (required), properties.
send_emailB
Send an email through HubSpot (requires Marketing Email API setup)
Inputs: to (required), subject (required), htmlBody (required), fromName, +2 more.
update_companyC
Update an existing company in HubSpot
Inputs: companyId (required), city, name, phone, +5 more.
update_contactC
Update an existing contact in HubSpot
Inputs: contactId (required), email, phone, company, +4 more.
update_dealC
Update an existing deal in HubSpot
Inputs: dealId (required), amount, dealname, dealtype, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Most tools map to a distinct resource+action pair (get_contact vs create_contact vs update_contact), making selection straightforward. The main soft spot is get_contacts (list) vs search_contacts (query), which could be confused by an agent, and the two email tools are flagged as placeholders/setup-dependent, reducing confidence in when to use them.
Every tool follows a clean verb_noun snake_case pattern: get_, create_, update_, search_, send_. No mixed conventions or stray verbs, so the naming is fully predictable.
15 tools is at the top of the well-scoped range but each maps to a real CRM object action across contacts, companies, and deals. Nothing feels redundant or padded given the three-object surface plus email.
Contacts, companies, and deals each have list/get/create/update, but delete is missing across all three objects and there is no search for companies or deals. The email tools are explicitly placeholders requiring extra API setup, leaving engagement workflows effectively dead-ended.
Maintenance
Related MCP Connectors
Create contacts, move deals, send proposals and invoices, read your inbox, from Claude or ChatGPT.
xmagnet — AI-powered B2B CRM for Claude. 35 tools that turn natural-language prompts into real CRM actions: prospect, enrich, score leads, manage deals, scan buying intent, run email campaigns and sequences, build forms and landing pages, refine ICP, and analyze performance — all directly inside Claude. 🚀 ONE-CLICK INSTALL: https://api.xmagnet.ai/claude The install page guides Claude users through 3 steps in under a minute: open Claude Connectors, paste the connector name, paste the server URL, sign in. A reviewer workspace is auto-provisioned on first sign-in with sample contacts, deals, campaigns, and ICP suggestions, so every tool works end-to-end with zero setup. No 2FA. No paid plan required. Free tier exposes all 35 tools. What you can do: • Prospecting — search_contacts, search_companies, search_investors, find_contacts_at_companies, enrich_contact, validate_email, find_competitors, company_intelligence • Pipeline — get_deals_pipeline, scan_deal_intent, get_ghost_pipeline, create_deal • Campaigns & sequences — create_campaign, generate_campaign_content, get_campaign_stats, get_bounce_stats, get_unsub_stats, create_sequence_draft, list_sequences • Top of funnel — suggest_icp, get_icp, create_form, list_forms, create_landing_page, list_landing_pages, show_suggestions • Operations — analyze_contacts, get_contact_details, update_contact, save_contacts_to_crm, export_contacts, get_dashboard_stats, get_credit_balance Example prompts to try: • "Find C-suite contacts at fintech companies that raised Series A in the last 6 months." • "Scan my open deals for buying intent and prioritize follow-ups." • "Generate a re-engagement campaign for contacts who opened my last newsletter but didn't reply." • "Show me my deals pipeline by stage with weighted value and win rate." • "Generate a landing page for my Q2 webinar with a registration form." Built for founders, SDRs, RevOps, and growth teams who want their CRM to take action — not just store records. Install: https://api.xmagnet.ai/claude · Site: https://xmagnet.ai · Privacy: https://xmagnet.ai/privacy-policy · Terms: https://xmagnet.ai/terms-of-service · Support: ashish.sinha@xmagnet.ai
Connect ChatGPT or Claude to your CRM, store or shipping API. Keys stay out of the chat.
CRM, inbox, meetings, revenue intelligence, analytics and automations for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with HubSpot CRM for managing contacts, companies, deals, and sending emails through natural language commands.MIT
- AlicenseAqualityCmaintenanceEnables Claude to search, create, and update contacts, deals, and support tickets in HubSpot, and to generate cross-object account summaries.10MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with HubSpot CRM data, providing tools to create and retrieve contacts, companies, activities, and conversations, plus semantic search across previously retrieved data. Built-in vector storage and caching help overcome HubSpot API limitations and improve response times.-
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with HubSpot CRM data for creating and retrieving contacts, companies, activity, and conversations, with built-in vector storage and caching for faster semantic search.-