salesforce-mcp-server

pablo-camprubi/salesforce-mcp-server

3.2

If you are the rightful owner of salesforce-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A Model Context Protocol (MCP) server for Salesforce operations built with FastMCP, providing tools for connecting to Salesforce, running queries, managing records, and exploring object schemas.

Tools
11
Resources
0
Prompts
0

Salesforce MCP Server (FastMCP)

A Model Context Protocol (MCP) server for Salesforce operations built with FastMCP. This server provides tools for connecting to Salesforce, running queries, managing records, and exploring object schemas.

Features

Core MCP Tools

  • greet: Welcome message for Salesforce MCP users
  • search: Search Salesforce documentation and examples
  • fetch: Retrieve specific documentation items by ID

Salesforce Connection

  • connect_salesforce: Establish connection to Salesforce org
  • get_connection_status: Check current connection status

Data Operations

  • run_soql_query: Execute SOQL queries against Salesforce
  • run_sosl_search: Execute SOSL searches
  • create_record: Create new records in Salesforce objects
  • update_record: Update existing records
  • delete_record: Delete records from Salesforce

Schema Exploration

  • describe_object: Get detailed schema information for Salesforce objects

Quick Start

Local Development

  1. Install dependencies:

    uv venv
    source .venv/bin/activate
    uv pip install -r requirements.txt
    
  2. Run the server:

    python server.py
    
  3. Test with MCP Inspector:

    npx @modelcontextprotocol/inspector
    
    • Choose "Streamable HTTP"
    • Connect to: http://127.0.0.1:8000/mcp

Deployment on Alpic AI

  1. Push to GitHub:

    git add .
    git commit -m "Initial Salesforce MCP server with FastMCP"
    git branch -M main
    git remote add origin https://github.com/<your-username>/<repo-name>.git
    git push -u origin main
    
  2. Deploy on Alpic:

    • Sign in at Alpic AI
    • Create a new project
    • Import your GitHub repository
    • Configure build settings:
      • Install command: uv pip install -r requirements.txt
      • Build command: (none required)
      • Output directory: (not required)
    • Click Deploy
  3. Test your deployment:

    npx @modelcontextprotocol/inspector
    
    • Connect to your Alpic URL: https://mcp-server-XXXXXXX.alpic.live

Usage Examples

Connect to Salesforce

{
  "method": "tools/call",
  "params": {
    "name": "connect_salesforce",
    "arguments": {
      "username": "your-username@company.com",
      "password": "your-password",
      "security_token": "your-security-token",
      "domain": "login"
    }
  }
}

Run SOQL Query

{
  "method": "tools/call",
  "params": {
    "name": "run_soql_query",
    "arguments": {
      "query": "SELECT Id, Name, Industry FROM Account LIMIT 10"
    }
  }
}

Describe Object Schema

{
  "method": "tools/call",
  "params": {
    "name": "describe_object",
    "arguments": {
      "object_name": "Account"
    }
  }
}

Create Record

{
  "method": "tools/call",
  "params": {
    "name": "create_record",
    "arguments": {
      "object_name": "Account",
      "data": {
        "Name": "New Account",
        "Industry": "Technology"
      }
    }
  }
}

Client Configuration

For ChatGPT Developer Mode

Add your Alpic deployment URL in ChatGPT Settings → Developer → Add MCP Server.

For other MCP clients (mcp.json)

{
  "mcpServers": {
    "salesforce-mcp": {
      "url": "https://mcp-server-XXXXXXX.alpic.live",
      "transport": "http"
    }
  }
}

Security Notes

  • Never commit Salesforce credentials to version control
  • Use environment variables or secure credential management
  • Consider implementing OAuth 2.1 for production deployments
  • The server supports encrypted credentials for enhanced security

Troubleshooting

"search action not found" in ChatGPT Developer Mode

Ensure your server exposes the search and fetch tools as shown in the implementation.

Connection Issues

  • Verify Salesforce credentials are correct
  • Check security token (required for API access)
  • Ensure proper domain setting (login/test for sandbox)

Transport Mismatch

Use Streamable HTTP with "transport": "http" in client configuration.

Dependencies

  • fastmcp: FastMCP framework for MCP server development
  • simple-salesforce: Python library for Salesforce API interactions
  • pydantic: Data validation and settings management

License

MIT License - see LICENSE file for details.