Salesforce MCP服务添加福利群:解决AI开发者的「MCP实战痛点」这是一个MCP(模型上下文协议)服务器实现,可将Claude与Salesforce集成,使您能够通过自然语言与Salesforce数据和元数据进行交互。该服务器允许Claude使用日常语言查询、修改和管理您的Salesforce对象和记录。
npm install -g @tsmztech/mcp-server-salesforce
搜索标准对象和自定义对象:
获取详细的对象架构信息:
支持关系查询的记录查询:
执行数据操作:
创建和修改自定义对象:
管理对象字段:
跨多个对象搜索:
读取Apex类:
创建和更新Apex类:
读取Apex触发器:
创建和更新Apex触发器:
执行匿名Apex代码:
管理Salesforce用户的调试日志:
您可以使用以下两种认证方法之一连接到Salesforce:
https://your-domain.my.salesforce.com),因为认证需要它将以下内容添加到您的claude_desktop_config.json:
{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": ["-y", "@tsmztech/mcp-server-salesforce"],
"env": {
"SALESFORCE_CONNECTION_TYPE": "User_Password",
"SALESFORCE_USERNAME": "your_username",
"SALESFORCE_PASSWORD": "your_password",
"SALESFORCE_TOKEN": "your_security_token",
"SALESFORCE_INSTANCE_URL": "org_url" // 可选。默认值:https://login.salesforce.com
}
}
}
}

{
"mcpServers": {
"salesforce": {
"command": "npx",
"args": ["-y", "@tsmztech/mcp-server-salesforce"],
"env": {
"SALESFORCE_CONNECTION_TYPE": "OAuth_2.0_Client_Credentials",
"SALESFORCE_CLIENT_ID": "your_client_id",
"SALESFORCE_CLIENT_SECRET": "your_client_secret",
"SALESFORCE_INSTANCE_URL": "https://your-domain.my.salesforce.com" // 必需:必须为您的确切Salesforce实例URL
}
}
}
}

注意:对于OAuth 2.0客户端凭证流,
SALESFORCE_INSTANCE_URL必须为您的确切Salesforce实例URL(例如https://your-domain.my.salesforce.com)。令牌端点将构建为<instance_url>/services/oauth2/token。
"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"
"Search for 'cloud' in Accounts and Opportunities" "Find mentions of 'network issue' in Cases and Knowledge Articles" "Search for customer name across all relevant objects"
"Show me all Apex classes with 'Controller' in the name" "Get the full code for the AccountService class" "Create a new Apex utility class for handling date operations" "Update the LeadConverter class to add a new method"
"List all triggers for the Account object" "Show me the code for the ContactTrigger" "Create a new trigger for the Opportunity object" "Update the Case trigger to handle after delete events"
"Execute Apex code to calculate account metrics" "Run a script to update related records" "Execute a batch job to process large datasets"
"Enable debug logs for user@example.com" "Retrieve recent logs for an admin user" "Disable debug logs for a specific user" "Configure log level to DEBUG for a user"
# 克隆仓库
git clone https://github.com/tsmztech/mcp-server-salesforce.git
# 导航到目录
cd mcp-server-salesforce
# 安装依赖项
npm install
# 构建项目
npm run build

欢迎贡献!请随时提交Pull Request。
本项目根据MIT许可证授权 - 详情请参阅LICENSE文件。
如果您遇到任何问题或需要支持,请在GitHub仓库上提交问题。