@eugeneboondock/hubspot-mcp-server
v0.2.15
Published
A powerful Model Context Protocol (MCP) server implementation for seamless HubSpot CRM integration, enabling AI assistants to interact with your HubSpot data
Downloads
146
Maintainers
Readme
HubSpot MCP Server
A powerful Model Context Protocol (MCP) server implementation for seamless HubSpot CRM integration, enabling AI assistants to interact with your HubSpot data.
Overview
This MCP server provides a comprehensive set of tools for interacting with the HubSpot CRM API, allowing AI assistants to:
- Create and manage contacts and companies in your HubSpot CRM
- Retrieve detailed company activity history and engagement timelines
- Access recent engagement data across your entire HubSpot instance
- Get lists of recently active companies and contacts
- Search for tasks and notes with advanced filtering
- Perform CRM operations without leaving your AI assistant interface
Why Use This MCP Server?
- Seamless AI Integration: Connect your AI assistants directly to your HubSpot CRM data
- Simplified CRM Operations: Perform common HubSpot tasks through natural language commands
- Real-time Data Access: Get up-to-date information from your HubSpot instance
- Secure Authentication: Uses HubSpot's OAuth token authentication
- Extensible Design: Easily add more HubSpot API capabilities as needed
- Magic Card Integration: Supports Morphed Magic Card detection and processing
Installation
# Clone the repository
git clone https://github.com/lkm1developer/hubspot-mcp-server.git
cd hubspot-mcp-server
# Install dependencies
npm install
# Build the project
npm run buildConfiguration
The server requires a HubSpot API access token. You can obtain one by:
- Going to your HubSpot Developer Account
- Creating a private app with the necessary scopes (contacts, companies, engagements, tasks, notes)
- Copying the generated access token
You can provide the token in two ways:
As an environment variable:
HUBSPOT_ACCESS_TOKEN=your-access-tokenAs a command-line argument:
npm start -- --access-token=your-access-token
For development, create a .env file in the project root to store your environment variables:
HUBSPOT_ACCESS_TOKEN=your-access-tokenUsage
Starting the Server
# Start the server
npm start
# Or with a specific access token
npm start -- --access-token=your-access-token
# Run the SSE server with authentication
npx mcp-proxy-auth node dist/index.jsImplementing Authentication in SSE Server
The SSE server uses the mcp-proxy-auth package for authentication. To implement authentication:
Install the package:
npm install mcp-proxy-authSet the
AUTH_SERVER_URLenvironment variable to point to your API key verification endpoint:export AUTH_SERVER_URL=https://your-auth-server.com/verifyRun the SSE server with authentication:
npx mcp-proxy-auth node dist/index.jsThe SSE URL will be available at:
localhost:8080/sse?apiKey=apikeyReplace
apikeywith your actual API key for authentication.
The mcp-proxy-auth package acts as a proxy that:
- Intercepts requests to your SSE server
- Verifies API keys against your authentication server
- Only allows authenticated requests to reach your SSE endpoint
Integrating with AI Assistants
This MCP server is designed to work with AI assistants that support the Model Context Protocol. Once running, the server exposes a set of tools that can be used by compatible AI assistants to interact with your HubSpot CRM data.
Available Tools
The server exposes the following powerful HubSpot integration tools:
hubspot_create_contact
- Create a new contact in HubSpot with duplicate checking
- Parameters:
firstname(string, required): Contact's first namelastname(string, required): Contact's last nameemail(string, optional): Contact's email addressproperties(object, optional): Additional contact properties like company, phone, etc.
hubspot_create_company
- Create a new company in HubSpot with duplicate checking
- Parameters:
name(string, required): Company nameproperties(object, optional): Additional company properties
hubspot_get_company_activity
- Get comprehensive activity history for a specific company
- Parameters:
companyId(string, required): HubSpot company ID
- Returns detailed engagement data including emails, calls, meetings, notes, and tasks
hubspot_get_recent_engagements
- Get recent engagement activities across all contacts and companies
- Parameters:
days(number, optional, default: 7): Number of days to look backlimit(number, optional, default: 50): Maximum number of engagements to return
hubspot_get_active_companies
- Get most recently active companies from HubSpot
- Parameters:
limit(number, optional, default: 10): Maximum number of companies to return
hubspot_get_active_contacts
- Get most recently active contacts from HubSpot
- Parameters:
limit(number, optional, default: 10): Maximum number of contacts to return
hubspot_get_deals
- Get deals from HubSpot with comprehensive properties
- Parameters:
limit(number, optional, default: 10): Maximum number of deals to return
hubspot_get_tickets
- Get support tickets from HubSpot
- Parameters:
limit(number, optional, default: 10): Maximum number of tickets to return
hubspot_get_orders
- Get ecommerce orders from HubSpot
- Parameters:
limit(number, optional, default: 10): Maximum number of orders to return
hubspot_get_current_user
- Get authenticated user info and portal details
- No parameters required
hubspot_search_tasks
- Search for tasks with advanced filtering
- Parameters:
searchTerm(string, optional): Text to search for in task contentmodifiedAfter(string, optional): ISO date string to filter by modification date
hubspot_search_notes
- Search for notes with advanced filtering
- Parameters:
searchTerm(string, optional): Text to search for in note contentmodifiedAfter(string, optional): ISO date string to filter by modification date
hubspot_update_contact
- Update an existing contact in HubSpot (ignores if contact does not exist)
- Parameters:
contact_id(string, required): HubSpot contact ID to updateproperties(object, required): Contact properties to update
hubspot_update_company
- Update an existing company in HubSpot (ignores if company does not exist)
- Parameters:
company_id(string, required): HubSpot company ID to updateproperties(object, required): Company properties to update
Extending the Server
The server is designed to be easily extensible. To add new HubSpot API capabilities:
- Add new methods to the
HubSpotClientclass insrc/hubspot-client.ts - Register new tools in the
setupToolHandlersmethod insrc/index.ts - Rebuild the project with
npm run build
License
This project is licensed under the MIT License - see the LICENSE file for details.
Keywords
HubSpot, CRM, Model Context Protocol, MCP, AI Assistant, TypeScript, API Integration, HubSpot API, CRM Integration, Contact Management, Company Management, Engagement Tracking, AI Tools, Magic Cards
