Skip to main content
By adding a Model Context Protocol (MCP) server component to your app, you can connect external MCP servers to HubSpot agents. Once defined and installed in a customer account, these servers become available as agent tools within the agent builder. After a user connects the MCP server, its tools are also available in Breeze Assistant, allowing both experiences to access external data and functionality provided by your MCP server.
Please note: this functionality is currently in public beta. By participating in this beta, you agree to HubSpot’s Developer Terms and Developer Beta Terms. The functionality is still under active development and is subject to change based on testing and feedback.

Prerequisites

To get started with MCP server components, you’ll need:
  • A HubSpot account. MCP server components are in public beta and don’t require separate enrollment. Once you’ve set up your account, you can also create a test account in HubSpot or with the CLI to test your server in a separate environment.
  • The HubSpot CLI installed and authenticated with your HubSpot account.
  • A HubSpot app that’s configured for private or Marketplace distribution. If you’re planning to distribute to the HubSpot Marketplace, the app must be a new standalone app, not an existing Marketplace-listed app.
    • The project’s hsproject.json file must be configured to use the latest beta platform version (2027.03-beta or newer).
    • The app’s scopes must include oauth at a minimum, even if your MCP server does not read HubSpot data.
  • A functioning MCP server that’s deployed and accessible via a public URL. Note that HubSpot’s authorization flow does not support Dynamic Client Registration (DCR). You will need to generate a valid client ID for customers to connect to your MCP server, and this is a required field in the component schema.
Please note: your MCP server must be reachable from the public internet, not just your local machine. During the connection flow, HubSpot’s backend performs OAuth metadata discovery and token exchange server-side. URLs pointing to localhost or private networks will fail with a generic “Authentication failed” error, even if the server is running locally.For local development, use a tunneling service such as ngrok or Cloudflare Tunnel to expose your server via a public HTTPS URL, and set mcpUrl to the tunnel URL.

Marketplace distribution

If you plan to distribute an MCP server through the HubSpot Marketplace, add the component to a new standalone app and submit the app with its own Marketplace listing. Do not add the component to an existing Marketplace-listed app. Marketplace-distributed apps with MCP server components must complete Ecosystem review and approval before installed customers can access the server. You can use feature flags to test the component with up to five installed accounts before approval. Learn more about distribution and feature flags.

Integration overview

At a high level, integrating with MCP server components involves:
  1. Updating your project to 2027.03-beta: update your app and project to the 2027.03-beta platform version before adding an MCP server component.
  2. Defining the server: in your HubSpot project, add an MCP server component and configure it with your MCP server’s connection details.
  3. Implementing OAuth: ensure your server implements the OAuth endpoint requirements, including discovery, PKCE support, and the fixed redirect URI.
  4. Deploying to HubSpot: upload your project to your HubSpot account using the HubSpot CLI.
  5. Installing the app: install the app into a target HubSpot account.
  6. Testing the connection: test the connection to the MCP server from your HubSpot account.
  7. Distribution and feature flags: for marketplace-distributed apps, enable testing for selected installed accounts and complete Ecosystem review before broader release.
  8. Testing your server: verify your MCP tools in your app’s settings, then test them in the agent builder and Breeze Assistant.

Update your project to 2027.03-beta

Before adding an MCP server component, update your project’s platformVersion to 2027.03-beta. This setting is defined in the hsproject.json file in the project directory. The hsproject.json file is located at the project root.
project
hsproject.json
src
For example:

Define an MCP server component

To define an MCP server component, you must create a *-hsmeta.json file within the mcp-server directory within app/. This file will contain your MCP server configuration options.
project
src
app
app-hsmeta.json
mcp-server
main-server-hsmeta.json
Below are the configuration options available for MCP server type schemas (*-hsmeta.json).
Once you’ve defined your MCP server component, upload your project to HubSpot using the hs project upload command.
If you receive an error of unsupported type: mcp-server, ensure the platformVersion in your project’s hsproject.json file is configured to 2027.03-beta.

MCP server OAuth requirements

HubSpot connects to your MCP server using an OAuth 2.1 authorization code flow with PKCE. HubSpot’s backend initiates and coordinates this flow: it fetches OAuth metadata and exchanges the authorization code for tokens server-side. However, the authorization step where the user grants access happens through their browser, which is redirected to your MCP server’s authorization endpoint.

Required endpoints

Your MCP server must implement the following endpoints, per the MCP authorization specification and RFC 8414.

Authorization

HubSpot redirects to your server’s authorization endpoint using PKCE with the S256 challenge method. Your authorization endpoint must support the following:
  • Client ID: HubSpot passes the mcpClientId from your component schema as the client_id parameter throughout the flow. Your server must recognize this value.
  • PKCE (S256): HubSpot includes code_challenge and code_challenge_method=S256 parameters in the authorization request.
  • Fixed redirect URI: HubSpot always uses https://oauth-redirect.hubspot.com/callback/mcp_server as the redirect URI. Your OAuth server must be configured to accept this URI.
  • Scopes: if your configuration includes requiredScopes, these scopes will be associated with the connection. Your authorization endpoint should grant the requested scopes and your token endpoint should include them in the access token response.
Please note: the redirect URI https://oauth-redirect.hubspot.com/callback/mcp_server is fixed and cannot be customized. You must register this URI in your MCP server’s OAuth configuration, or the authorization flow will fail.

Token exchange

After the user authorizes, HubSpot’s backend exchanges the authorization code for tokens by sending a POST request to your token endpoint. This request includes the PKCE code_verifier for validation. Because this exchange happens server-side, your token endpoint must be publicly reachable. HubSpot currently requires the authorization code exchange to return both an access token and a refresh token. Your authorization server must also support the refresh_token grant so HubSpot can obtain a new access token after the current one expires.

Refresh tokens and offline_access

The refresh token requirement is specific to HubSpot’s MCP OAuth client. OAuth 2.1 allows the authorization server to decide whether to issue refresh tokens, and the MCP authorization specification states that clients must not assume they will receive one. Some authorization servers use the optional OpenID Connect offline_access scope to request a refresh token. Other authorization servers issue refresh tokens without this scope or may reject or ignore it. HubSpot does not automatically add offline_access to the authorization request. Add offline_access to requiredScopes only when your authorization provider requires or accepts it. For example:
If the authorization server metadata includes offline_access in scopes_supported, you can use that as a signal that the server supports the scope. Its absence does not necessarily mean the scope is unsupported, so confirm the expected configuration in your provider’s documentation and verify that the token response includes a refresh token.

Example metadata response

Below is an example of the JSON your /.well-known/oauth-authorization-server endpoint should return:

Install the app

With your project deployed, you can install the app into a target HubSpot account. To do this, you’ll navigate into HubSpot to get the install URL, along with the app’s client ID and secret for your OAuth server. For private distribution, use the privately distributed OAuth app install flow. For Marketplace distribution, use the OAuth marketplace app install flow.
  • To open the project in HubSpot from the terminal, run hs project open from within the project directory.
  • From the project page, navigate to the App in the left sidebar.
  • Click the Distribution tab.
  • Click Copy install link, then paste it into your browser to install the app into the desired target account.
  • To get your app’s client ID and secret for your OAuth server, click the Auth tab, then copy the Client ID and Client secret values.

Test the connection in HubSpot

Once the app is installed, test the connection to the MCP server from your HubSpot account:
  • In the account where you uploaded the project, navigate to Development > Projects, then click the name of the project where the app is installed.
  • In the left sidebar, navigate to the MCP server component.
  • Click Test connection.
Screenshot showing the Test connection button in the MCP server component.
  • In the dialog box, click Connect.
  • A pop-out window will appear as the OAuth handshake is attempted using the details defined in your MCP server component’s *-hsmeta.json file. If successful, you’ll see a message indicating the server is reachable and responding as expected.
If the connection does not complete or stops working after the access token expires, verify the following:
  • The initial token response includes a refresh_token.
  • The authorization server supports the refresh_token grant.
  • If the provider requires the offline_access scope, it is included in the component’s requiredScopes configuration.
Authorization servers that cannot issue refresh tokens are not currently supported by HubSpot’s MCP server connection flow.

Distribution and feature flags

For apps configured for Marketplace distribution, HubSpot automatically creates the hs-release-mcp-server feature flag in an OFF state when you add the mcp-server component. This keeps the server hidden from installed customers until your app completes Ecosystem review and approval. While the flag is OFF for an account, you can’t add the server to an agent in that account, and Breeze Assistant can’t use its tools. While you develop and prepare for review, use the feature flags API to set the hs-release-mcp-server flag to ON for up to five installed accounts for testing. After approval, you can set the app-level defaultState to ON for broader release. Learn more about the HubSpot Marketplace requirements for listing apps with MCP server components.

Testing your server

After you install your app and connect its MCP server, you can verify the server’s tools in your app’s settings, then test them in both the agent builder and Breeze Assistant. You don’t need to create separate MCP server components for each one. Before you test, make sure that:
  • The component’s enabled field is set to true. Setting it to false disables the server in HubSpot.
  • If your app is configured for Marketplace distribution, the hs-release-mcp-server feature flag is set to ON for the account. Otherwise, your MCP server won’t be usable by agents or Breeze Assistant.

Verify and manage your tools

To view the tools that your MCP server exposes to HubSpot:
  1. In your HubSpot account, click the settings icon in the top navigation bar.
  2. In the left sidebar, navigate to Integrations > Connected Apps.
  3. Click the name of your app, then click the Settings tab.
  4. In the Tool permissions section, review the list of tools.
The MCP tool listing in the app settings page
Tools are grouped as Read-only or Write, based on the readOnlyHint annotation that your MCP server sets for each tool. A tool that sets readOnlyHint to true is listed as read-only. A tool that doesn’t set it is treated as a write tool, and HubSpot asks for permission before running it by default.
Tool permission confirmation message in Breeze Assistant
After you add, remove, or change tools on your MCP server, reconnect the server in HubSpot to refresh the list of tools.
Breeze Assistant loads MCP tool schemas when needed for a request rather than loading all connected servers’ tool schemas at the start of every conversation turn.

Test in the agent builder

To test your MCP tools in the agent builder:
  1. In the account where your app is installed, navigate to Agent Hub.
  2. On the Agent Hub dashboard, click Edit next to an existing agent, or create a new one.
  3. In the agent editor, click Add action.
Add your MCP server to an agent by clicking Add action in the agent editor
  1. In the sidebar, click the Connectors tab, then select your MCP server under Connected MCPs.
Select your MCP server in the Connectors tab of the Add action panel of the agent editor
After you add the action and save your changes, test the agent:
  1. At the top of the agent editor, click Test.
  2. In the Test agent section, fill in any fields as needed, then click Run agent.
  3. View the results in the Activity and Outputs tabs.
  4. At the top, you can also view high-level details about the run, including its success status, estimated credit usage, run time, and a score.
Learn more about testing agents.

Test in Breeze Assistant

After you connect your MCP server, it appears in Breeze Assistant’s connectors. To test your MCP server in Breeze Assistant:
  1. In the account where your app is installed, click Breeze Assistant in the top navigation bar.
  2. In the message box, click the + icon, then click Connectors.
  3. Confirm that your MCP server appears in the list, and that it’s enabled. If the server isn’t listed, click Add connector to connect it.
Add and manage connectors in the Breeze Assistant chat window
  1. Send a prompt that requires one of your MCP tools. Breeze Assistant runs read-only tools without asking. For other tools, it asks for permission first.
To review a connected server’s available actions, or to set permissions for each tool, click Manage connectors. You can also view and manage your MCP server’s tools in your app’s settings. Learn more about managing connectors in Breeze Assistant in HubSpot’s Knowledge Base.
Last modified on November 24, 2026