Noca | Model Context Protocol Salesforce: AI Access to Accounts

Model Context Protocol Salesforce: AI Access to Accounts

Integrating Large Language Models (LLMs) with Salesforce data traditionally requires brittle “glue code,” custom API wrappers that translate natural language into SOQL. Model Context Protocol Salesforce implementations change this paradigm. Instead of hard-coding specific queries, you establish a standardized server that exposes the Account object schema directly to the AI model.

Video: Giving AI Assistants Access to Salesforce via MCP

See Claude connected to Salesforce, documents and e-signatures in under a minute with the Noca MCP Server, a practical example of Model Context Protocol Salesforce access. Watch connecting Claude to Salesforce via MCP on YouTube.

This article explains how to architect an MCP server that allows an AI to autonomously navigate complex Account Object Schema relationships, such as hierarchies and contact roles, without pre-defined API endpoints.

The Shift from API Wrappers to Model Context Protocol

In a standard integration, if a user asks an AI, “Who are the key decision-makers at Acme Corp?”, the developer must have previously written an Apex REST class to fetch Contacts related to an Account. This is unscalable.

Model Context Protocol Salesforce architecture solves this by treating Salesforce as a “Context Server.” The LLM acts as the client. When the LLM needs data, it requests the context via the MCP standard. The server responds not just with data, but with the structure of the data. This allows the LLM to “see” that an Account has a relationship to Contacts and ActivityHistory, enabling it to formulate its own path to the answer.

Exposing the Account Object Schema to LLMs

The core technical challenge is mapping the massive Salesforce data model to a clean MCP resource URI. You should not expose the entire WSDL. Instead, you define specific resources that the MCP server publishes.

For the Account Object Schema, the resource definition might look like this:

  • Resource URI: salesforce://accounts/{id}/hierarchy
  • MIME Type: application/json

When the AI agent encounters a prompt requiring customer context, it calls this resource. The MCP server dynamically queries the Salesforce Account object, retrieving the record and its immediate ParentId (Account Hierarchy) and child Contacts.

Standardizing Context Windows for Activity History

A major benefit of using the Model Context Protocol Salesforce approach is token management. Raw Activity History (emails, calls, tasks) can be massive.

Rather than dumping all history into the prompt, the MCP server acts as a middleware filter. It can be configured to serve only the “Last 5 interactions” or “Activities with Negative Sentiment” within the Account Object Schema.

  1. Client Request: AI asks for “Recent blockers for Account X.”
  2. MCP Server: Queries ActivityHistory where IsClosed = false.
  3. Payload: Returns a minified JSON object to the LLM context window.

This architecture decouples the AI from the database. If you change a field name in Salesforce, you only update the MCP mapping, not the prompt engineering in every AI agent.

Back to top