Salesforce MCP Integration

Integrations

  • Allows executing SOQL queries against Salesforce data, retrieving and processing Salesforce records, and interacting with Salesforce orgs using authenticated connections.

Salesforce MCP 集成

该项目为 Salesforce 集成提供了一个模型上下文协议 (MCP) 服务器,允许您执行 SOQL 查询并通过标准化界面与 Salesforce 数据交互。

特征

  • 使用环境变量连接到 Salesforce 组织
  • 针对 Salesforce 数据执行 SOQL 查询
  • 检索和处理 Salesforce 记录
  • 使用环境变量进行安全凭证管理

先决条件

  • Node.js(v14 或更高版本)
  • npm(Node 包管理器)
  • 具有 API 访问权限的 Salesforce 组织
  • Salesforce 凭证(用户名、密码和安全令牌)

安装

  1. 克隆此存储库:
    git clone <repository-url> cd <repository-directory>
  2. 安装依赖项:
    npm install
  3. 使用您的 Salesforce 凭据在根目录中创建一个.env文件:
    SF_LOGIN_URL=https://your-instance.salesforce.com/ SF_USERNAME=your_username SF_PASSWORD=your_password SF_SECURITY_TOKEN=your_security_token PORT=3000
    注意:对于沙盒环境,使用https://test.salesforce.com/作为登录 URL。

用法

启动 MCP 服务器

使用 Node.js 运行服务器:

node server.js

服务器将使用.env文件中的凭据连接到 Salesforce 并开始监听 MCP 请求。

执行 SOQL 查询

服务器运行后,您可以通过 MCP 接口执行 SOQL 查询。服务器提供了一个soqlQuery工具,用于接受 SOQL 查询并返回结果。

SOQL 查询示例:

SELECT Id, Name, Status FROM Account LIMIT 5

项目结构

  • server.js - 主 MCP 服务器实现
  • .env - Salesforce 凭证的环境变量
  • package.json - 项目依赖项和脚本

安全注意事项

  • 永远不要将.env文件提交到版本控制
  • .env添加到你的.gitignore文件
  • 对所有敏感信息使用环境变量
  • 考虑在生产环境中使用更安全的身份验证方法

故障排除

连接问题

如果遇到连接问题:

  1. .env文件中验证您的 Salesforce 凭据
  2. 检查您的 Salesforce 组织是否可访问
  3. 确保您的 IP 地址在 Salesforce 中列入白名单(如果需要)
  4. 验证您的 Salesforce 用户具有 API 访问权限

查询错误

如果您的 SOQL 查询失败:

  1. 检查 SOQL 语法
  2. 验证对象和字段是否存在于您的组织中
  3. 确保您的用户有权访问对象和字段

执照

MIT 许可证

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

模型上下文协议服务器允许执行 SOQL 查询并通过标准化接口与 Salesforce 数据交互。

  1. Features
    1. Prerequisites
      1. Installation
        1. Usage
          1. Starting the MCP Server
          2. Executing SOQL Queries
        2. Project Structure
          1. Security Considerations
            1. Troubleshooting
              1. Connection Issues
              2. Query Errors
            2. License
              1. Contributing

                Related MCP Servers

                • A
                  security
                  F
                  license
                  A
                  quality
                  A Model Context Protocol server implementation for interacting with Salesforce through its REST API.
                  Last updated -
                  4
                  10
                  TypeScript
                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Context Protocol server that enables SQL query execution, database management, and business intelligence capabilities through MySQL connections.
                  Last updated -
                  JavaScript
                • -
                  security
                  -
                  license
                  -
                  quality
                  A Model Context Protocol server that provides tools for connecting to and interacting with various database systems (SQLite, PostgreSQL, MySQL/MariaDB, SQL Server) through a unified interface.
                  Last updated -
                  Python
                • -
                  security
                  A
                  license
                  -
                  quality
                  A Model Context Protocol server that enables executing SQL queries and managing connections with Microsoft SQL Server databases.
                  Last updated -
                  3
                  TypeScript
                  MIT License

                View all related MCP servers

                ID: 1xhy5h5go7