salesforce-remote-mcp-cloudflare
Provides tools for interacting with Salesforce, enabling SOQL/SOSL queries, DML operations, object and field management, Apex code execution, and debug log access.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@salesforce-remote-mcp-cloudflareShow me the top 5 open opportunities by amount"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
salesforce-remote-mcp-cloudflare
A remote MCP (Model Context Protocol) server for Salesforce, deployable on
Cloudflare Workers as a Claude custom connector. It exposes the same 15
Salesforce tools as the local stdio package
@tsmztech/mcp-server-salesforce —
SOQL/SOSL queries, DML, object/field/metadata management, Apex read/write/execute,
debug logs — over Streamable HTTP with full per-user OAuth.
This is a self-hosted template, not a hosted service. You (the setup admin) create a Salesforce Connected App in your org, deploy your own Worker with your own credentials, and register your Worker's URL in Claude. Nothing is shared with anyone else, and no credentials ever leave your Cloudflare account and your Salesforce org.
How it works
Claude (web/desktop/mobile)
│ OAuth 2.1 ─ handled automatically (Dynamic Client Registration, PKCE)
▼
Your Cloudflare Worker ← this repo
│ "Login with Salesforce" ─ your Connected App (OAuth Web Server flow + PKCE)
▼
Your Salesforce orgThere are two separate OAuth relationships:
Claude ↔ Worker — handled entirely by
@cloudflare/workers-oauth-provider. You configure nothing for this; Claude registers itself automatically.Worker ↔ Salesforce — your Connected App. Its consumer key/secret live only in Worker secrets.
When a user clicks Connect in Claude, they are redirected to your org's Salesforce
login page. Their Salesforce tokens are stored encrypted inside the OAuth grant and are
never visible to Claude or to other users. Every tool call runs as the connected
user — their profile, permissions, and field-level security apply. Expired access
tokens are refreshed automatically (proactively when Claude refreshes its own token,
and reactively on INVALID_SESSION_ID).
One deployment = one Salesforce org. The org (production, sandbox, or a My Domain) is fixed by your configuration. End users don't pick an org — they just log in with their own identity in that org. To serve a second org, deploy a second Worker.
Related MCP server: my-mcp-server
Prerequisites
A Cloudflare account (free tier works) — sign up
Node.js 18+ and npm
A Salesforce org you administer (production, Developer Edition, or sandbox)
A Claude plan that supports custom connectors (Pro, Max, Team, or Enterprise)
Step 1 — Deploy the Worker
Deploy first: you need your Worker's URL before you can create the Connected App (its OAuth callback points at the Worker).
git clone <this-repo>
cd salesforce-remote-mcp-cloudflare
npm install --legacy-peer-deps
npx wrangler loginCreate the KV namespace the OAuth provider stores its (encrypted) state in:
npx wrangler kv namespace create OAUTH_KVCopy the printed id into wrangler.jsonc:
"kv_namespaces": [{ "binding": "OAUTH_KV", "id": "<your-id-here>" }],In the same file, set your org's login host — this pins the deployment to your org:
// production / Developer Edition: login.salesforce.com
// sandbox: test.salesforce.com
// My Domain (recommended): yourcompany.my.salesforce.com
"vars": { "SALESFORCE_LOGIN_HOST": "login.salesforce.com" }Set the state-encryption key (any long random value; you never need it again):
openssl rand -base64 32 | npx wrangler secret put COOKIE_ENCRYPTION_KEYDeploy:
npx wrangler deployNote the URL wrangler prints, e.g.
https://salesforce-remote-mcp-cloudflare.<your-subdomain>.workers.dev.
That is your Worker URL — you'll use it in Steps 2 and 4. (The server won't work
yet; it still needs the Connected App credentials from the next step.)
Step 2 — Create the Connected App in Salesforce
Connected Apps can only be created through the Setup UI — the Metadata API blocks programmatic creation, so there is no CLI shortcut for this step.
In your org: Setup → App Manager → New Connected App (in some orgs: New Connected App → Create a Connected App).
Fill in the basics: any name (e.g.
Claude MCP), your email.Check Enable OAuth Settings and configure:
Callback URL:
https://<your-worker-url>/sf/callback(e.g.https://salesforce-remote-mcp-cloudflare.acme.workers.dev/sf/callback)Selected OAuth Scopes — add exactly these two:
Manage user data via APIs (api)
Perform requests at any time (refresh_token, offline_access)
Require Proof Key for Code Exchange (PKCE): leave enabled (the server uses PKCE).
Require Secret for Web Server Flow: leave enabled.
Save. Salesforce warns changes can take up to 10 minutes to take effect.
Open the app's detail page → Manage Consumer Details (email verification may be required) and copy the Consumer Key and Consumer Secret.
Optional hardening (Setup → Connected Apps → Manage → Edit Policies): set Permitted Users to Admin approved users are pre-authorized to allowlist which profiles/permission sets may use the connector at all.
Step 3 — Give the Worker its Salesforce credentials
npx wrangler secret put SALESFORCE_CLIENT_ID # paste the Consumer Key
npx wrangler secret put SALESFORCE_CLIENT_SECRET # paste the Consumer SecretSecrets are stored by Cloudflare, never in code or git. That's the whole server-side setup — no redeploy needed after setting secrets.
Step 4 — Add the connector in Claude
Team / Enterprise: an org owner/admin adds it once for everyone — Admin settings → Connectors → Add custom connector.
Pro / Max: add it for yourself — Settings → Connectors → Add custom connector.
In the dialog:
Name: anything, e.g.
SalesforceRemote MCP server URL:
https://<your-worker-url>/mcp— note the/mcppathAdvanced settings → OAuth Client ID / Client Secret: LEAVE BLANK. Those fields are a fallback for servers that can't register clients automatically; this server supports Dynamic Client Registration, so Claude configures itself. Your Connected App's key/secret belong only in Worker secrets (Step 3) — never paste them into Claude.
Step 5 — Connect (end users)
In Claude, find the connector and click Connect.
You're redirected to your company's Salesforce login — log in and click Allow.
Done. Ask Claude to
pingthe Salesforce connector to confirm: it replies with the Salesforce username the session is bound to.
Each user connects individually and gets their own permissions — what a user can't see or edit in Salesforce, they can't see or edit through Claude.
The tools
Category | Tools |
Discovery |
|
Query |
|
Data |
|
Schema |
|
Apex |
|
Debug |
|
Health |
|
Tool behavior matches the local @tsmztech/mcp-server-salesforce package. Large
results are truncated at ~140k characters (Claude's connector limit is ~150k) with a
notice asking to narrow the query.
Troubleshooting
Symptom | Likely cause / fix |
Claude: "could not reach server" when adding the connector | URL must end in |
Salesforce error page during Connect: | Connected App callback URL doesn't exactly match |
|
|
Login page is the wrong org type (prod vs sandbox) | Fix |
Tool calls fail with "reconnect" message | The refresh token was revoked or expired (e.g. admin revoked OAuth usage, or org token policies). Disconnect and reconnect the connector. |
| Shouldn't happen — the server auto-refreshes once and retries. If persistent, check the Connected App's refresh-token policy (Refresh token is valid until revoked is the friendliest). |
Worker logs |
|
Corporate IP allowlisting | Claude's egress range is |
Security notes
Per-user identity: every Salesforce call uses the connected user's own token; org permissions and FLS always apply. There is no service account.
No token passthrough: Claude's token and Salesforce's tokens are separate; neither is ever forwarded to the other side.
Storage: Salesforce tokens are stored encrypted at rest inside the OAuth grant (Cloudflare KV, encrypted by
workers-oauth-provider); the interim login state is AES-GCM sealed withCOOKIE_ENCRYPTION_KEY.Secrets: only ever via
wrangler secret put— never in code, config, or git.Revocation: a Salesforce admin can cut any user (or the whole app) off at any time — Setup → Connected Apps OAuth Usage → Revoke. Users can also disconnect from Claude's connector settings.
See SECURITY.md for reporting vulnerabilities.
Local development
cp .dev.vars.example .dev.vars # fill in your Connected App creds (gitignored)
npx wrangler dev # http://localhost:8787
npm run typecheck
npm testNote: connecting from claude.ai requires a public HTTPS URL, so end-to-end connector
testing happens against a deployed Worker; wrangler dev is for the OAuth endpoints
and unit-testable logic.
License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceEnables deploying and connecting to MCP servers on Cloudflare Workers with OAuth login, allowing remote access to tools via MCP clients like Claude Desktop.270MIT
- Flicense-qualityDmaintenanceA remote MCP server deployed on Cloudflare Workers with OAuth, enabling tools like math operations and integration with Claude Desktop via SSE.
- Flicense-qualityCmaintenanceDeploys a remote MCP server on Cloudflare Workers with OAuth login, enabling tool calls via SSE from clients like Claude Desktop.
- Flicense-qualityCmaintenanceA remote MCP server deployed on Cloudflare Workers without authentication, enabling tool creation and integration with MCP clients like Claude Desktop and Cloudflare AI Playground.
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Hosted Amazon Seller Central and Amazon Ads MCP server for Claude, ChatGPT, Cursor, and agents.
Hosted Amazon Seller and Vendor MCP server for Claude, ChatGPT, Cursor, Codex, Gemini, Copilot.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tsmztech/salesforce-remote-mcp-cloudflare'
If you have feedback or need assistance with the MCP directory API, please join our Discord server