Skip to main content

HubSpot Marketing MCP Server

Create a powerful Model Context Protocol (MCP) server for HubSpot Marketing Hub in minutes with our AI Gateway. This guide walks you through setting up seamless marketing automation integration with enterprise-grade security and instant OAuth authentication.

About HubSpot Marketing API

HubSpot Marketing Hub is a comprehensive marketing automation platform that helps businesses attract, engage, and delight customers. The Marketing API provides access to:

  • Email Marketing: Campaign creation, automation, and analytics
  • Landing Pages: Drag-and-drop page builder and forms
  • Marketing Automation: Workflows and lead nurturing
  • Social Media: Publishing, monitoring, and reporting
  • SEO Tools: Recommendations and content strategy
  • Content Management: Blog, website pages, and CTAs
  • Lead Management: Scoring, segmentation, and lifecycle stages
  • Analytics: Attribution reporting and ROI analysis

Key Features

  • REST API v3: Comprehensive marketing capabilities
  • Workflow API: Programmatic automation management
  • Forms API: Dynamic form creation and submissions
  • Email API: Transactional and marketing emails
  • Content API: CMS and blog management
  • Analytics API: Performance metrics and attribution
  • Social API: Multi-channel social media management
  • File Manager API: Asset management and CDN

What You Can Do with HubSpot Marketing MCP Server

The MCP server transforms HubSpot Marketing API into a natural language interface, enabling AI agents to:

Email Marketing

  • Campaign Management

    • "Create email campaign for product launch"
    • "Schedule newsletter for next Tuesday at 10 AM"
    • "Clone best-performing email from last month"
    • "A/B test subject lines for higher open rates"
  • Email Analytics

    • "Show email performance metrics for Q4"
    • "Find emails with highest click-through rates"
    • "Track unsubscribe trends over time"
    • "Analyze device and client usage"
  • List Management

    • "Create smart list of engaged contacts"
    • "Segment contacts by lifecycle stage"
    • "Suppress bounced emails from campaigns"
    • "Export list for sales follow-up"

Marketing Automation

  • Workflow Creation

    • "Build lead nurturing workflow for new signups"
    • "Create re-engagement campaign for inactive contacts"
    • "Set up lead scoring automation"
    • "Design customer onboarding sequence"
  • Workflow Management

    • "Pause workflow for maintenance"
    • "Update delay timers between emails"
    • "Add branching logic based on behavior"
    • "Monitor workflow performance"
  • Trigger Configuration

    • "Trigger workflow on form submission"
    • "Start automation based on page visits"
    • "React to email engagement"
    • "Respond to lifecycle stage changes"

Landing Pages & Forms

  • Page Creation

    • "Create landing page for webinar registration"
    • "Build thank you page with content offer"
    • "Design mobile-responsive product page"
    • "Clone and modify existing template"
  • Form Management

    • "Create progressive profiling form"
    • "Add custom fields to contact form"
    • "Set up dependent form fields"
    • "Configure form submission actions"
  • Conversion Optimization

    • "A/B test landing page variations"
    • "Add smart CTAs based on lifecycle stage"
    • "Implement exit intent popups"
    • "Track form conversion rates"

Analytics & Reporting

  • Campaign Analytics

    • "Generate ROI report for email campaigns"
    • "Track multi-touch attribution"
    • "Analyze campaign influence on revenue"
    • "Compare channel performance"
  • Website Analytics

    • "Show top-performing blog posts"
    • "Track organic traffic growth"
    • "Monitor page conversion rates"
    • "Analyze visitor behavior flow"
  • Lead Analytics

    • "Track lead generation by source"
    • "Monitor MQL to SQL conversion"
    • "Analyze lead quality scores"
    • "Report on lifecycle stage progression"

Content Management

  • Blog Management

    • "Publish blog post with SEO optimization"
    • "Schedule content calendar for month"
    • "Update blog categories and tags"
    • "Track blog performance metrics"
  • Website Pages

    • "Create new service page"
    • "Update homepage content modules"
    • "Manage navigation menus"
    • "Optimize page load speed"
  • File Management

    • "Upload images to file manager"
    • "Organize assets in folders"
    • "Resize images for web optimization"
    • "Track file usage across content"

Social Media Management

  • Publishing

    • "Schedule social posts across channels"
    • "Create social media campaign"
    • "Share blog posts to social networks"
    • "Queue evergreen content"
  • Monitoring

    • "Track brand mentions"
    • "Monitor competitor activity"
    • "Respond to social interactions"
    • "Analyze engagement metrics"
  • Reporting

    • "Generate social media ROI report"
    • "Track follower growth"
    • "Analyze post performance"
    • "Compare channel effectiveness"

Prerequisites

  • Access to Cequence AI Gateway
  • HubSpot account with Marketing Hub
  • Super Admin or Marketing permissions
  • App creation capabilities in HubSpot

Step 1: Create HubSpot App

Before setting up the MCP server, you need to create an app in HubSpot.

1.1 Access HubSpot Developers

  1. Navigate to developers.hubspot.com
  2. Sign in with your HubSpot account
  3. Click Manage apps

1.2 Create New App

  1. Click Create app
  2. Fill in app details:
    • App name: "AI Gateway Marketing MCP"
    • Description: "MCP server for Marketing Hub automation"

1.3 Configure OAuth

  1. Navigate to Auth tab
  2. Set Redirect URL:
    https://auth.aigateway.cequence.ai/v1/outbound/oauth/callback
  3. Select required scopes (see Available Scopes section)

1.4 Get Credentials

  1. Go to App info tab
  2. Copy App ID
  3. Copy Client ID
  4. Copy Client secret

Step 2: Access AI Gateway Apps

  1. Log in to your Cequence AI Gateway dashboard
  2. Navigate to Apps in the left sidebar

Step 3: Find and Select HubSpot Marketing API

  1. Browse the Third-party category
  2. Look for HubSpot Marketing
  3. Click on the API card

Step 4: Create MCP Server

Click Create MCP Server to start the wizard.

Step 5: Configure API Endpoints

  1. Base URL is pre-filled: https://api.hubapi.com
  2. Select API endpoints to expose
  3. Click Next

Step 6: MCP Server Basic Setup

  1. MCP Server Name: "HubSpot Marketing Automation"
  2. Description: "Email marketing and automation platform"
  3. Production Mode: Toggle as needed
  4. Click Next

Step 7: Configure Authentication

  1. Authentication Type: OAuth 2.0
  2. Fill in OAuth settings from HubSpot app
  3. Select required scopes

Available HubSpot Marketing OAuth Scopes

Email & Automation

  • marketing-emails

    • Create and send emails
    • Manage email campaigns
    • Access email analytics
    • Handle subscriptions
  • automation

    • Create workflows
    • Manage automation
    • Access workflow analytics
    • Handle enrollments

Content Management

  • content

    • Manage website pages
    • Blog operations
    • File management
    • Landing pages
  • forms

    • Create forms
    • Access submissions
    • Manage form fields
    • Track conversions

Analytics & Social

  • analytics.source_data.read

    • Access analytics data
    • Attribution reports
    • Traffic sources
    • Campaign performance
  • social

    • Social publishing
    • Monitor mentions
    • Track engagement
    • Manage accounts

For Email Marketing:

marketing-emails
automation
contacts
forms

For Full Marketing:

marketing-emails
automation
content
forms
analytics.source_data.read
social
contacts

Step 8: Configure Security

Enable API Protection and click Next.

Step 9: Choose Deployment Method

Select deployment preference and click Next.

Step 10: Review and Deploy

Review and click Create & Deploy.

Using Your HubSpot Marketing MCP Server

With Claude Desktop

{
"servers": {
"hubspot-marketing": {
"url": "your-mcp-server-url",
"auth": {
"type": "oauth2",
"client_id": "your-client-id"
}
}
}
}

Natural Language Commands

  • "Create welcome email series for new subscribers"
  • "Show email campaign performance from last month"
  • "Build landing page for ebook download"
  • "Set up lead scoring workflow"
  • "Generate marketing attribution report"

API Integration Example

// Initialize MCP client
const mcpClient = new MCPClient({
serverUrl: 'your-mcp-server-url',
auth: {
type: 'oauth2',
token: 'access-token'
}
});

// Create email campaign
const campaign = await mcpClient.hubspot.marketing.emails.create({
name: 'Summer Sale Campaign',
subject: 'Exclusive Summer Deals - Save 20%',
fromName: 'Your Company',
replyTo: 'marketing@company.com',
campaignName: 'Summer Sale 2025'
});

// Create workflow
const workflow = await mcpClient.hubspot.automation.workflows.create({
name: 'New Customer Onboarding',
type: 'DRIP_DELAY',
onEnrollmentTriggerType: 'LIST',
listId: 'list-id',
actions: [
{
type: 'EMAIL',
emailId: 'welcome-email-id',
delayMillis: 0
},
{
type: 'DELAY',
delayMillis: 86400000 // 1 day
},
{
type: 'EMAIL',
emailId: 'onboarding-email-id'
}
]
});

// Create landing page
const landingPage = await mcpClient.hubspot.content.pages.create({
name: 'Summer Sale Landing Page',
templatePath: 'template-path',
slug: 'summer-sale-2025',
metaDescription: 'Get 20% off all products',
pageTitle: 'Summer Sale - Limited Time Offer'
});

// Track campaign performance
const analytics = await mcpClient.hubspot.analytics.campaigns.get({
campaignId: campaign.id,
metrics: ['emails_sent', 'opens', 'clicks', 'conversions']
});

Common Use Cases

Lead Generation

  • Landing page optimization
  • Form conversion tracking
  • Lead scoring automation
  • Progressive profiling

Email Marketing

  • Newsletter campaigns
  • Drip sequences
  • Transactional emails
  • Re-engagement campaigns

Marketing Analytics

  • Attribution reporting
  • ROI measurement
  • Channel performance
  • Conversion tracking

Security Best Practices

  1. OAuth Security:

    • Secure token storage
    • Regular rotation
    • Minimal scopes
    • Access monitoring
  2. Data Protection:

    • GDPR compliance
    • Contact permissions
    • Data encryption
    • Audit trails
  3. Campaign Security:

    • Sender authentication
    • SPF/DKIM setup
    • Unsubscribe handling
    • Spam compliance

Troubleshooting

Common Issues

  1. Email Delivery

    • Check sender reputation
    • Verify domain settings
    • Review spam scores
    • Monitor bounces
  2. Workflow Errors

    • Check enrollment criteria
    • Verify permissions
    • Review action settings
    • Monitor error logs
  3. API Limits

    • Track usage
    • Implement caching
    • Batch operations
    • Handle rate limits

Getting Help