Alter HubSpot CRM MCP Server
v0.1.0Multi-user HubSpot CRM MCP server with zero tokens on server, CRM write approvals, and audit.
A multi-user HubSpot CRM MCP server for AI agents that searches, lists and reads contacts, companies, deals and tickets, and creates or updates CRM records — where the server never holds a HubSpot token, every call runs under the signed-in rep's own HubSpot grant, and CRM writes wait for a person's approval. It is backed by Alter: Alter stores each user's HubSpot OAuth credential, enforces policies, holds CRM changes for approval, and records every call with the person who triggered it.
Summary extracted from the README.
HubSpot CRM MCP server with approvals (@alter-ai/hubspot-mcp)
A multi-user HubSpot CRM MCP server for AI agents that searches, lists and reads contacts, companies, deals and tickets, and creates or updates CRM records — where the server never holds a HubSpot token, every call runs under the signed-in rep's own HubSpot grant, and CRM writes wait for a person's approval. It is backed by Alter: Alter stores each user's HubSpot OAuth credential, enforces policies, holds CRM changes for approval, and records every call with the person who triggered it.
What the server holds vs. never holds
- Holds: Only an Alter agent key (
ALTER_AGENT_API_KEY) — plusALTER_SIGNIN_KEYwhen hosted on Cloudflare. - Never holds: HubSpot OAuth tokens, private app tokens, user passwords, or your IdP secret.
Tools
| Tool | What it does | With the recommended policy |
|---|---|---|
search_records |
Searches HubSpot contacts, companies, deals or tickets by text query | Allowed |
list_records |
Lists contacts, companies, deals or tickets with pagination | Allowed |
get_record |
Reads one contact, company, deal or ticket by id | Allowed |
create_contact |
Creates a new CRM contact | Held until you approve it |
update_contact |
Updates contact properties (name, email, lifecycle stage, custom fields) | Held until you approve it |
create_deal |
Creates a new deal in a pipeline | Held until you approve it |
update_deal |
Updates deal stage, amount, close date or custom fields | Held until you approve it |
create_ticket |
Creates a new support ticket | Held until you approve it |
update_ticket |
Updates ticket status, priority or details | Held until you approve it |
check_approval |
Reports what happened to a held request: waiting, done, denied, expired or failed | Allowed |
Archiving or deleting CRM records is not a tool, and the recommended policy also denies HubSpot delete operations.
Two-user isolation demo
Deploy one Cloudflare Worker URL (https://alter-hubspot-mcp.<your-subdomain>.workers.dev/mcp) for your sales and RevOps team:
- Alice (Enterprise AE) and Bob (SDR) both connect to the same hosted Worker URL through your company OIDC IdP.
- Each person's client token is pinned strictly to their own HubSpot OAuth connection, so customer record lookups and updates stay attributed to the exact rep rather than a shared private app key.
- When Alice asks her agent to move a $75,000 deal to
closedwon(update_deal), Alter holds the CRM write until Alice approves it in the Alter Wallet (orslack-approvals), updates HubSpot once, and writes an audit row namingalice@yourcompany.com.
Set up
You need an Alter account and the alter CLI (0.10 or later). Replace <app-id> and <agent-id> below. Every step can also be done in the Alter portal.
1. An Alter app with an identity provider (Auth0, Clerk, Okta, WorkOS, Entra ID, or another OIDC provider). See identity providers or the 5-minute Auth0 / Okta quickstart.
2. HubSpot as a provider. Create a HubSpot OAuth app via the HubSpot CLI (see HubSpot provider setup), add Alter's redirect URI, and add HubSpot (hubspot) to your Alter app with scopes:
crm.objects.contacts.read,crm.objects.contacts.writecrm.objects.companies.read,crm.objects.companies.writecrm.objects.deals.read,crm.objects.deals.writetickets
3. An agent. The key is printed once, in the api_key field:
alter agents create --app <app-id> --name hubspot-agent \
--scopes '{"hubspot":["crm.objects.contacts.read","crm.objects.contacts.write","crm.objects.companies.read","crm.objects.companies.write","crm.objects.deals.read","crm.objects.deals.write","tickets"]}' \
--output json | jq -r '.api_key'
4. Connect HubSpot and delegate it to the agent:
alter connect create --provider hubspot --user-token "$USER_JWT" --agent hubspot-agent --output json
5. Recommended policy. Allow CRM reads and searches, hold every CRM write (contact/deal/ticket creates and updates) for human approval, and block deletes:
echo '{"effect": "require_approval", "when": {"match": {"families": ["write"]}}, "approval": {"channels": ["email"], "expires_in_seconds": 86400}}' | \
alter policy rules create --app <app-id> --agent <agent-id> --type require_approval --body - --name "Approve HubSpot CRM writes"
echo '{"when": {"family": ["delete"]}, "effect": "deny"}' | \
alter policy rules create --app <app-id> --agent <agent-id> --body - --name "No deletes"
6. Connect your MCP client.
claude mcp add hubspot --env ALTER_AGENT_API_KEY=<agent key> -- npx -y @alter-ai/hubspot-mcp
Until the first npm release, build from source (pnpm install && pnpm build at the repository root) and run node packages/hubspot-mcp/dist/index.js.
Host on Cloudflare (remote, multi-user MCP)
alter keys mint --app <app-id> --name mcp-hosted \
--scopes idp_users:read,idp_users:write,connect:initiate,grants:write --output json | jq -r '.plain_key'
cd packages/hubspot-mcp
npx wrangler deploy
npx wrangler secret put ALTER_AGENT_API_KEY
npx wrangler secret put ALTER_SIGNIN_KEY
npx wrangler secret put ALLOWED_USERS
Connect clients to https://alter-hubspot-mcp.<your-subdomain>.workers.dev/mcp.
Configuration
| Variable | Required | Meaning |
|---|---|---|
ALTER_AGENT_API_KEY |
yes | The agent's key from step 3 |
ALTER_ACCOUNT |
no | Which HubSpot account to use when more than one is delegated |
ALTER_GRANT_ID |
no | Use this exact grant instead of resolving by provider (not with ALTER_ACCOUNT) |
FAQ
Can it overwrite deal stages or contact records without review? Not under the recommended policy: Alter classifies CRM creates and updates as write and holds each mutation until a human approves it.
Enterprise / Company IdP
This server works with any OIDC IdP (Okta, Microsoft Entra ID, Auth0, WorkOS, Clerk). For company-wide policy, audit to SIEM, and on-prem vault → Alter. Want help connecting your company IdP? Book a 20-minute architecture review or email founders@alterauth.com.
License
MIT