Get the FREE Ultimate OpenClaw Setup Guide →

salesforce

An MCP Server for your Salesforce org

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio realfastai-salesforce-mcp-server tsx /absolute/path/to/salesforce-mcp-server/src/stdio-server.ts \
  --env MCP_LOG_FILE="/absolute/path/to/your/project/server.log" \
  --env SFDC_CLIENT_ID="your_connected_app_client_id" \
  --env SFDC_TOKEN_FILE="/absolute/path/to/your/project/.salesforce-tokens.enc" \
  --env SFDC_API_VERSION="v59.0" \
  --env SFDC_INSTANCE_URL="https://your-org.my.salesforce.com" \
  --env SFDC_CLIENT_SECRET="your_connected_app_client_secret"

How to use

This MCP server provides secure access to a Salesforce org via OAuth2 PKCE and exposes a set of tools for querying and exploring Salesforce data through Claude Desktop. After starting the server, Claude Desktop communicates with the MCP server using the MCP protocol over standard I/O, enabling features like object metadata exploration, SOQL/SOSL querying, record retrieval, and org context insights. The included tools cover core data access (describe_object, list_objects, soql_query, get_record, sosl_search), field metadata (get_picklist_values), query analysis (validate_soql, explain_query_plan), and organization context (get_org_limits, get_user_info). OAuth2 token handling is automatic with encrypted storage, and all tool outputs are surfaced in a structured, tool-oriented interface for downstream AI reasoning. To begin, ensure your Salesforce connected app is configured, credentials are set in environment variables, and Claude Desktop is connected to the MCP server.

How to install

Prerequisites:

  • Node.js 18.x or higher
  • tsx globally installed (npm install -g tsx)
  • Salesforce Connected App configured for OAuth2 PKCE
  • Claude Desktop for MCP integration
  1. Clone the repository and install dependencies
git clone https://github.com/realfastAI/salesforce-mcp-server.git
cd salesforce-mcp-server
npm install
  1. Configure environment variables Create or edit environment file (.env) or set them in your runtime environment:
export SFDC_CLIENT_ID=<your_connected_app_client_id>
export SFDC_CLIENT_SECRET=<your_connected_app_client_secret>
export SFDC_INSTANCE_URL=https://your-org.my.salesforce.com
export SFDC_API_VERSION=v59.0
export MCP_LOG_FILE="/absolute/path/to/your/project/server.log"
export SFDC_TOKEN_FILE="/absolute/path/to/your/project/.salesforce-tokens.enc"
  1. Run the MCP server locally (via tsx as shown in the config)
tsx /absolute/path/to/salesforce-mcp-server/src/stdio-server.ts
  1. (Optional) Add to Claude Desktop configuration as described in the README example to enable seamless integration.

Additional notes

Tips and considerations:

  • Ensure the Salesforce Connected App is propagated after setup (2–10 minutes).
  • The server stores tokens encrypted locally; ensure the token file path is writable and secured.
  • If OAuth redirects fail, verify the Callback URL exactly matches http://localhost:8080/callback and that the required scopes are enabled.
  • Maintain secure handling of SFDC_CLIENT_ID and SFDC_CLIENT_SECRET; avoid committing them to version control.
  • If you encounter TLS or network issues, check your environment's network access to Salesforce endpoints and verify SFDC_INSTANCE_URL is correct.
  • The MCP server uses Claude Desktop integration via stdio transport; ensure Claude Desktop is configured to communicate with the salesforce MCP server entry point.
  • For debugging, check MCP_LOG_FILE for runtime logs and enable verbose logging if available in the config.

Related MCP Servers

Sponsor this space

Reach thousands of developers