# MCP for Salesforce and HubSpot with Tray.ai

Your CRM. Your agents. Under control. Connecting AI agents directly to Salesforce or HubSpot is fast to prototype and dangerous in production. Agent Gateway for MCP gives agents governed CRM access, every call logged, a tool allowlist per server, zero raw system access.

## What teams build

- **Governed CRM tools for AI agents:** Publish Salesforce and HubSpot as managed MCP tools (lookup, create, update) with a tool allowlist per server. Agents can't call a tool you haven't explicitly allowed.
- **Composite workflows, not raw API calls:** Package multi-step CRM sequences (enrich → score → update → notify) as a single governed MCP tool. Agents call one tool; Tray handles the orchestration. Up to 10× fewer tokens, predictable behavior.
- **Audit trail for every agent action:** Every Salesforce and HubSpot write logged with the tool, the arguments and the result. Satisfies SOC 1 & SOC 2, HIPAA, GDPR audit requirements without custom logging.
- **Cross-system orchestration out of the box:** CRM is rarely the only system. Slack, Snowflake, Zendesk and NetSuite, among others, can be governed MCP tools in the same deployment. One platform, one contract.

## Proof

- 92%: exploit success rate when ten unmanaged MCP servers run together (Enkrypt.ai research)
- 500+ → ~20: MCP tools down to governed workflows, with zero raw database access, at J.W. Pepper
- Up to 10×: lower token costs with composite MCP tools vs. raw server access

> As we roll MCP out, I don't want end users thinking about which system they're authenticating to or what tools they have access to. Tray's Dynamic Authentication lets us scale agents across the enterprise without compromising on user-level permissions.
> (Mark Gill, Head of Infrastructure, Zuora)

## Direct CRM access for agents is fast to ship. Dangerous to run.

Salesforce and HubSpot hold the most sensitive commercial data in most companies: pipeline, contacts, revenue history. Connecting an AI agent directly to either via an API key is a prototype move: no audit trail, no per-agent controls, over-provisioned credentials, and token costs that escalate as agents pull full records.

Agent Gateway for MCP puts a governed layer in between. Agents call managed MCP tools. Tray sets which tools an MCP server exposes, logs every invocation, and handles the multi-step orchestration so the agent doesn't need raw CRM access to get the answer. To build the agents themselves, see [AI agents for CRM and marketing](/solutions/by-use-case/ai-agents-for-crm/). For MCP rules across every system, not only the CRM, see [AI and MCP governance](/solutions/by-use-case/mcp-governance/).

## The token problem nobody talks about until the bill arrives.

Unmanaged MCP consumes ~75,000 tokens across 10 typical servers. A raw Salesforce MCP server exposes hundreds of API endpoints, most irrelevant to what the agent is trying to do. The agent burns tokens exploring the surface. Composite MCP tools fix this: one tool call, one result, one fraction of the context window.

## Who asks the agent, and what it may touch

A sales rep asking for an account summary and a revenue operations lead asking an agent to update stages are different jobs. Each MCP server exposes only the tools its job needs, so the rep's server has lookup tools and the RevOps server adds the update. Neither gets raw access to Salesforce or HubSpot objects, and a tool that isn't on the list can't be called.

Where a call should run as the person asking, set the tool's authentication to user-provided, and it runs on their own CRM credentials. Where it should run as a service account, set that instead. The activity log shows which was used.

## One tool for a whole CRM job

The fastest way to cut token cost is to stop handing the agent endpoints and give it jobs. "Prepare the renewal brief" can look up the account, pull open cases from Zendesk, check usage in Snowflake and return one short answer. J.W. Pepper took 500+ MCP tools down to about 20 governed workflows this way. Build each one visually in Tray iPaaS, then publish it as a tool through [Agent Gateway for MCP](/platform/agent-gateway/).

To see the same tools used by agents that run inside the apps your teams build, see [Tray Helix Agents](/helix/agents/).

## Questions

**Can't we just give the AI agent a Salesforce API key?**
You can. Most teams do in early prototypes. The problems show up in production: no audit trail, no per-agent permissioning, over-permissioned credentials, and token costs that balloon when the agent pulls full records to answer narrow questions. Agent Gateway for MCP adds a governed layer between the agent and your CRM without blocking what the agent can do.

**Does this work with both Salesforce and HubSpot?**
Yes. Tray connects natively to both. Each can be published as a governed MCP tool independently, or combined into a composite workflow (e.g. sync contact state across both CRMs as a single MCP tool call).

**How does RBAC work across CRM tools?**
Permissions are set at the MCP tool level, not at the Salesforce/HubSpot credential level. You set which tools each MCP server exposes. The CRM credentials are centrally managed; the access policy lives in Tray.

**What does "composite MCP tool" mean in practice?**
Instead of exposing raw Salesforce endpoints as 50+ individual tools (common in open-source MCP setups), you package a workflow (lookup account → check enrichment → update stage → post Slack summary) as one governed tool. The agent calls one tool, gets one result, burns a fraction of the tokens. J.W. Pepper collapsed 500+ MCP tools into ~20 workflows using this pattern.

**Should we use Salesforce's or HubSpot's own MCP server instead?**
A vendor's server gives an agent that one system. If the agent has to work across the CRM, billing, support and the warehouse, or you want one tool allowlist and one audit log across all of them, publish the tools through Agent Gateway for MCP. Tray connects to Salesforce and HubSpot natively, so each CRM becomes governed tools next to every other system the agent touches.

**Which AI clients can use the governed CRM tools?**
Claude, ChatGPT and Copilot Studio, among other MCP clients, plus agents built on Tray Helix. They all call the same tools, so the same allowlist and the same log apply wherever the question is asked.

**Can an agent write to the CRM, or only read it?**
Either. A server that exposes only lookup tools is read-only. Add a create or update tool when you want the agent to write, and the log records the tool, the arguments and the result. Each tool's authentication is set as the user's own credentials or a service account, and the log shows which one a call used.

Page: https://tray.ai/solutions/by-use-case/mcp-for-crm/ · Pricing: https://tray.ai/pricing.md · Book a demo: https://tray.ai/contact/
