Skip to main content
Back to the HubSpot MCP server

MCP Gateway · Claude Code

HubSpot icon

Connect HubSpot to Claude Code

Writing code that syncs with HubSpot means knowing its data model: which properties exist, what types they hold and how objects relate. With HubSpot behind the Speakeasy MCP Gateway, Claude Code can inspect that model directly from the terminal. Agent hooks check each prompt and tool call, and Claude Code never stores a HubSpot credential.

Category
Sales & CRM
Tools
13
Authentication
OAuth
Claude Code
CLI

Behind the MCP Gateway

Run HubSpot MCP behind the MCP Gateway

One URL for every agent, sign-in through your IdP, RBAC down to the tool, and every HubSpot call inspected and logged.

Deploy on MCP Gateway

Before you start

What HubSpot needs first

A HubSpot user with access to the Development workspace; an account admin for the first connection does the HubSpot side of the setup.

  • The remote MCP server is available to all HubSpot accounts.
  • You need a user who can open the Development workspace.
  • The first connection should be made by an account admin.

In HubSpot

  1. Open Development > MCP Connectors.
  2. Create an MCP connector with the Speakeasy redirect URL.
  3. Copy the Client ID and Client secret.
Full HubSpot setup guide in the docs

Set up

Add HubSpot to Claude Code in 4 steps

  1. 01

    Add HubSpot from the catalog

    An admin finds HubSpot in the MCP Catalog (MCP Gateway > MCP > Catalog) and clicks Add. Speakeasy registers the vendor's server as a remote MCP server and proxies sessions to it. Nothing is copied or re-hosted.

    HubSpot uses OAuth. Servers that support dynamic client registration get their OAuth configuration applied automatically.

    Where MCP-scoped policies are enabled, the install offers a recommended risk policy for the new server that detects secrets and PII and inspects tool requests and responses.

  2. 02

    Choose who can use HubSpot

    Give teams the mcp:connect scope on the HubSpot server through team access or a role. The organization gateway works out each person's servers from their live access, so granting access adds HubSpot to their gateway on the next call, and removing it takes it away.

  3. 03

    Connect Claude Code

    Add the organization gateway as an HTTP MCP server, then authenticate from /mcp.

    Run the command below with your organization gateway URL.

    Open /mcp in Claude Code and choose Authenticate to sign in.

    claude mcp add --transport http --scope user \
      'speakeasy' \
      'https://<organization host>/mcp/gateway/<organization slug>'
  4. 04

    Sign in and use HubSpot from Claude Code

    The first time Claude Code connects, it opens a browser so the person can sign in to Speakeasy through your identity provider.

    HubSpot needs its own OAuth grant, so each person connects it once. Until they do, HubSpot calls fail while the rest of the gateway keeps working.

    From then on, HubSpot's tools appear in Claude Code, limited to what the person's access allows, and every call lands in the gateway's tool logs.

To roll it out to a whole team, publish the server in a plugin and register the plugin marketplace in Claude Code's managed settings, so every member gets it without running the command. The device agent can also write and reapply these settings on each laptop.

Use cases

What Claude Code users do with HubSpot

Map fields for a sync job

Before writing a mapping between your database and HubSpot, Claude Code fetches the property definitions for contacts or deals, including data types and the valid enumeration values.

get_propertiessearch_properties

Sample records to learn the shape

Claude Code lists a few CRM records without filters, then fetches them by ID to see their real properties and timestamps before you write the parser.

search_crm_objectsget_crm_objects

Check which objects you can reach

Start with the current user's details to see which CRM object types and tools the connected HubSpot account has, so the code doesn't target something unavailable.

get_user_details

Tools

13 tools

Each HubSpot tool can be allowed or denied per team and role at the MCP Gateway before Claude Code sees it.

search_crm_objects

Searches and retrieves CRM records from HubSpot based on filters and criteria.

submit_feedback

Collects and submits feedback to HubSpot on dissatisfaction or user request.

get_campaign_contacts_by_type

Get paginated contact IDs for a campaign filtered by attribution type.

search_owners

Lists and searches for owners who can be assigned to CRM records.

get_campaign_analytics

Get campaign analytics (METRICS or REVENUE_ATTRIBUTION) for one or more campaigns. Each entry in the request list is a full analytics request. Each response contains the campaignObjectId of the requested campaign.

get_campaign_asset_types

List the asset type names available as campaign assets (e.g. LANDING_PAGE, BLOG_POST). Use the returned names as the assetType parameter in getCampaignAssetMetrics.

See all 13 tools

Control

What Speakeasy can see and stop in Claude Code

The gateway covers every client the same way. The rest depends on what Claude Code exposes to Speakeasy.

Tool logs

Gateway

Every HubSpot call is logged with the person and the client that made it.

Access by role

Gateway

People reach only the HubSpot tools their team or role allows.

Request and response blocking

Gateway

A risk policy scoped to HubSpot can reject a tool request before it reaches the server, or withhold a result from Claude Code. MCP-scoped policies are enabled per organization.

Prompt and tool-call blocking

Claude Code

Agent hooks send each prompt and tool call to Speakeasy, which allows or denies it before Claude Code runs it.

User attribution

Claude Code

Claude Code's OpenTelemetry exporter ties each session to a named person. Without it, activity can't be attributed.

Budgets

Claude Code

Spend limits can block Claude Code traffic once a budget is reached.

Device agent and MDM

Claude Code

The device agent installs the marketplace, plugin and telemetry settings and reapplies them every minute. It deploys through MDM.

Anthropic inference hooks

Claude Code

On Claude Enterprise, prompts can be checked before inference with nothing installed on the device (beta).

  • Claude Code on the web doesn't use the laptop setup. It needs the device agent in a shared Anthropic-hosted environment.
  • Plugin marketplace URLs for Claude Code carry an access token, so share install snippets only through a private channel.

Questions

Frequently asked questions

What does HubSpot need before Claude Code can connect?
Someone who can open HubSpot's Development workspace creates an MCP connector with the Speakeasy redirect URL and copies its Client ID and Client secret. For the account's first connection, use an account admin.
Can Claude Code change HubSpot records through this server?
The catalog's HubSpot tools search and read CRM records, properties, owners, campaigns and account details. None of the listed tools create or edit records.
How do Claude Code users get HubSpot?
An admin adds HubSpot from the Speakeasy MCP Catalog and grants access by team or role. Add the organization gateway as an HTTP MCP server, then authenticate from /mcp. Each person then sees only the HubSpot tools their access allows.
Are HubSpot calls from Claude Code logged?
Yes. HubSpot calls go through the MCP Gateway, which logs each tool call and attributes it to the person and the client that made it.

Connect more

HubSpot in other clients

AI everywhere.

Control here.