sfgraph
Provides tools to interact with Salesforce orgs, including live-syncing metadata and data to a local knowledge graph, enabling AI agents to analyze Apex, LWC, Flow, Vlocity, OmniStudio, security, and integrations without leaving the local machine.
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., "@sfgraphshow me all Apex triggers and their related objects"
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.
@ryanstark24/sfgraph
A local, privacy-first knowledge graph for Salesforce orgs. sfgraph live-syncs your org to a SQLite + vector index on your machine and exposes 26 MCP tools to Cursor, Claude Code/Desktop, and VS Code, so the AI you already use can reason about Apex, LWC, Flow, Vlocity, OmniStudio, security, and integrations without your code or schema ever leaving your laptop.
┌──────────────────────────────────────────────────────────────────────┐
│ Cursor / Claude / VS Code ←──── MCP stdio ────→ sfgraph │
│ │
│ read-only Salesforce APIs ──→ your org │
│ local SQLite + sqlite-vec ←── OS data dir │
└──────────────────────────────────────────────────────────────────────┘Privacy in one line. Nothing leaves your machine — graph, vectors, logs all live under the platform's user-data directory (~/Library/Application Support/sfgraph/ on macOS, ~/.local/share/sfgraph/ on Linux, %APPDATA%\sfgraph\ on Windows; see docs/DATA_LOCATIONS.md). Salesforce auth is delegated to the sf CLI (token stays in ~/.sfdx/). Every connection is wrapped in a read-only Proxy. Full threat model: docs/PRIVACY.md.
Install
1. Prerequisites
How | |
Node.js ≥ 20 | nodejs.org or |
|
|
At least one |
|
Verify:
node --version # v20+ (v22 LTS recommended)
sf org list # at least one org marked as default2. Install sfgraph
npm install -g @ryanstark24/sfgraphOr run on-demand via npx @ryanstark24/sfgraph <command> without installing.
After install, sfgraph is on your PATH.
3. Wire it into your editor
sfgraph installIdempotent. Copies 17 skill playbooks into ~/.claude/skills/ + ~/.cursor/rules/ and adds a sfgraph entry to your editor's MCP config. Existing MCP entries are preserved. Use --target=claude|cursor|vscode to wire only one, or --dry-run to preview.
Using a different IDE or LLM client?
sfgraph install writes config for Claude / Cursor / VS Code automatically. For any other MCP-compatible client (Windsurf, Zed, Continue, Cline, an OpenAI- or Gemini-based agent with MCP support, your own custom host, etc.), add this entry to the client's MCP config file manually:
{
"mcpServers": {
"sfgraph": {
"command": "npx",
"args": ["-y", "@ryanstark24/sfgraph", "mcp"]
}
}
}On Windows, use "npx.cmd" instead of "npx".
Pinning the Node binary. Some hosts (sandboxed Electron apps, IDE extensions) ship with a bundled Node whose ABI differs from your shell's. If that bundled Node lacks a matching better-sqlite3 prebuilt, the MCP child fails to load. Pin to your shell's Node:
{
"mcpServers": {
"sfgraph": {
"command": "/Users/you/.nvm/versions/node/v22.21.1/bin/node",
"args": ["/usr/local/bin/sfgraph", "mcp"]
}
}
}Use which node and which sfgraph to fill in the paths. Same effect as sfgraph install --local --pin-node "$(which node)" but written by hand into a client we don't have a built-in target for.
Where each known client keeps its MCP config:
Client | Config path |
Claude Desktop |
|
Claude Code (CLI) |
|
Cursor |
|
VS Code |
|
Windsurf |
|
Zed |
|
Continue (VS Code) |
|
Cline (VS Code) |
|
After editing the file, fully restart the client so it re-reads the MCP server list. Then ask the agent something like "list orgs from sfgraph" to confirm the tools are visible.
The skill playbooks (sf-impact-from-diff, sf-security-audit, etc.) are Claude/Cursor-specific. On other clients, the agent still has direct access to all 26 MCP tools — it just routes by tool name instead of by skill trigger.
4. Verify the install
sfgraph doctorEnd-to-end self-check: Node ABI, native bindings, code-signing (macOS), data dir, org DBs, sf CLI, IDE MCP configs. Each failed check prints a copy-paste fix.
If you see a bindings file not found / ABI mismatch (common after a Node upgrade or on a brand-new Node release with no prebuilts yet):
sfgraph rebuild-bindingsFirst ingest
The first sync of an org takes 2–6 minutes on a typical 50K-node sandbox. Subsequent syncs on Source-Tracking-enabled orgs are incremental (<30 s).
# Default org from `sf config target-org`
sfgraph ingest
# Or pick an org explicitly
sfgraph ingest --org my-prodThe graph lands in <data-dir>/<orgId>.sqlite (macOS: ~/Library/Application Support/sfgraph/, Linux: ~/.local/share/sfgraph/, Windows: %APPDATA%\sfgraph\). From this point every MCP tool reads only from that file — no network calls.
Keep it fresh. Re-run sfgraph ingest whenever you want current data. Skills warn the agent when the graph is older than 7 days.
For tuning, large-org options, multi-org ingest, and rebuild flags, see docs/CLI.md.
Use it from your editor
Restart your IDE so it picks up the new MCP entry. Then in any project ask the agent:
"What does this PR break?"
"Who reads
Account.Status__c?""What changed in prod since last week?"
"Show me how
accountTileflows from UI to DB."
The agent routes to the right tool automatically via the installed skill playbooks. A short worked example:
User: I'm about to merge this PR. Anything I should worry about?
Agent: *invokes sf-impact-from-diff*
→ impact_from_git_diff(diff="…", depth=3)
→ test_gap_intelligence_from_git_diff(diff="…")
Your diff touches 3 nodes. 9 dependents at 3 hops:
• 4 covered by tests (green)
• 5 at-risk (no IS_TEST_FOR):
- LWC:opportunityTile
- ApexMethod:BillingSvc.run(2)
- ApexMethod:BillingSvc.dryRun(0)
- Flow:Order_Status_Update
- LWC:invoiceTile
Recommend adding test coverage for BillingSvc.run(2) before merging.More worked examples: docs/SAMPLES.md.
Optional: web visualiser
sfgraph serve # http://localhost:7777A 3D force-graph explorer for the ingested org. Loopback-only by default. See docs/WEB.md.
Documentation
Full CLI reference — every command, every flag | |
The 26 MCP tools — schemas, examples, algorithms | |
The 17 skill playbooks installed into your editor | |
Worked agent-conversation examples | |
Metadata coverage matrix and SObject classification logic | |
Local web visualiser | |
Diagnose and fix common install / ingest issues | |
Architecture decisions, analysis pipeline, TS rewrite rationale | |
Storage model + ingestion pipeline deep-dive | |
Read-only enforcement, sanitizer, telemetry threat model | |
What lives where on your machine | |
Build, test, contribute | |
Per-release notes |
License
MIT
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.
Latest Blog Posts
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/ryanStark24/sfgraph'
If you have feedback or need assistance with the MCP directory API, please join our Discord server