MCP Gateway · OpenCode
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.
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
- Open Development > MCP Connectors.
- Create an MCP connector with the Speakeasy redirect URL.
- Copy the Client ID and Client secret.
Set up
Add HubSpot to OpenCode in 4 steps
- 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.
- 02
Choose who can use HubSpot
Give teams the
mcp:connectscope 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. - 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
mcpblock of your OpenCode config withtypeset toremote.Restart OpenCode and sign in when prompted.
{ "mcp": { "<server slug>": { "type": "remote", "url": "<URL from the hosted install page>" } } } - 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.
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.
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.
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.
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?
How do I install Speakeasy's observability for OpenCode?
How do OpenCode users get HubSpot?
Are HubSpot calls from OpenCode logged?
Connect more