Provides comprehensive CRM integration with HubSpot, enabling management of contacts, companies, deals, email sending, and tracking engagement data through the HubSpot API.
Click on "Install 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 Servershow me my recent contacts"
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
π 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
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.