Image
Build
Connect & operate
Design & teams
Start hereScope a build in one callBring a spec, a wireframe, or a paragraph. You leave with an architecture, a timeline, and a number.Request a scoping call
AI software
LLM & data systems
Vibe coding
Ready to ship?Put AI where the work isAgents, RAG, and private LLMs wired into the systems your team already uses — not a chatbot bolted to a homepage.Discuss an AI project
Domain firstWe learn your workflow before we model itRegulated, operational, or high-volume — the constraints belong in the schema, not in a training doc.Talk about your domain
Timothy Carter
Author
Building a Custom MCP Server for Salesforce or NetSuite — featured image
11/30/2026

Building a Custom MCP Server for Salesforce or NetSuite

A custom MCP server is the right layer to put between an LLM and Salesforce or NetSuite, provided the tool contracts enforce least privilege and every financial write passes through a human gate. Without those two things, you have built a fast, confident path to data loss.

The Model Context Protocol gives you a standard way to expose read, search, and write operations to an AI agent. The engineering question is what to expose, how to authenticate, and what to refuse.

Auth: Salesforce OAuth 2.0 on One Side, NetSuite Rebuilding on the Other

Salesforce's integration path is well understood. An external MCP server authenticates as a Connected App using the OAuth 2.0 JWT bearer flow or the client-credentials flow, and binds to a named integration user with a restricted profile. For any interactive or public client you add PKCE, which RFC 9700 now mandates for every authorization code flow to prevent code injection and replay. Scope the integration user to object-level permissions only, not full modify-all-data.

NetSuite is mid-transition. Token-Based Authentication has been the default for integrations, but Oracle has announced that new TBA integrations stop being accepted at release 2027.1 and full TBA support ends at 2028.2. Build with OAuth 2.0 machine-to-machine from day one. If a legacy TBA token sits in the environment, isolate it behind a single internal adapter so swapping it later is a secrets rotation, not a rewrite.

Both sides should land in a secrets manager (AWS Secrets Manager, HashiCorp Vault, or GCP Secret Manager), never in environment variables on the MCP process. The server itself holds no long-lived credential for the human; it mints short-lived tokens per tool call, keyed to the end user's identity passed through from the host.

OAuth 2.0 Authorization Code Flow with PKCE (RFC 9700)
  1. 11Client generates code_verifier and derives code_challenge (S256) · S256 is preferred because the verifier never appears in the authorization request
  2. 22Client sends authorization request with code_challenge to the auth server · Binds the eventual code to a secret only this client holds
  3. 33Auth server MUST support PKCE and records the code_challenge · Mandatory per RFC 9700; servers without PKCE support are non-compliant
  4. 44Client exchanges code at token endpoint, presenting the code_verifier · Server enforces that the verifier matches the stored challenge
  5. 55Server rejects any token request with a code_verifier when no code_challenge was in the original request · Blocks downgrade attacks that strip PKCE protection
  6. 66Access token issued; replayed or injected codes fail verifier check · Attacker's correct verifier cannot match a code bound to a different challenge
The sequence RFC 9700 mandates for public clients; each step is the control that blocks code injection or replay at that boundary. Source: IETF RFC 9700, 2025

Tool Contracts That Resist Prompt Injection

Tool contracts are the real security boundary. An LLM will call whatever it is given, and Invariant Labs disclosed in April 2025 that MCP tools are susceptible to tool poisoning, where malicious instructions embedded in a tool description are invisible to the user but acted on by the model. Treat every description, parameter name, and return field as attacker-influenced input.

Design the surface narrow. A tool called salesforce_lead_read takes a specific Id or SOQL fragment and returns a declared field list; it cannot read Opportunity, Account, or anything else. A tool called salesforce_opportunity_update_stage accepts only a stage value from an enum and an Opportunity Id. There is no generic salesforce_query tool and no salesforce_execute. This is the practical shape of OWASP's LLM06:2025 guidance on excessive agency: constrain functionality, permissions, and autonomy at the tool layer, not the prompt.

Return values are a separate attack surface. Strip or escape any user-generated text (case descriptions, chatter posts, memo fields) before it goes back to the model so a poisoned Lead note cannot rewrite the agent's instructions. Log the full request and response to a separate audit stream keyed to the calling user.

Vulnerability Categories Found in Tested MCP Server Implementations
Vulnerability Categories Found in Tested MCP Server ImplementationsTested MCP servers -> Command injection: 43%; Tested MCP servers -> SSRF: 30%; Tested MCP servers -> Path traversal: 22%; Tested MCP servers -> Other issues: 5%Tested MCP serv…100%Command injecti…43%SSRF30%Path traversal22%Other issues5%
Share of tested implementations affected by each vulnerability class. Source: Equixly, 2025

SuiteTalk REST vs SOAP Inside NetSuite

NetSuite exposes two serious integration surfaces. SuiteTalk REST Web Services is the modern path, with per-record endpoints, standard HTTP semantics, and metadata you can introspect. SOAP is older, heavier, and still the only path for some record types and for certain transaction search behaviors. A production MCP server almost always uses both.

Default to REST for reads, lookups, and straightforward CRUD on Customer, SalesOrder, Invoice, and Item. Fall back to SOAP for operations REST does not cover cleanly, including some advanced saved-search patterns and a few subrecord structures. SuiteScript-exposed RESTlets fill the third slot: when neither standard API gives you an atomic operation (a multi-record posting that must succeed together), wrap it in a RESTlet and call that from one tool. The tradeoff is operational: RESTlets live in the customer's account and need their own SDLC.

Build a thin adapter layer that normalizes error codes across all three. An MCP tool should never leak the raw SOAP fault to the model.

Approval Gating for Financial Writes

Any tool that moves money, creates a transaction, or changes a close date needs a human in the loop. This is not a philosophical preference. Independent security testing of MCP implementations found command injection in 43% of tested servers and path traversal in 22%; MCP servers in the wild are, on average, not hardened. The approval gate is the control that survives an exploit upstream.

The pattern is a two-phase call. Phase one: the tool receives arguments, validates them, writes a pending action record to Postgres with a signed intent payload, and returns a reference plus a diff the approver can read in plain English ("Create Invoice INV-00412 for Customer Acme, 3 lines, $42,180.00, post date 2026-11-30"). Phase two: a human clicks approve in a lightweight review UI, which posts the signed intent back to the server, which then executes against NetSuite. No single LLM call ever posts a journal entry.

A ship's telegraph lever paused mid-position with a hand resting on it, representing an approval gate before a financial write

Decide what qualifies as a write that needs approval, and write the rules down: any transaction posting, any close-date change past current period, any Opportunity amount delta above a threshold, any permission grant. For patterns and audit scaffolding at this layer, dev.co's approvals and RBAC guide for production agents covers the control surface in more depth.

Rate Limits and the Shape of Your Workload

Salesforce enforces a rolling 24-hour API pool across REST, SOAP, and Bulk. The ceiling is edition-dependent, which matters when sizing the agent's read volume. A chatty agent in a Developer org will hit 15,000 and stop; the same agent in Enterprise with 200 Sales Cloud licenses has a much larger envelope.

Salesforce Daily API Allocation by Edition
Salesforce Daily API Allocation by EditionDeveloper: 15; Enterprise / Professional: 100; Unlimited / Performance: 100Base calls per 24h (thousands) →Additional calls per Sales Cloud license →DeveloperEnterprise / Prof…Unlimited / Perfo…
Scatter stands in for an ordinal tier comparison: base allocation flattens past Enterprise while per-license headroom is where the real scaling lives. Source: Salesforce Developer Docs, 2026

NetSuite enforces concurrency (governed by account) rather than a daily call ceiling. Design the MCP server to serialize or queue writes per NetSuite account and expose a bulk-import tool that batches instead of looping, so an agent cannot accidentally saturate the concurrency pool with single-row calls. For broader API integration patterns, see our API integration services.

Cost Model: 10 to 16 Weeks, Then Year-One Run

A production-grade MCP server fronting both Salesforce and NetSuite is a 10-to-16 week build for a two-to-three engineer pod. The band widens based on how many write tools you expose, how much of NetSuite you touch (vanilla records vs heavy SuiteScript customizations), and whether the approval UI is net new or embedded in an existing internal tool.

Ballpark labor at senior US rates: $180K to $320K for the build. Infrastructure for year one, running on AWS Lambda behind API Gateway with Postgres for audit and approvals, typically lands between $9K and $24K depending on call volume. Lambda itself is $0.20 per million requests plus GB-second duration at $0.0000166667 on x86, which is a rounding error against the Secrets Manager, logging, and observability lines. Budget another $15K to $40K for year-one operations: on-call coverage, dependency updates, and the quarterly scope widening that always happens once business users realize what the agent can do.

For the adjacent question of cost on the pure integration between these two systems without an MCP layer, our prior piece on Salesforce to NetSuite integration cost breaks the numbers down against a point-to-point or iPaaS build.

What to Watch Once It Ships

The single number worth watching is the ratio of approved-to-rejected writes in the first 60 days. Below about 5% rejection, the LLM is being handed too much latitude or the tool contracts are too generous; approvers are rubber-stamping. Above 25%, the agent is asking to do things it should not be allowed to propose and the tool surface needs tightening. A healthy band sits roughly between those numbers, and it should trend toward the lower end as the tool contracts get refined over the first quarter. If you cannot measure that ratio at all, the audit log is incomplete and nothing else in this build is defensible.

Author
Timothy Carter
Timothy Carter is the Chief Revenue Officer. Tim leads all revenue-generation activities for marketing and software development activities. He has helped to scale sales teams with the right mix of hustle and finesse. Based in Seattle, Washington, Tim enjoys spending time in Hawaii with family and playing disc golf.