Skip to main content
You can work in HubSpot from the agent tools you already use, such as Claude, ChatGPT, and Codex. Agents reach HubSpot through the remote MCP server (a standard way for AI tools to connect to HubSpot, which powers HubSpot’s connectors) or the Agent CLI (a command-line tool that agents run in a terminal, currently in beta). The two overlap but aren’t interchangeable. If you have a use-case or custom integration in mind that’s not currently supported by either of these two features, you can use HubSpot’s REST APIs. Below, learn more about each method, how to choose between them, and what to keep in mind when setting up and using them. For a full breakdown of what each one covers, see the capability reference.
To set up and use a HubSpot-provided connector, visit HubSpot’s Knowledge Base:

The three methods

Choose a method

For many use cases, HubSpot recommends starting with HubSpot’s built-in connectors, which use the remote MCP server behind the scenes without any additional code or terminal access. If you need more than a connector offers, use the questions below to find the right method.

Need help deciding? Ask your agent to review this documentation and recommend a method.

  1. What are you trying to accomplish?
Coverage differs and changes as HubSpot adds functionality, so check the capability reference for what each method supports. For example, marketing emails, social posts, and CMS pages are available through the remote MCP server but not the Agent CLI, while bulk imports and workflows are available through the Agent CLI but not the remote MCP server. If you’ve already set up a HubSpot connector or the Agent CLI, you can also ask your agent to review and report what’s currently available to it.
  1. Which client does your team use?
Chat apps typically connect to the remote MCP server, either via a HubSpot-provided connector or custom connector. Agents that run in a terminal, such as Claude Code, can use both a connected remote MCP server and the Agent CLI, depending on which fits the task.
  1. How broad is the surface area you typically work in?
Asking questions and analyzing your data works well in conversation through the remote MCP server, as does making changes small enough for you to review in the chat. Large-scale changes suit the Agent CLI, where the agent can run a command that previews the changes with --dry-run before it applies them.
  1. Does it need to run without a person present?
Scheduled jobs and production integrations are usually best solved by HubSpot’s REST APIs via an integration or service you build. Alternatively, you can perform bulk operations and chain Agent CLI commands with scripting, and could use external tooling to run recurring jobs.

Best practices

HubSpot’s connectors and agent tools are powerful and should be used with caution when accessing your company’s data. The practices below start with everyday habits and move toward account-level controls.
  • Be specific: write your prompts to be detailed and focused on the task at hand. Being specific about details like property names, filters, and asset titles will help to avoid mistakes.
  • Start read-only: before asking an agent to make changes, ask it to provide a summary of what it finds. That way, you know if it’s looking in the right places or if it needs more direction.
  • Ask for a plan first: have the agent describe what it will do before it acts, and provide approval only for the changes that make sense to you. Revising a plan before taking action can help to improve output and avoid surprises.
  • Review every confirmation prompt: confirmation is crucial, particularly for updates that span many records and assets. This is especially true when your initial prompt covers multiple tasks.
  • Use a test account: test accounts are useful for anything that’s hard to undo or that changes many records, or if you’re just looking to test things out. See account types.
  • Control who has access: Super Admins manage app access in the account, including approving apps, choosing who can install them, and turning optional data permissions on or off. Learn more about managing access to apps.
  • Standardize on context: share a project context file such as CLAUDE.md or AGENTS.md, plus skills, so agents behave consistently across your team. How you distribute these files and skills depends on the client you’re using. For example, you can store them in a shared repository or package them in a private plugin marketplace. For teams that use Claude, you can provision skills for your organization, depending on your plan. Learn more about agent context files and agent skills.
Super Admins can use audit logs in HubSpot to review account activity history (Starter or above required). The log attributes actions made through HubSpot’s connectors to both the user and the connector. Actions made with a service key show as assisted by the key’s name, so give each key a clear name. A service key has no per-user audit trail of its own, and the Agent CLI’s local hubspot history log stays on the machine, so neither replaces the account audit log.

Examples

Draft a marketing email

Agents can also help streamline content creation, as long as you stay in control of what goes out. You might ask a chat agent, “Look at how last month’s newsletter performed, tell me what underperformed, and help me draft next month’s newsletter with improvements based on what you find.”
  1. The agent reads last month’s newsletter and its analytics, such as opens, clicks, and unsubscribes, and compares them with your other recent emails.
  2. It reports what stood out, for example strong opens but few clicks, and suggests a likely reason.
  3. It writes a draft of next month’s newsletter in the chat, explains how the draft responds to its findings, and asks whether you want it to create the draft email in your account.
  4. You review the draft in the chat and ask for changes. When you’re happy with it, you tell the agent to create the email, and then you open it in HubSpot to edit it and decide whether to send it.
The agent prepares the work and you make the decision at each step, which fits tasks that reach your customers. See Best practices.

Bulk cleanup with a preview

Use the Agent CLI when a task touches many records and you want to see exactly what will change first.
  1. The agent pipes the records to the update command with --dry-run, for example cat records.jsonl | hubspot objects update --type contacts --dry-run. Nothing changes. The output reports how many records would be affected, whether the change is reversible, and a digest to use when applying the change.
  2. You review the summary.
  3. After you approve, the agent runs the same command with the digest and a confirmation value.
The digest ties the apply step to the records you previewed, and it expires, so the agent runs the dry run again if you wait too long. Deletes work the same way.

Use the remote MCP server and Agent CLI together

Some tasks need both: explore or prepare data with the remote MCP server, then complete a step it doesn’t support with an Agent CLI command. For example, the remote MCP server can’t read workflows or run bulk imports, but the Agent CLI can. To find which workflows reference a property, an agent can use the remote MCP server to look up the property and the CLI workflows commands to read the workflows. A short instruction about when to switch can help. For example, you can tell the agent to check the Agent CLI when the remote MCP server doesn’t support an action, either in your prompt, agent context file, or skill.

Next steps

Last modified on December 1, 2026