Building a Better HubSpot Integration with MCP, Test Accounts, and App Cards
November 15, 2025 • Bojan
November 15, 2025 • Bojan

When people think “HubSpot integration,” they usually picture a few API calls, some brittle webhooks, and a staging portal that never quite behaves like production.
That used to be me, too.
But with HubSpot’s new developer stack – local MCP server, configurable test accounts, and React-based app cards – you can build and test integrations like a real product team instead of a collection of scripts taped together.
In this article, I’ll walk through how I’m using these tools to build a deep HubSpot integration for a WordPress-based SaaS (SampleHQ), and how you can steal the same workflow for your own app.
We’ll cover:
A typical integration story looks like this:
If your app needs to:
…that kind of chaos stops being “annoying” and starts being dangerous.
The new HubSpot dev tools solve three big problems:
Let’s wire those pieces together.
First step: give your AI assistant actual access to HubSpot’s developer context, instead of treating it like just another chatbot.
HubSpot ships a developer MCP server that runs locally and talks to your IDE / AI client. Once installed, it can:
7.6.0 or higher (hs --version)Install / update the CLI:
npm install -g @hubspot/cli@latest
In your terminal:
hs mcp setup
You’ll be prompted to select which client to connect (e.g., Cursor, Claude Code, VS Code). Once you pick your client and finish setup, restart the client so it can see the new MCP server.
Now your AI assistant can answer questions like:
Instead of copy-pasting from docs, you’re effectively pair programming with the HubSpot platform itself.
Next, you need somewhere safe (and realistic) to test all this.
HubSpot’s configurable test accounts let you spin up developer portals that simulate specific subscription mixes and tiers – Starter, Professional, Enterprise, per hub. You can create them either via the CLI or in the UI.
Requirement: your project must be on platform version 2025.2+ and CLI 7.6.0+.
hs test-account create
Then choose:
HubSpot creates the account and prints the Hub ID. You can then:
For repeatable setups, generate a JSON config:
hs test-account create-config
The prompts are similar (name, description, subscriptions), but this time HubSpot writes a JSON file like:
{
"accountName": "AllHubsProfessional",
"description": "Professional test account",
"marketingLevel": "PROFESSIONAL",
"opsLevel": "PROFESSIONAL",
"serviceLevel": "PROFESSIONAL",
"salesLevel": "PROFESSIONAL",
"contentLevel": "PROFESSIONAL"
}
Now you can create accounts on demand:
hs test-account create --config-path ./test-portal-config.json
This is perfect when you want:
…and you want your CI/CD pipeline to spin up portals automatically during integration tests.
An empty CRM isn’t very useful for testing.
HubSpot lets you seed test accounts with CRM data using the CLI and the CRM imports API behind the scenes.
The pattern:
Example JSON for importing contacts and companies:
{
"name": "Test account data import (contact and company)",
"importOperations": {
"0-1": "CREATE",
"0-2": "CREATE"
},
"files": [
{
"fileName": "contact-data.csv",
"fileFormat": "CSV",
"fileImportPage": {
"hasHeader": true,
"columnMappings": [
{
"columnObjectTypeId": "0-1",
"columnName": "First Name",
"propertyName": "firstname"
},
{
"columnObjectTypeId": "0-1",
"columnName": "Email",
"propertyName": "email",
"columnType": "HUBSPOT_ALTERNATE_ID"
}
]
}
},
{
"fileName": "company-data.csv",
"fileFormat": "CSV",
"fileImportPage": {
"hasHeader": true,
"columnMappings": [
{
"columnObjectTypeId": "0-2",
"columnName": "Company domain name",
"propertyName": "domain",
"columnType": "HUBSPOT_ALTERNATE_ID"
}
]
}
}
]
}
Place the JSON and CSV files in the same directory, then run:
hs test-account import-data
The CLI will ask:
Then it fires the CRM imports API and gives you a link to the imports dashboard so you can monitor progress and errors.
For something like SampleHQ, this is where I’ll import:
That way, when the app card loads, it has real-looking data to work with.
Now the fun part: having your app actually show up inside HubSpot.
On the latest developer platform (2025.2), you can build React-based app cards that live on object records (like contacts). Perfect for showing:
From your project directory:
hs project add
When prompted for a component, select Card.
HubSpot scaffolds:
myProject
└── src/
└── app/
└── cards/
├── NewCard-hsmeta.json
├── NewCard.jsx
└── package.json
NewCard-hsmeta.json – configuration (placement, object type, etc.)NewCard.jsx – your React UIpackage.json – dependencies used for bundlingInstall card dependencies:
hs project install-deps
Then upload:
hs project upload
# or, for a specific account:
hs project upload --account YOUR_TEST_HUB_ID
You can open the project in the browser with:
hs project open
From there, install the app into your test account via the Distribution tab → Install now.
In your HubSpot test account:
Now your boilerplate card appears on contact records.
To get instant reloads during development:
hs project dev
You’ll see a “Developing locally” tag on the card. Any changes to .jsx / .tsx files will live-reload into that card.
This is where your integration becomes tangible:
In my case, the backend is a multi-tenant WordPress plugin (samplehq-core) that:
GET /samplehq/v1/picker/candidatesPOST /samplehq/v1/picker/linkThe app card becomes the front door for HubSpot users:
On the WordPress side, everything is multi-tenant-safe and CRM-agnostic; HubSpot is just one of the registered CRM clients. But from the HubSpot user’s point of view, it feels like a native card.
The last step is to stop treating this as a “thing you click by hand” and start treating it like a proper pipeline.
Because test accounts are configurable and scriptable, you can:
hs test-account create --config-path …hs test-account import-datahs project uploadAdd GitHub Actions on top and you get a loop like:
For apps that also live in a separate backend (like a WordPress multisite), you can:
No more “it works in my portal” debugging.
If you’re building a serious HubSpot integration today, the stack I’d recommend looks like this:
hs test-account import-dataOnce you wire these pieces together, “HubSpot integration” stops being a spaghetti of webhooks and ad-hoc scripts, and starts feeling like a product surface you can ship features into.

I’m Bojan Josifoski - I’m a WordPress systems engineer who developed and maintained a proprietary WordPress-based framework used by U.S. financial institutions between 2016 and 2025.