MCP host, client and server architecture

The MCP host, client and server roles as the specification defines them, both protocol revisions, and a reusable pattern with a policy gateway and approvals.

Banner for the GeekMidst reference architecture “MCP host, client and server architecture”, covering Business context and Hosts, clients and servers

The Model Context Protocol (MCP) is an open protocol, based on JSON-RPC 2.0, that lets AI applications get context and actions from external programs in a standard way. It is not a model and not an LLM API: it defines only how context is exchanged. This page explains the host, client and server roles as the specification defines them, then sets out a reusable pattern for connecting AI hosts to Salesforce, Marketing Cloud, Data 360, Braze and custom APIs, with identity, policy, audit and human approval in the path.

The per-product adapters in this pattern are a proposed GeekMidst design; they do not exist yet. Several vendors already host their own MCP servers, listed below with the status each vendor states. GeekMidst can design and implement the pattern through MCP server development and MCP integration consulting. The one MCP server GeekMidst runs today is the public, read-only server at the /mcp endpoint on this website, which serves published website content; see the MCP integration project.

Business context

Teams want AI assistants to answer questions from CRM, marketing and data platforms, and sometimes to act on them. Without a shared pattern, each assistant gets its own credentials and each team connects its own servers, so nobody can say who can use which tool. A shared pattern gives one place to decide access, one audit trail and one approval step.

Hosts, clients and servers

An MCP host is the AI application, such as a chat app, an IDE or an agent. It creates one MCP client per MCP server, and each client keeps a dedicated connection to its server. A server exposes three primitives: tools (functions the model can call), resources (data addressed by URIs) and prompts (reusable templates the user chooses).

Servers run over two transports. stdio is for a local process; it takes credentials from the environment, and the authorisation spec says it should not use the HTTP OAuth flow. Streamable HTTP is for remote servers: one endpoint, each client message a new POST, and a response as plain JSON or an SSE stream. Servers must validate the Origin header and answer 403 when it is invalid.

Protocol revisions

RevisionHow a client connectsWhat a server must handle
2025-11-25 (legacy)initialize handshake, then notifications/initializedOptional MCP-Session-Id; MCP-Protocol-Version header on later requests
2026-07-28 (current)No handshake; every request carries _meta with protocol version and client capabilitiesserver/discover; Mcp-Method and Mcp-Name headers; ttlMs and cacheScope on list and resources/read results; no sessions

A server may serve both revisions on one endpoint: an initialize request selects legacy behaviour, and requests carrying _meta are served statelessly. The TypeScript SDK v2 client defaults to legacy mode and the Python client probes server/discover first, so supporting the legacy handshake remains the safe baseline. That is an inference from SDK defaults, not something the spec states.

Reusable MCP pattern: host to product APIs

Reference architecture: a reusable pattern, not a live client integration

Your AI host environmentAI HOSTCLIENT AND APPROVALGATEWAYSERVERSPRODUCT APISUsernamed personAI host applicationchat app, IDE or agentMCP clientsone per serverHuman approvalsensitive actionsIdentity and policy gatewayproposedBAudit log and monitoringevery callBMCP server registryinternal allowlistBVendor-hosted MCP serversSalesforce, MCE, Data 360, BrazeCGeekMidst adaptersproposed, not builtBSalesforce APIsREST, Apex, FlowCMarketing Cloud APIsEngagementCData 360 APIsquery, segmentsCBraze REST APIendpoint-scoped keysCCustom APIsyour servicesCquestion or requesttool selectionMCP requestsapproval requestdecisioncall recordserver lookupvendor server callsadapter callsSalesforceMarketing CloudData 360Brazescoped callsscoped callscustom calls
  • Salesforce product
  • Data and analytics
  • Engagement platform
  • AI and agents
  • Integration layer
  • Identity, policy and governance
  • External or custom system
  • People
  • Your AI host environment
  • BGeekMidst reference pattern (proposed)
  • CVendor servers and product platforms
  • Dashed: asynchronous, optional or feedback
Diagram source (Mermaid)

Select a component to see what it is responsible for and how data moves to and from it.

Reference architecture. The gateway, registry and per-product adapters are a proposed GeekMidst design, not built. Vendor-hosted servers carry each vendor's own status.
Components and data flows (text version)
ComponentTypeResponsibility
Usernamed personPeopleThe person asking questions or requesting actions, signed in with their own identity.
AI host applicationchat app, IDE or agentAI and agentsThe AI application. It chooses tools and creates one MCP client per server it connects to.
MCP clientsone per serverAI and agentsProtocol clients inside the host. Each keeps a dedicated connection and negotiates the protocol revision.
Human approvalsensitive actionsPeopleA named person confirms write or sensitive tool calls after seeing what will change.
Identity and policy gatewayproposedIdentity, policy and governanceAuthenticates the user, applies tool allowlists, read/write rules and rate limits, and obtains a separate token for each downstream server.
Audit log and monitoringevery callIdentity, policy and governanceRecords who called which tool, the decision, outcome and timing, and raises alerts on failures.
MCP server registryinternal allowlistIntegration layerYour list of approved servers, tool versions and owners. Not the public MCP Registry, which is in preview.
Vendor-hosted MCP serversSalesforce, MCE, Data 360, BrazeExternal or custom systemServers run by the vendor, with the vendor's status, licensing and permissions.
GeekMidst adaptersproposed, not builtIntegration layerProposed per-product servers for Salesforce, Marketing Cloud, Data 360, Braze or a custom API, where no vendor server fits.
Salesforce APIsREST, Apex, FlowSalesforce productSalesforce platform APIs, called within the signed-in user's permissions.
Marketing Cloud APIsEngagementEngagement platformMarketing Cloud Engagement REST and SOAP APIs.
Data 360 APIsquery, segmentsData and analyticsData 360 query and Connect APIs, which count toward their own limits.
Braze REST APIendpoint-scoped keysEngagement platformBraze REST endpoints with per-endpoint permissions and documented rate limits.
Custom APIsyour servicesExternal or custom systemInternal services exposed through narrow, documented tools.

Data flows

  1. User → AI host application: question or request. The user's request, made with their own identity.
  2. AI host application → MCP clients: tool selection. The host picks a tool; the client sends tools/call to the gateway endpoint.
  3. MCP clients → Identity and policy gateway: MCP requests. Every request carries a bearer token issued for the gateway. Invalid or expired tokens get 401.
  4. Identity and policy gateway → Human approval: approval request. For write or sensitive tools, the gateway pauses the call and asks a named person to confirm.
  5. Human approval → Identity and policy gateway: decision. Approved calls continue; rejected calls return a tool error the model can explain.
  6. Identity and policy gateway → Audit log and monitoring: call record. Each call, decision and outcome is logged without storing secrets.
  7. Identity and policy gateway → MCP server registry: server lookup. The gateway checks that the server and tool are approved and which version is current.
  8. Identity and policy gateway → Vendor-hosted MCP servers: vendor server calls. Uses a token issued for that vendor server, never the client's token. Braze allowlists client domains and admins approve redirect URIs, so confirm each vendor accepts the gateway as a client.
  9. Identity and policy gateway → GeekMidst adapters: adapter calls. Calls to proposed adapters, which validate inputs against their schemas.
  10. Vendor-hosted MCP servers → Salesforce APIs: Salesforce. Salesforce Hosted MCP Servers run each call as the authenticated user.
  11. Vendor-hosted MCP servers → Marketing Cloud APIs: Marketing Cloud. The Engagement MCP Server acts within package scopes and the user's permissions.
  12. Vendor-hosted MCP servers → Data 360 APIs: Data 360. The Data 360 MCP Server counts toward Connect API limits and Flex Credits.
  13. Vendor-hosted MCP servers → Braze REST API: Braze. The Braze MCP server uses OAuth with the user's Braze login and exposes no user-level PII tools.
  14. GeekMidst adapters → Salesforce APIs: scoped calls. Adapters hold server-side credentials scoped to their tools only.
  15. GeekMidst adapters → Braze REST API: scoped calls. One Braze key per adapter purpose; 429 responses are backed off using rate-limit headers.
  16. GeekMidst adapters → Custom APIs: custom calls. Narrow, parameterised calls to your own services with timeouts.

Component responsibilities

ComponentResponsible forStatus
AI host and MCP clientsChoosing tools; one client per serverYour chosen host
Identity and policy gatewayAuthentication, allowlists, read/write rules, rate limits, per-server tokensProposed pattern
Human approvalConfirming write or sensitive callsProposed pattern
Server registryApproved servers, versions, ownersProposed pattern
Vendor-hosted serversVendor tools under vendor licensingVendor's stated status (see below)
GeekMidst adaptersTools where no vendor server fitsProposed; not built
Audit and monitoringWho did what, when, with what resultProposed pattern

Vendor-hosted MCP servers and their stated status

ServerPublisherStatus as stated by the vendor
Salesforce Hosted MCP ServersSalesforceGA 29 April 2026; Enterprise Edition and above; intended for customers with Flex Credits
Headless 360 MCP ServerSalesforceBeta
Salesforce DX MCP ServerSalesforceLocal server; whole-server GA not confirmed
Marketing Cloud Engagement MCP ServerSalesforceGA 2 June 2026
Data 360 MCP ServerSalesforceGA per Salesforce news, 19 August 2026
Braze MCP serverBrazeGenerally available per a Braze article dated 23 July 2026
Hosted Tableau MCPTableauStatus not confirmed; Tableau's own page conflicts

Data flow, step by step

  1. The user asks the host a question or requests an action.
  2. The host chooses a tool, and its client sends tools/call to the gateway.
  3. The gateway authenticates the user's token and checks the allowlist, read/write rules and rate limits.
  4. Sensitive calls wait for approval from a named person.
  5. The gateway routes the call to a vendor-hosted server or an adapter, with a token issued for that server.
  6. The product API runs within the user's permissions, and the result returns to the host.
  7. The call is logged with its decision, outcome and timing.

Trust boundaries and authentication

There are three boundaries: the host environment, your gateway and the vendor platforms. The spec forbids token passthrough: an MCP server must not accept tokens that were not issued for it. A gateway that proxies to other servers therefore holds its own downstream tokens and must get per-client consent before forwarding to a third-party authorisation server. Tool annotations such as readOnlyHint are hints, and clients must treat them as untrusted unless the server is trusted. The details are on our MCP security architecture page.

Failure scenarios and how to handle them

FailureEffectHow to handle it
Protocol revision mismatch400 with an unsupported-version errorSupport the legacy handshake and 2026-07-28 on one endpoint
Token invalid or expired401Client refreshes or re-authorises; never fall back to shared keys
Tool input invalidTool execution error with isErrorValidate against the input schema and return a clear message
Vendor server down or slowTool unavailableTimeouts, a fallback message and an alert
Rate limit reachedCalls refusedPer-user limits at the gateway; respect vendor limits
Instructions hidden in returned dataModel misledTreat tool output as data; confirm writes with a person

Operational monitoring

Track calls per tool and user, error rates, authentication failures, approval decisions and latency. Alert on spikes in write requests or denials, and review the allowlist and approvals monthly.

Alternative approaches and trade-offs

Connect hosts straight to vendor servers: fastest to start, but each host is governed separately. Use a gateway: one place for policy and audit, at the cost of a component to run; Salesforce recommends an MCP gateway such as MuleSoft AI Gateway for cross-vendor governance. Skip MCP and call APIs directly from your own app when the workflow is fixed; see MCP vs direct API integration.

Implementation checklist

  1. 01

    List use cases

    Questions and actions the AI should support, per team

  2. 02

    Check vendor servers first

    Status, licensing and permissions for each product

  3. 03

    Decide read and write scope

    Read-only first; writes only with approval

  4. 04

    Choose the gateway

    Build, buy or use a platform option

  5. 05

    Register servers

    Approved servers, tools, versions and owners

  6. 06

    Design adapters where needed

    Narrow tools with input schemas, tested in a sandbox

  7. 07

    Support both protocol revisions

    Legacy handshake plus 2026-07-28

  8. 08

    Monitor and review

    Calls, errors, approvals and allowlist reviews

Questions we hear

Do GeekMidst MCP adapters for Salesforce or Braze exist?
No. They are a proposed design. GeekMidst runs one MCP server today, the public read-only server at the /mcp endpoint on this website.
Should we use a vendor's MCP server or build our own?
Start with the vendor's server where its status, licensing and tools fit. Build an adapter only for gaps, such as a custom API.
Which protocol revision should we support?
The current revision is 2026-07-28. The official TypeScript SDK client and MCP Inspector still default to the legacy handshake, so supporting both on one endpoint is the safe choice.
Is MCP a security layer?
No. MCP defines how context is exchanged. Authentication, permissions, approvals and audit have to be designed around it.

Sources

  • https://modelcontextprotocol.io/docs/learn/architecture
  • https://modelcontextprotocol.io/specification/2026-07-28/changelog
  • https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-http
  • https://developer.salesforce.com/blogs/2026/04/salesforce-hosted-mcp-servers-are-now-generally-available
  • https://braze.com/docs/developer_guide/mcp_server/

Plan your MCP architecture

Tell us which AI hosts and products you want to connect. We can propose a pattern with vendor servers, adapters, policy and approvals.

Book a consultation →

Tell us what you are trying to fix.

Share your Salesforce setup, goals and constraints. A practitioner reads every message and replies with questions, first thoughts or an honest view of whether you need outside help at all.

Talk to a Salesforce Expert
Book a Consultation