Skip to main content
Back to the HubSpot MCP server

MCP Gateway · OpenCode

HubSpot icon

Connect HubSpot to OpenCode

Quick questions about CRM data, like how many deals are open in a stage, often turn into one-off scripts. With HubSpot added to OpenCode as a remote MCP server, you can ask from the terminal instead. The OpenCode plugin sends each prompt and tool call to Speakeasy to allow or deny, and token and cost totals are reported per turn.

Category
Sales & CRM
Tools
13
Authentication
OAuth
OpenCode
Terminal

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 OpenCode 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. OpenCode connects to the HubSpot server's own URL, and the server's authorization decides who can connect and which tools they can call.

  3. 03

    Connect OpenCode

    Add the server to OpenCode's own mcp config block as a remote server.

    Copy the server's URL from its hosted install page in Speakeasy.

    Add it to the mcp block of your OpenCode config with type set to remote.

    Restart OpenCode and sign in when prompted.

    {
      "mcp": {
        "<server slug>": {
          "type": "remote",
          "url": "<URL from the hosted install page>"
        }
      }
    }
  4. 04

    Sign in and use HubSpot from OpenCode

    The first time OpenCode 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 OpenCode, limited to what the person's access allows, and every call lands in the gateway's tool logs.

OpenCode doesn't receive MCP servers from plugins. The observability package is installed separately, from a ZIP or with speakeasy-hooks install --provider=opencode, and the device agent can maintain it.

Use cases

What OpenCode users do with HubSpot

Count records without a script

Ask OpenCode how many companies match a filter. The search returns a total count, so you get the number without paging through results.

search_crm_objects

List the campaign asset types

Before writing code against campaign assets, have OpenCode list the asset type names the account supports, such as landing pages or blog posts.

get_campaign_asset_types

Report a wrong answer to HubSpot

If a HubSpot tool returns something clearly wrong, tell OpenCode, and it submits the feedback to HubSpot after giving you the corrected answer.

submit_feedback

Tools

13 tools

Each HubSpot tool can be allowed or denied per team and role at the MCP Gateway before OpenCode 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 OpenCode

The gateway covers every client the same way. The rest depends on what OpenCode 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 OpenCode. MCP-scoped policies are enabled per organization.

Prompt and tool-call blocking

OpenCode

The OpenCode plugin sends each prompt and tool call to Speakeasy, which allows or denies it before it runs.

Usage telemetry

OpenCode

Token and cost totals flow through the plugin, reported per turn.

Device agent

OpenCode

The device agent installs and maintains the observability package.

  • OpenCode has no OpenTelemetry exporter, so session data comes through the plugin.
  • Tool output is blocked at the gateway rather than in OpenCode's hooks.

Questions

Frequently asked questions

Does OpenCode get HubSpot from the plugin marketplace?
No. OpenCode doesn't receive MCP servers from plugins. You copy the server URL from its hosted install page and add it to the mcp block of your OpenCode config.
How do I install Speakeasy's observability for OpenCode?
Install the observability package from a ZIP or with speakeasy-hooks install --provider=opencode. The device agent can install and maintain it.
How do OpenCode users get HubSpot?
An admin adds HubSpot from the Speakeasy MCP Catalog and grants access by team or role. Add the server to OpenCode's own mcp config block as a remote server. Each person then sees only the HubSpot tools their access allows.
Are HubSpot calls from OpenCode 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.