Salesforce MCP Server
Salesforce MCP 服务器
设置
uv venv .venv
uv pip install --python .venv/bin/python -e .配置
设置环境变量以进行身份验证:
用户名/密码(默认):
SALESFORCE_USERNAME=your-username
SALESFORCE_PASSWORD=your-password
SALESFORCE_SECURITY_TOKEN=your-token
SALESFORCE_DOMAIN=login # or "test" for sandbox注意: 在较新的 Salesforce 组织中,SOAP API 登录默认处于禁用状态。要启用它:
转到 设置 (Setup) → 快速查找 → 用户界面 (User Interface)
在 API 设置 (API Settings) 下,勾选 启用 SOAP API 登录 (Enable SOAP API login())
点击 保存 (Save)
OAuth(替代方案,推荐用于企业环境):
SALESFORCE_ACCESS_TOKEN=your-token
SALESFORCE_INSTANCE_URL=https://your-instance.salesforce.com访问模式
通过设置 SALESFORCE_ACCESS_MODE 来控制可用的工具:
值 | 可用工具 | 使用场景 |
| list_objects, describe_object, run_soql_query, run_sosl_search, get_record, get_report_metadata, get_report_type_fields | 安全探索、报表、只读集成 |
| 所有读取工具 + create_record, update_record | 日常 CRM 操作 |
| 所有工具,包括 delete_record, tooling_execute, apex_execute, restful | 完全 API 访问权限 |
推荐的安全级别
环境 | 推荐模式 | 理由 |
生产环境(最终用户) |
| 防止意外的数据修改 |
生产环境(受信任的操作) |
| 允许 CRM 数据录入,禁止删除和原始 API 调用 |
沙盒 / 开发环境 |
| 用于测试和开发的完全访问权限 |
演示 / 探索 |
| 安全地探索组织结构和数据 |
在您的环境或 MCP 服务器配置中进行设置:
SALESFORCE_ACCESS_MODE=read提示: 当将此服务器与 MintMCP 一起使用时,您可以直接在 MintMCP 中配置细粒度的工具级权限,而无需使用环境变量。这为您提供了更精细的控制(例如,允许创建但不允许更新),且无需重启服务器。
按访问模式划分的工具权限
MCP 工具注解 (readOnlyHint, destructiveHint) 设置在每个工具上,以便 MCP 客户端可以强制执行额外的策略:
工具 | 访问模式 | readOnlyHint | destructiveHint | openWorldHint |
| read | true | — | — |
| read | true | — | — |
| read | true | — | — |
| read | true | — | — |
| read | true | — | — |
| read | true | — | — |
| read | true | — | — |
| read_write | false | — | — |
| read_write | false | — | — |
| all | false | true | — |
| all | false | — | true |
| all | false | — | true |
| all | false | — | true |
运行
.venv/bin/python -m salesforce_mcp工具
工具 | 描述 |
| 列出组织中的所有 Salesforce 对象(带有可选的搜索过滤器) |
| 获取对象的字段、关系、选项列表值和记录类型 |
| 执行 SOQL 查询 |
| 通过 SOSL 进行跨对象全文搜索 |
| 通过 ID 获取单条记录 |
| 获取报表的详细元数据(列、过滤器、分组、报表类型) |
| 深入了解报表类型的字段目录 — 列出类别,或获取某个类别的字段 |
| 创建新记录 |
| 更新现有记录上的字段 |
| 永久删除记录 |
| Salesforce Tooling API(元数据、Apex 类、自定义字段) |
| 调用自定义 Apex REST 端点 |
| 通用 Salesforce REST API 调用 |
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/mintmcp/salesforce-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server