Salesforce MCP(多租户核心平台)服务器支持用户通过命令行接口与 Salesforce 实例进行交互。该工具功能丰富,涵盖搜索对象、获取架构信息、查询记录、管理自定义对象以及处理 Apex 代码等操作。
要使用 Salesforce MCP 服务器,你需要先进行安装和配置,之后就能开展各类操作。下面为你详细介绍具体步骤。
npm install -y @tsmztech/mcp-server-salesforce
在使用前,请确保设置以下环境变量:
SALESFORCE_CONNECTION_TYPE: 指定连接类型,支持 User_Password 和 OAuth_2.0_Client_Credentials。SALESFORCE_USERNAME: Salesforce 用户名(仅适用于 User_Password)。SALESFORCE_PASSWORD: Salesforce 密码(仅适用于 User_Password)。SALESFORCE_TOKEN: 安全令牌(仅适用于 User_Password)。SALESFORCE_CLIENT_ID: OAuth 2.0 客户端 ID(仅适用于 OAuth_2.0_Client_Credentials)。SALESFORCE_CLIENT_SECRET: OAuth 2.0 客户端密钥(仅适用于 OAuth_2.0_Client_Credentials)。SALESFORCE_INSTANCE_URL: Salesforce 实例 URL,例如 https://your-domain.my.salesforce.com。# 克隆仓库
git clone https://github.com/tsmztech/mcp-server-salesforce.git
# 进入目录
cd mcp-server-salesforce
# 安装依赖
npm install
# 构建项目
npm run build
"Find all objects related to Accounts"
"Show me objects that handle customer service"
"What objects are available for order management?"
"What fields are available in the Account object?"
"Show me the picklist values for Case Status"
"Describe the relationship fields in Opportunity"
"Get all Accounts created this month"
"Show me high-priority Cases with their related Contacts"
"Find all Opportunities over $100k"
"Create a Customer Feedback object"
"Add a Rating field to the Feedback object"
"Update sharing settings for the Service Request object"
欢迎贡献!请自由提交 Pull Request。
本项目在 MIT 许可证下发布,详情请见 LICENSE 文件。
如需帮助或遇到问题,请在 GitHub 仓库 提交 Issues。