Table of contents

When you hand Codex a task to build a Salesforce sync or integration, you usually describe the objects and fields in the prompt.
That description isn't enough. Custom objects and fields carry org-specific API names ending in __c, picklists hold values configured per org, and standard objects relate to each other in ways that vary by setup.
Codex will, as a result, write SOQL against a field that doesn't exist, validation that misses half the real picklist values, or relationship queries that don't match your schema.
To give Codex direct access to Salesforce as it works through your coding tasks, we'll show you how to connect Salesforce with Merge Agent Handler's Salesforce MCP server.
Merge Agent Handler connects Codex to the Salesforce API through the Merge CLI. You install the CLI, authenticate once, and run a single setup command from your project root.
That command writes a Merge CLI section to your project's AGENTS.md file, which tells Codex when to call merge search-tools and merge execute-tool to reach Salesforce.
Once connected, Merge handles OAuth token storage and refresh on your behalf, so you never embed Salesforce credentials in your repo or manage the token lifecycle yourself.
Related: How to use the Salesforce MCP in Claude Code
Before getting started, you'll need the following:
pipx --version to confirm, or install via pip install pipx)If you want to connect Merge Agent Handler's Salesforce MCP with internal or customer-facing agentic products, you can follow the steps in our docs.
Install the Merge CLI with pipx: pipx install merge-api
Verify the install: merge --version
Run the following to authenticate the CLI with your Merge Agent Handler account: merge login
This links the CLI to your Merge account and stores your session credentials locally.
From the root of the project where you want Codex to reach Salesforce, run:
This writes a Merge CLI section to your project's AGENTS.md file so Codex knows to use the CLI when a task needs Salesforce data. The command is idempotent, safe to re-run if you need to reset the configuration.
Commit the updated AGENTS.md so the configuration travels with the repo.
Related: A guide to integrating the Salesforce MCP with Cursor
Create a Codex task that needs live Salesforce data. For instance: "Read the Opportunity object's fields, including custom fields and the Stage picklist values, then scaffold a sync that maps Opportunities into our internal schema."
The first time Codex invokes a Salesforce tool, a Magic Link will appear to complete connector authentication.

Once authenticated, Codex can reach your Salesforce org through Merge for every later task in this project.
{{this-blog-only-cta}}
In case you have more questions on setting up and using the Salesforce MCP with Codex, we've addressed several more commonly-asked questions below.
With Salesforce connected, Codex can:
__c suffixYou can build your own MCP server on top of the Salesforce API. For one developer on one org, it's workable: set up a connected app, run the OAuth flow, and write tool schemas for the endpoints your tasks touch.
It gets harder once more than one person uses it or tasks run in CI.
Each user needs their own token and refresh cycle, and a Salesforce token carries the full access of its profile, so handing it to an agent without scoping gives that agent broad reach across your CRM. There's no central view of which tokens are live or what they can reach.
A self-hosted server doesn't change that. You still own the OAuth plumbing and the connected app, and now you maintain the server too. Community Salesforce MCP builds vary in object coverage and upkeep, so you're betting on someone else's maintenance.
Merge Agent Handler handles credential storage and token refresh across every connected user. You can scope exactly which Salesforce operations a Codex task can call, and every call is logged with identity, timestamp, and inputs.
For an agent acting on CRM data that drives revenue operations, scoped access plus full audit logging is the foundation you want in place first.
Salesforce holds the object schemas, custom field API names, picklist values, and relationship layouts that CRM integration code has to match exactly.
Codex tasks that write syncs, validation logic, or reporting features need that ground truth to produce code that runs against your org.
The alternative is describing the schema in the prompt, and those descriptions are always a little wrong. A custom field missing its __c suffix, an out-of-date picklist, or a misremembered relationship is enough to make Codex generate SOQL that errors or code that drops data.
Connecting Salesforce lets Codex read the actual schema when a task needs it. The object's fields before a sync, the picklist values before validation, a real record before deserialization: Codex works from your org, not a paraphrase of it.
Yes, Merge for Workforce is built to help organizations provision, secure, and govern how employees connect AI tools like Codex to systems like Salesforce.
Common patterns include:
Taken together, employees can use the Salesforce MCP to scaffold syncs against real object schemas, generate validation logic from actual picklist values, and write relationship queries that match the org's layout, and more, while IT keeps centralized control over which objects each agent can reach.
Use Merge Agent Handler’s 150+ connectors (including Salesforce) to power reliable, secure, and powerful agents.