HubSpot MCP server

Integrates with HubSpot CRM to enable contact creation, company management, and activity tracking directly from conversational interfaces
Back to servers
Provider
Lakhvinder Singh
Release date
Mar 29, 2025
Language
TypeScript
Stats
10 stars

The HubSpot MCP Server provides a bridge between AI assistants and your HubSpot CRM data, enabling natural language interactions with your contacts, companies, and engagement data without leaving your AI interface.

Installation

To set up the HubSpot MCP Server:

# 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 build

Configuration

You'll need a HubSpot API access token to authenticate with the HubSpot API:

  1. Go to your HubSpot Developer Account
  2. Create a private app with the necessary scopes (contacts, companies, engagements)
  3. Copy the generated access token

You can provide the token in two ways:

Using environment variables:

HUBSPOT_ACCESS_TOKEN=your-access-token

Using a command-line argument:

npm start -- --access-token=your-access-token

For development:

Create a .env file in the project root:

HUBSPOT_ACCESS_TOKEN=your-access-token

Starting the Server

# Start the server
npm start

# Or with a specific access token
npm start -- --access-token=your-access-token

Authentication Setup

To implement authentication in the SSE server:

  1. Install the authentication package:

    npm install mcp-proxy-auth
    
  2. Set the authentication server URL:

    export AUTH_SERVER_URL=https://your-auth-server.com/verify
    
  3. Run the server with authentication:

    npx mcp-proxy-auth node dist/index.js
    
  4. The SSE endpoint will be available at:

    localhost:8080/sse?apiKey=your-api-key
    

Available Tools

Contact Management

Create a contact

Use hubspot_create_contact to add a new contact to HubSpot:

{
  "firstname": "John",
  "lastname": "Doe",
  "email": "[email protected]",
  "properties": {
    "company": "Acme Inc",
    "phone": "555-123-4567",
    "jobtitle": "Software Engineer"
  }
}

Update a contact

Use hubspot_update_contact to modify an existing contact:

{
  "contact_id": "12345",
  "properties": {
    "email": "[email protected]",
    "phone": "555-987-6543",
    "jobtitle": "Senior Software Engineer"
  }
}

Get active contacts

Use hubspot_get_active_contacts to retrieve recently active contacts:

{
  "limit": 15
}

Company Management

Create a company

Use hubspot_create_company to add a new company:

{
  "name": "Acme Corporation",
  "properties": {
    "domain": "acme.com",
    "industry": "Technology",
    "phone": "555-987-6543",
    "city": "San Francisco",
    "state": "CA"
  }
}

Update a company

Use hubspot_update_company to modify an existing company:

{
  "company_id": "67890",
  "properties": {
    "domain": "updated-domain.com",
    "phone": "555-123-4567",
    "industry": "Software"
  }
}

Get active companies

Use hubspot_get_active_companies to retrieve recently active companies:

{
  "limit": 10
}

Engagement Tracking

Get company activity

Use hubspot_get_company_activity to retrieve a company's engagement history:

{
  "company_id": "67890"
}

Get recent engagements

Use hubspot_get_recent_engagements to retrieve recent activities across your HubSpot instance:

{
  "days": 14,
  "limit": 25
}

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later