Skip to main content
Glama
mcpship-hubspot

mcpship-hubspot

mcpship-hubspot

A production-shaped HubSpot MCP connector: three read actions plus one guarded write, with an audit log on every call.

This is the same skeleton you hand to a client. Swap the object types in src/hubspot.ts and it becomes the Zendesk or Intercom build.

What's inside

Tool

Type

What it does

search_contacts

read

Search contacts by name, email, company; falls back to most-recently-modified

search_deals

read

Search deals by name; no query returns recent deals

recent_notes

read

Read notes logged against contacts and deals

create_note

write, gated

Writes a note, optionally attached to a deal. Off unless HUBSPOT_ALLOW_WRITE=true

The write tool is off by default. That is deliberate: it is the first thing a security reviewer will ask about, and "it ships disabled, you enable it explicitly" is a much better answer than "it's on".

Related MCP server: BackCrew HubSpot MCP Server

1. Get a token

Do not test this against a real portal. Create a developer test account first — it is free, blank, and disposable:

  1. Sign in at developers.hubspot.com and create a developer account (free).

  2. In that account: Development → Testing → Test Accounts → Create developer test account.

Then get a token. Which screen you land on depends on the account's age and tier:

Service keys — newer and free-tier accounts. HubSpot retired legacy private apps for these. Go to Development → Keys → Service Keys → Create service key, name it, and select these six scopes:

crm.objects.companies.read
crm.objects.companies.write
crm.objects.contacts.read
crm.objects.contacts.write
crm.objects.deals.read
crm.objects.deals.write

Private apps — older accounts only. Settings → Integrations → Private Apps → Create private app, same scopes.

Copy the token (pat-...). It is shown once and cannot be recovered.

Notes have no scope of their own. The service-key catalogue lists no crm.objects.notes.*, and none is needed: reading and writing notes on contacts, companies or deals is covered by that object's scopes. Verified against a live portal — recent_notes and create_note both work with the six scopes above. If you see a 403 on either, the missing piece is the object scope, not a notes one.

2. Build

cd mcp-hubspot
npm install
npm run build

You should end up with dist/index.js.

Fill the test account with something to read

An empty portal makes the tool look broken. This seeds seven companies, eight contacts, seven deals and twelve notes — a plausible B2B SaaS pipeline with one deal blocked on a compliance letter, one won, one lost:

export HUBSPOT_ACCESS_TOKEN=pat-na1-...
npm run seed

Fictional data, but internally consistent. Only run it against a test account; there is no wipe flag on purpose.

Verify against the real API

initialize succeeding proves the server started, not that the calls work. This exercises every tool and prints what came back:

export HUBSPOT_ACCESS_TOKEN=pat-na1-...
npm run smoke

# include the write tool
HUBSPOT_ALLOW_WRITE=true npm run smoke

Run it before you demo, not after.

Verify through the protocol

npm run smoke calls the HubSpot layer directly. This starts the built server on stdio and drives it the way Claude Desktop does — handshake, tools/list, then a real tools/call:

npm run check:mcp
PASS  initialize            mcpship-hubspot 0.1.0
PASS  tools/list            4: search_contacts, search_deals, recent_notes, create_note
PASS  tools/call            7 deal(s), first: Kestrel — renewal + 3 seats

Two different failure modes, two different checks: smoke catches a bad token, check:mcp catches a corrupted stdio channel (a stray console.log, a bad path, a crash on startup).

3. Wire it into Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "hubspot": {
      "command": "node",
      "args": ["/ABSOLUTE/PATH/TO/mcp-hubspot/dist/index.js"],
      "env": {
        "HUBSPOT_ACCESS_TOKEN": "pat-na1-your-token-here",
        "HUBSPOT_ALLOW_WRITE": "true"
      }
    }
  }
}

args must be an absolute path. Then fully quit and reopen Claude Desktop — reloading the window is not enough.

Codex

Codex reads ~/.codex/config.toml. Let the CLI write it rather than hand-editing TOML:

codex mcp add hubspot \
  --env HUBSPOT_ACCESS_TOKEN=pat-na1-... \
  --env HUBSPOT_ALLOW_WRITE=true \
  -- node /ABSOLUTE/PATH/TO/mcp-hubspot/dist/index.js

Verify it registered and actually answers:

codex mcp list
codex exec --skip-git-repo-check "Use the hubspot tools. What is blocking the Northwind deal?"

A working run looks like this — the tool calls are named in the transcript:

mcp: hubspot/search_deals started
mcp: hubspot/search_deals (completed)
mcp: hubspot/recent_notes started
mcp: hubspot/recent_notes (completed)

One thing to know: Codex will ask for far more rows than you expect (limit: 100 is its first guess). The limit is capped at HubSpot's own page size, 100, so that first call succeeds instead of bouncing on validation.

4. Verify it actually works

Ask your client:

What deals did we touch this week?

It should call search_deals and return real records. If you get "I don't have access to your data", the server did not load — go to the troubleshooting below.

Check the audit trail:

tail -f ~/.mcpship/logs/audit.log

Every call appends one JSON line: tool, args, ok, duration.

Troubleshooting

Server doesn't appear in Claude at all Check the MCP log: ~/Library/Logs/Claude/mcp-server-hubspot.log. A bad absolute path is the usual cause.

HUBSPOT_ACCESS_TOKEN is not set The env block is not being read. In Claude Desktop, env vars go inside the server entry — shell exports do not reach it.

401 / 403 401 means the token is wrong or revoked. 403 means the token is valid but missing a scope — add it in the Private App settings and copy the new token.

Server loads, then disconnects immediately Something is writing to stdout. Under stdio transport, stdout is the JSON-RPC channel; a single console.log corrupts the stream. All logging in this project goes to stderr on purpose. Keep it that way.

Adapting this for a client delivery

  1. Change CONTACT_PROPERTIES / DEAL_PROPERTIES in src/hubspot.ts to the fields they actually care about.

  2. Rename the tools to match their vocabulary (search_tickets, not search_deals).

  3. Set MCP_AUDIT_DIR to a path inside their infrastructure.

  4. Hand over the repo plus the token scoping instructions. No vendor dependency, no subscription.

Five days is enough for this because the second build only changes the middle layer.

Available Tools

4 tools
create_noteA

Write a note into HubSpot, optionally attached to a specific deal. Disabled unless HUBSPOT_ALLOW_WRITE=true.

Inputs: body (required), deal_id.

recent_notesA

Read recent notes logged against contacts and deals. Use this to recall context before summarizing an account.

Inputs: limit, query.

search_contactsA

Search HubSpot contacts by name, email, or company. With no query, returns the most recently modified contacts.

Inputs: limit, query.

search_dealsA

Search HubSpot deals by name. With no query, returns the most recently modified deals — use this for questions like 'what deals did I touch this week'.

Inputs: limit, query.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool targets a distinct resource and action: contacts vs. deals for search, and read vs. write for notes. There is no meaningful overlap, and the read/write split on notes is explicitly signaled by the description and the write-flag gate.

    Naming Consistency4/5

    Three tools use a clean verb_noun pattern (search_contacts, search_deals, create_note); only recent_notes deviates with an adjective-first form. The deviation is minor and still readable, but it breaks the otherwise uniform convention.

    Tool Count3/5

    Four tools is thin for a CRM as broad as HubSpot, which spans contacts, companies, deals, tickets, and engagements. The tools that exist are well-chosen, but the surface feels like a slice rather than a scoped solution.

    Completeness2/5

    Both contacts and deals are search-only: there is no fetch-by-ID, no create/update/delete for either entity, and companies are entirely absent. Write access is limited to notes, so any request to create or modify a deal or contact becomes a dead end.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Exposes HubSpot CRM data and actions as tools for AI agents, enabling contact lookup, company search, contact creation, and activity logging via natural language.
      4
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables AI assistants to interact with a HubSpot CRM account via natural language, starting with read-only lookups and optionally enabling write operations like creating contacts, deals, and notes.
      11
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Exposes CRM tools from HubSpot to Claude and other agents, enabling pipeline analysis, deal risk detection, and automated follow-up drafting.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables Claude to search, create, and update contacts, deals, and support tickets in HubSpot, and to generate cross-object account summaries.
      10
      MIT