Skip to main content
Glama
salesforce-readonly

salesforce-readonly

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.

TypeScript MCP Salesforce


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

whoami

Connected user and org

describe_object

Fields, types, required flags, active picklist values, relationships

run_soql

SELECT-only SOQL, row cap enforced (default 200)

get_record

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-sandbox

Add 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 tools
describe_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

    B3.3/5.0

    Scored across 4 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count4/5

    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.

    Completeness3/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to interact with Salesforce data by listing objects, describing fields, and executing SOQL queries.
      4
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      A 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
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables 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.
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables 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.
      15
      MIT