Skip to main content
Glama
HubSpot MCP Server

HubSpot MCP Server

by eribichesu

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 contacts

  • get_contact - Get a specific contact by ID

  • create_contact - Create a new contact

  • update_contact - Update an existing contact

  • search_contacts - Search for contacts

Companies

  • get_companies - Retrieve a list of companies

  • get_company - Get a specific company by ID

  • create_company - Create a new company

  • update_company - Update an existing company

Deals

  • get_deals - Retrieve a list of deals

  • get_deal - Get a specific deal by ID

  • create_deal - Create a new deal

  • update_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

  1. Clone the repository:

    git clone https://github.com/yourusername/hubspot-mcp-server.git
    cd hubspot-mcp-server
  2. Install dependencies:

    npm install
  3. Configure environment variables:

    cp .env.example .env

    Edit .env with 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_token
  4. Build the project:

    npm run build

🔧 Getting HubSpot API Credentials

  1. Go to HubSpot Settings → Integrations → API key

  2. Generate a new API key

  3. Add it to your .env file as HUBSPOT_API_KEY

  1. Go to HubSpot Developer Account → Apps

  2. Create a new app

  3. Note your Client ID and Client Secret

  4. Configure OAuth redirect URI

  5. Add credentials to your .env file

🚀 Usage

With Claude Desktop

  1. 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"
          }
        }
      }
    }
  2. Restart Claude Desktop

  3. 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 start

Or for development with auto-reload:

npm run dev

🧪 Testing

Run the test suite:

npm test

Run tests in watch mode:

npm run test:watch

Run 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 script

Adding New Tools

  1. Create a new tool class extending BaseTool

  2. Implement getTools() and executeTool() methods

  3. Register the tool in src/index.ts

  4. Add 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 .env files for local development

  • Production: Use proper secret management in production

  • Rate Limiting: Be aware of HubSpot API rate limits

  • Permissions: Only request necessary HubSpot scopes

📚 Resources

🤝 Contributing

  1. Fork the repository

  2. Create a feature branch: git checkout -b feature/amazing-feature

  3. Commit your changes: git commit -m 'Add amazing feature'

  4. Push to the branch: git push origin feature/amazing-feature

  5. Open 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 .env file is properly configured

  • Check that the API key is valid and has necessary permissions

"Module not found" errors:

  • Run npm install to ensure all dependencies are installed

  • Run npm run build to 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

  1. Environment Variables: Use a proper secrets management system

  2. Logging: Configure appropriate log levels

  3. Monitoring: Set up health checks and monitoring

  4. 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 tools
create_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

    B3.2/5.0

    Scored across 15 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness3/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    • Create contacts, move deals, send proposals and invoices, read your inbox, from Claude or ChatGPT.

      https://onehub360.com/api/mcp
    • 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

      https://api.xmagnet.ai/mcp
    • Connect ChatGPT or Claude to your CRM, store or shipping API. Keys stay out of the chat.

      https://apiunicon.online/mcp
    • CRM, inbox, meetings, revenue intelligence, analytics and automations for AI agents.

      https://mcp.aivyro.io/mcp

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables Claude to search, create, and update contacts, deals, and support tickets in HubSpot, and to generate cross-object account summaries.
      10
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables 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.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables 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.
      -