@iivanov/salesforce-lens
v0.1.16
Published
Salesforce Lens — local stdio MCP server. Turns the Salesforce Lens audit + Omnistudio Explorer surface into conversational MCP tools, authenticating against the local `sf` / `sfdx` CLI cache.
Maintainers
Readme
Salesforce Lens — MCP Server
Bring Salesforce org auditing directly into your AI assistant. Ask "run an audit of my org", pick an org and an audit from clickable menus, and get a plain-English summary — no extra services, no manual queries. Works in Cursor, Claude Desktop, and Claude Code.
Prerequisites
- Node.js ≥ 18
- Salesforce CLI authenticated:
sf org login web --set-default
Quickstart
Add one of the snippets below to your client config, then restart the client.
Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"salesforce-lens": {
"command": "npx",
"args": ["-y", "@iivanov/salesforce-lens@latest", "--stdio"]
}
}
}Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json)
Same shape as Cursor — add the salesforce-lens entry under mcpServers and restart Claude Desktop with Cmd+Q.
Claude Code
claude mcp add salesforce-lens \
--scope user \
-- npx -y @iivanov/salesforce-lens@latest --stdioWhat you can do
- Platform audits — run 30+ org-health checks covering Apex code quality, security & sharing, automation hygiene, integration patterns, data model, and more. Results are summarised in plain English with actionable findings.
- OmniStudio explorer — browse OmniScripts, Integration Procedures, DataMappers, FlexCards, and Vlocity actions; run per-component or org-wide compliance sweeps.
- Industry & licensing — inspect cloud-specific license usage and configuration.
- Branded reports — export any result as a self-contained HTML or Markdown report in Salesforce visual style.
How a conversation flows
- Say "run an audit of my Salesforce org" (or open the
audit_my_salesforce_orgprompt from the MCP prompt picker). - A clickable org picker appears — select from your locally authenticated SF CLI orgs.
- A clickable audit picker lists all audits grouped by category — select one.
- The assistant returns a summary and offers to run another audit.
On clients without form-picker support the same flow works via a numbered text menu — just reply with the number shown.
Configuration
No environment variables are required. If you want to pin a specific org without using the picker, set SF_TARGET_ORG to an org alias or username in the client config's env block.
Troubleshooting
command not found: npx— Cursor and Claude Desktop don't always inherit your shell PATH. Setcommandto the absolute path fromwhich npx(e.g./usr/local/bin/npx).- Empty org picker — run
sf org listto confirm at least one org is authenticated; log in withsf org login web --set-defaultif the list is empty. - Numbered menu instead of picker — your client version doesn't support form elicitation. The pick-and-run flow still works; just reply with a number.
- Enable verbose logging — add
"env": { "MCP_DEBUG": "1" }to the server config to print diagnostics to stderr.
Telemetry
Salesforce Lens collects anonymous usage data (version, OS, Node version, random install ID) to improve the tool. Set SALESFORCE_LENS_NO_TELEMETRY=1 to opt out.
Issues & contributing
Report bugs and request features on the monorepo issue tracker. Development docs (running from source, adding audits, publishing) are in the root README.md.
