Skip to main content Skip to footer

HubSpot Developer Blog

Connect HubSpot's MCP Server With Any AI Tool Securely

Today, you’re not just using your HubSpot data in HubSpot. You’re likely leveraging HubSpot connectors for Claude, Gemini, ChatGPT, and other tools, interacting with your AI agents directly regarding your HubSpot data. But, how do you securely connect your HubSpot account to other AI tools that don’t have built-in connectors? And, how do you make sure that generative AI is accessing your data securely? That’s where HubSpot’s custom MCP connectors come in.

First, let’s define what an MCP connector is. MCP stands for Model Context Protocol, and is a set of standards so LLMs and AI agents can connect to external tools, like HubSpot. For our sake, we are going over two types of connectors:

  • AI connectors: These connectors are built by HubSpot for you to use in AI agents like Claude and ChatGPT. They’re plug-and-play and you only need an admin to set them up for users to start benefiting from them.
  • Custom MCP connectors: These connectors are built by you to use in AI agents that don’t have built-in connectors. This opens up the number of AI systems you can securely connect your HubSpot data to any that will take your custom MCP connector credentials.

In this blog, we’re going to focus on how you can set up your own custom MCP connector, no-code required. This will establish a secure link between your HubSpot data and the third-party AI tool. The custom MCP connector respects user permissions, too.

how ai flows

Now, the most important piece of connecting HubSpot’s custom MCP connector to third-party systems is authentication. Some MCP clients will handle that for you automatically through PKCE, or Proof Key for Code Exchange. That’s the type of custom MCP connector we’ll guide you through here.

If you’re using the MCP connector with a custom integration, you’ll have to ensure your OAuth implementation includes PKCE support. We won’t be focusing on that in this blog, but if you want to learn more about OAuth 2.1 authorization with PKCE, please check out the MCP specification.

Step One: Create Your MCP Connector

Creating your custom MCP connector is all UI-based, no command-line interface needed. In your HubSpot account, go to Development, and then MCP Connectors. This screen will show you all of the MCP connectors you currently have.

 

Name your MCP connectors based on what it’s connected to, for example, “Asana-HubSpot MCP Connector”. This will help everyone on your team know at a glance which third-party systems you’ve already connected the HubSpot remote MCP server to.

To create a new MCP connector, choose the Create MCP connector button in the top right. This will open a pop-up where you’ll set the following information:

  • Name (required): the name of your custom MCP connector.
  • Description (optional): a short description of your custom MCP connector.
  • Redirect URL (required): the URL your custom MCP connector will redirect to once the OAuth authentication is successful.
  • Icon (optional): A square logo to identify your custom MCP connector. If you’re using this for a Marketplace app, it is required.

We’ll be using the MCPJam tool for this tutorial, so set the redirect URL to https://app.mcpjam.com/oauth/callback. Once all of the fields are filled out, choose the Create button.

mcp connector setup

The most important field is the redirect URL. You can have multiple redirect URLs, but when you’re setting up your MCP connector for the first time, you’ll just need a single URL. A redirect URL is critical for OAuth applications for security purposes.

Here’s an analogy so you can better understand the importance of redirect URLs. When you stay at a hotel, you get a key card that can only open your room. OAuth works the same way. Instead of giving the AI agent your HubSpot password, you give it a limited key. The redirect URL is like the name on the reservation. It’s registered in advance, and the hotel only hands the key to the person listed with valid ID. Someone else can’t show up and claim it.

Step Two: Connecting your MCP Connector to a Third-party System

Now that your custom MCP connector is set up, it’s time to connect it somewhere. This is where MCPJam Inspector comes in. This web-based playground allows you to connect and test your MCP connector with Claude, ChatGPT, and Cursor, an AI development tool.

You will need to create a free account to use MCPJam. If you would rather not use a third-party tool that requires you to sign in, you can use the local playground tool, MCP Inspector, which must be installed through your computer’s terminal.

Before you connect to MCPJam, you’ll need to generate PKCE values in your HubSpot account. On the MCP Connector app’s settings page, choose the Generate PKCE values button. Since this is for testing purposes, it will only be good for one-time use.

mcp connector settings page

 

Now that you’ve generated your PKCE values, go to MCPJam and then choose the Connect tab. Choose the Add your first server button. A pop-up will appear. You’ll need to fill in the following information:

  • Server name: the name of the MCP server.
  • Connection type: the type of connection to the MCP server.
  • Authentication: the type of authentication to the MCP server.

Set the server name to HubSpot, the connection type to HTTPS, the url as https://mcp.hubspot.com, and the authentication to OAuth. Then, choose Advanced Settings to set your client credentials.

mcpjam add server

Here, set Protocol to Auto and Registration Strategy to Preregistration (Client Credentials). The next piece of information you’ll need is from your MCP connector in your HubSpot account. Copy the Client ID into the required field. The Client Secret is listed as optional, but HubSpot’s remote MCP server requires it, so copy and add it into the field.

Once all of the fields have been filled in, choose Add Server. This will start the OAuth flow where you’ll choose the HubSpot account you want to connect MPCJam to. You’ll be asked to choose which permissions you want to grant the app, so be careful, especially if you’re working in a production account. You can choose read-only permissions, which means MCPJam won’t be able to make any changes to your data.

mcp oauth

After you select the read-only permissions and choose Connect app, you will need to type in “I accept the risk” for connecting an unverified app. This extra step is for security purposes, since this isn’t a verified app. Since we are only giving the app read-only permissions, it cannot change any data in your HubSpot account.

Again, use a test account for testing purposes and never connect an app to your production account that you haven’t verified yourself. Since we’ve built this app ourselves and we are only using a test account, we are safe to use this app. After you’ve typed in “I accept the risk”, choose Connect and you’ll then be redirected back to MCPJam.

i accept the risk

Now, your custom MCP connector has given your third-party system all the permissions it needs to start using the MCP tools.

Step Three: Test the Connection

In the left navigation of MCPJam, choose the Playground navigation item. This will take you to a screen where you’ll see all the tools available on the servers you’ve connected to it. To learn more about the tools the remote HubSpot MCP server has, please check out our developer docs.

mcpjam playground

Now, in the Playground section, you can ask a question in natural language and see how Claude, ChatGPT, and Cursor would respond to your question. This gives you a good approximation of how your custom MCP connector will behave with other third-party tools, as many of those apps use the frontier models like Claude and ChatGPT under the hood. If you need example prompts to get started, please check out our documentation.

mcpjam thinkingmcpjam test

Once the prompt is done running, the chat history will show you the MCP server tools the models used to make their responses. This is the power of using the remote MCP server - a standardized set of tools that generative AI can use to make informed decisions with a visible decision log of which tools it called.

A visible decision log is especially useful if generative AI is making changes to your HubSpot data, such as updating or deleting CRM data. Here’s some examples of how a generative AI decision log can help your day-to-day work:

  • Sales Teams: Review active leads, check deal pipeline status, or log meeting notes and update deal stages directly from chat, with a clear decision log confirming exactly which records were created, updated, or modified.
  • Marketing Teams: Analyze campaign performance, review email open and click rates, or create and publish landing pages and blog posts, ensuring every asset creation or content update is fully traceable.
  • RevOps Professionals: Audit deal pipelines, check historical property changes, and manage custom properties or pipelines with a transparent audit trail of every backend action the AI executes.
  • Customer Success & Support: Surface common customer complaints, flag churn risk indicators, and review cross-channel communication history (live chat, email, messaging) with complete visibility into how the AI retrieved and synthesized the data.

And, with a custom MCP connector, you can use the remote MCP server in any platform you use.

Use HubSpot, Anywhere

Creating custom MCP connectors gives you the flexibility to choose the AI platforms and models you want to use, all backed with the security of OAuth and granular access control. If it has an MCP connection point, you can use HubSpot with it. Start using your HubSpot data anywhere you work with natural language today.

For more resources on custom MCP connectors and the remote HubSpot MCP server, check out the following:


About the Author

Brooke Bond

Brooke is a developer advocate with HubSpot. She creates educational content focused on front-end development, APIs, and UX. When she's not coding or teaching, she enjoys cooking, reading, and being overly competitive about board games.