Back to MCP directory
publicPublicdnsLocal runtime

mcp-server-salesforce

Salesforce MCP服务器实现,集成Claude AI实现自然语言交互,支持查询、修改和管理Salesforce数据和元数据。

article

README

🚀 Salesforce MCP 服务器

Salesforce MCP(多租户核心平台)服务器支持用户通过命令行接口与 Salesforce 实例进行交互。该工具功能丰富,涵盖搜索对象、获取架构信息、查询记录、管理自定义对象以及处理 Apex 代码等操作。

🚀 快速开始

要使用 Salesforce MCP 服务器,你需要先进行安装和配置,之后就能开展各类操作。下面为你详细介绍具体步骤。

✨ 主要特性

  • 支持通过命令行接口与 Salesforce 实例交互。
  • 提供多种操作,如搜索对象、获取架构信息、查询记录、管理自定义对象以及处理 Apex 代码等。

📦 安装指南

使用 npm 安装

npm install -y @tsmztech/mcp-server-salesforce

📚 详细文档

配置指南

环境变量配置

在使用前,请确保设置以下环境变量:

  • SALESFORCE_CONNECTION_TYPE: 指定连接类型,支持 User_PasswordOAuth_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。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client