salesforce-readonly
Provides read-only inspection of a Salesforce org via REST API, including connected user/org details, object schema and field metadata (types, required flags, picklist values, relationships), SELECT-only SOQL queries with row caps, and fetching individual records by Id with selected fields.
Click on "Deploy 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-readonly describe the Case object and show me the 5 newest escalated cases"
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 MCP Starter (Read-Only)
A minimal, least-privilege Model Context Protocol (MCP) server that lets AI assistants (Claude Code, Cursor, VS Code Copilot) safely inspect a Salesforce org — schema, records and SOQL — without any write access.
What is MCP?
The Model Context Protocol is an open standard — think "USB-C for AI tools". An MCP server exposes typed tools; any MCP client (an AI assistant) can discover and call them. Instead of pasting org data into a chat, the assistant queries the org directly, under the user's own permissions.
flowchart LR
A[AI assistant<br/>Claude Code · Cursor] -- MCP / stdio --> S[salesforce-readonly<br/>MCP server]
S -- REST API as the user --> O[(Salesforce org)]
S -- audit log --> L[stderr / log sink]Related MCP server: MCP Salesforce Reader
Tools
Tool | Description |
| Connected user and org |
| Fields, types, required flags, active picklist values, relationships |
| SELECT-only SOQL, row cap enforced (default 200) |
| One record by Id with chosen fields |
Safety model
Read-only — no DML, Apex execution or metadata deploys are exposed.
Runs as the user — Salesforce sharing, CRUD and FLS still apply.
Input validation — Zod schemas validate object names, Ids and field lists.
SOQL guard — rejects non-SELECT statements and DML keywords; adds/caps
LIMIT.Audit trail — every tool call is logged as structured JSON.
No stored secrets — reuses the Salesforce CLI session (
sf org display).
Setup
npm install && npm run build && npm test
sf org login web --alias my-sandboxAdd to your MCP client config (e.g. .mcp.json / Cursor mcp.json):
{
"mcpServers": {
"salesforce-readonly": {
"command": "node",
"args": ["/absolute/path/salesforce-mcp-starter/dist/index.js"],
"env": { "SF_TARGET_ORG": "my-sandbox" }
}
}
}Then ask your assistant: "Describe the Case object and show me the 5 newest escalated cases."
Extending it
Ideas for a production diagnostic server: metadata read tools (flows, validation rules, permission sets), per-user/per-tool allow-lists, OAuth for hosted (HTTP/SSE) deployment, and shipping audit logs to a SIEM.
License
MIT © Naman G Shetty
Available Tools
4 toolsdescribe_objectA
Describes an sObject: fields, types, required flags, picklist values and relationships.
Inputs: objectName (required).
get_recordC
Gets a single record by Id with the requested fields.
Inputs: fields (required), recordId (required), objectName (required).
run_soqlB
Runs a read-only SOQL SELECT. Results are capped at 200 rows.
Inputs: query (required).
whoamiA
Returns the connected Salesforce user and org.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool maps to a distinct capability: identity (whoami), schema introspection (describe_object), bulk query (run_soql), and single-record fetch (get_record). The only mild overlap is that get_record could be expressed as a SOQL query with an Id filter, but the descriptions make the intended division of labor clear.
Three of four tools follow a clean verb_noun snake_case pattern (describe_object, run_soql, get_record). whoami is a conventional CLI-style name that breaks the pattern slightly but is immediately understandable and unique.
Four tools is on the lean side but matches the tightly scoped read-only purpose, and each tool earns its place. It is not thin enough to be a red flag, though the surface could support one or two more operations.
Core read paths are covered (identity, schema, query, fetch by Id), but there is no way to enumerate available sObjects, so describe_object requires the agent to already know object names. There is also no query pagination or relationship traversal beyond what describe_object reports, which creates real dead ends during exploration.
Maintenance
Related MCP Connectors
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Read-only finance and operations controls for AI agents with evidence and safe next actions.
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Read-only AI coding tools for change verification, release readiness, capacity, and guidance.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables AI assistants to interact with Salesforce data by listing objects, describing fields, and executing SOQL queries.4-
- AlicenseNot gradedqualityDmaintenanceA read-only MCP server for querying Salesforce metadata and object schemas across multiple orgs. Enables AI agents to understand Salesforce org structures securely with production confirmation.MIT
- AlicenseNot gradedqualityDmaintenanceEnables read-only interaction with Salesforce orgs through the local sf CLI, providing tools for SOQL queries, object metadata, and field dependencies, while automatically blocking writes to Production orgs.1MIT
- AlicenseAqualityCmaintenanceEnables AI agents to securely query, search, and modify Salesforce data through standard Salesforce APIs, including record CRUD, SOQL/SOSL search, Bulk API 2.0 operations, composite calls, object discovery, and custom Apex REST endpoints.15MIT