
只读的Salesforce案例操作作为MCP工具——授权委托给sf CLI,代理组合支持查询
概览
一个只读的MCP服务器,将Salesforce案件操作变成AI客服可以调用的工具。指向你的组织,用Claude(桌面或代码)问问题,用通俗易懂的问题:“现在积压在哪里?”“给我看本周升级的案件”,“过去一个月已建立与已关闭案件。” 基于真实的支持运营实践:工具表面是支持运营经理实际执行的查询集合——队列量、案件查询、每周创建/关闭趋势——而非通用的API封装器。 每个工具都向 sf 发送,因此凭证存在 CLI 的密钥链中。服务器永远不会看到、存储或传输密码或令牌——如果 sf 组织列表正常,服务器就能正常工作。 服务器只包裹三个子命令:sf data query、sf sobject dedescription 和 sf org display。它们都不能修改数据。此外,原始的 SOQL 工具会拒绝任何非 SELECT 的内容,且标识符输入(对象名、案件编号、状态)在触及查询前会被验证。
概述(AI 翻译)
一个只读的MCP服务器,将Salesforce案件操作转化为工具和人工智能 客服可以打电话。用Claude(桌面或Code)向你的组织提问 通俗英语:“现在积压在哪里?” “给我看升级的案件,来自 本周,“创建VS关闭了一个月。”
基于真实的支持运营实践:工具表面是查询集合 a 支持运营管理器实际上会运行——队列处理、案件查询、每周 创建/关闭趋势——不是通用的API包装器。
设计决策
授权完全委托给sf CLI。 所有工具都交付给sf,
所以凭据存储在 CLI 的密钥链中。服务器从未看到、存储或
传输密码或令牌——如果sf org list正常工作,服务器就能正常工作。
结构上只读,而非承诺。 服务器只包裹三个
子命令:sf data query、sf sobject describe和sf org display。
它们都无法修改数据。此外,原始的SOQL工具会拒绝
任何非 SELECT 的输入,以及标识符输入(对象名、大小写)
数字、状态)在触及查询前都会被验证。赋予LLM
对生产CRM的写权限是一个值得独立设计的决策
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
sf-caseops-mcp
A read-only MCP server that turns Salesforce case operations into tools an AI agent can call. Point Claude (Desktop or Code) at your org and ask questions in plain English: “where’s the backlog right now,” “show me escalated cases from this week,” “created vs closed for the last month.”
Built from real support-ops practice: the tool surface is the set of queries a support operations manager actually runs — queue volumes, case lookups, weekly created/closed trend — not a generic API wrapper.
Design decisions
Auth is delegated entirely to the sf CLI. Every tool shells out to sf,
so credentials live in the CLI’s keychain. The server never sees, stores, or
transmits a password or token — if sf org list works, the server works.
Read-only by construction, not by promise. The server only wraps three
subcommands: sf data query, sf sobject describe, and sf org display.
None of them can modify data. On top of that, the raw SOQL tool rejects
anything that isn’t a SELECT, and identifier inputs (object names, case
numbers, statuses) are validated before they touch a query. Giving an LLM
write access to a production CRM is a decision that deserves its own design
conversation — this server deliberately doesn’t open that door.
Org targeting is explicit and inspectable. Set SF_TARGET_ORG to an org
alias (falls back to the sf CLI default org). The org_info tool reports
which org is connected and whether it’s a sandbox, so the agent — and you —
can always verify before trusting an answer.
Tools
| Tool | What it does |
|---|---|
org_info |
Which org am I connected to? Alias, username, instance, sandbox or not |
soql_query |
Arbitrary read-only SOQL SELECT |
describe_object |
Field names, types, and picklist values for any object |
case_lookup |
Full detail on one case by number, including recent comments |
recent_cases |
Cases from the last N days, optionally filtered by status |
queue_volumes |
Open case counts by queue/owner — the “where’s the backlog” view |
case_volume_report |
Weekly created vs closed vs net, for trend spotting |
sla_risk_report |
Entitlement milestone risk: pending first-response clocks, fresh breaches, paused waiting-on-customer milestones |
problem_candidates |
Candidate problem records: Product/Type pairs recurring at one property, weekly bursts over a pair’s own baseline, slow drifts above a quarter ago, units that keep coming back |
Setup
Requires the Salesforce CLI authed to at least one org, and Python 3.10+.
git clone https://github.com/neeshykha/sf-caseops-mcp
cd sf-caseops-mcp
python3 -m venv .venv && ./.venv/bin/pip install "mcp>=1.28,<2"
The version bound matters. The MCP Python SDK released v2.0.0 on 2026-07-28
alongside the stateless spec revision, and it renamed FastMCP to MCPServer,
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"sf-caseops": {
"command": "/path/to/sf-caseops-mcp/.venv/bin/python",
"args": ["/path/to/sf-caseops-mcp/server.py"],
"env": { "SF_TARGET_ORG": "sandbox" }
}
}
}