Skip to main content
Glama

MCP Salesforce Revenue Cloud

Overview

This is a Model Context Protocol (MCP) server that provides AI assistants like Claude with direct access to Salesforce Revenue Cloud data and operations. Built with FastMCP, it exposes Salesforce functionality through standardized MCP tools that can be invoked by any MCP-compatible client.

Features

  • MCP Server: Standards-compliant Model Context Protocol server using FastMCP

  • Salesforce Revenue Cloud Integration: Direct access to Products, Price Books, Quotes, and Orders

  • Custom SOQL Queries: Execute arbitrary SOQL queries through the MCP protocol

  • AI Assistant Ready: Works seamlessly with Claude Desktop and other MCP clients

  • Secure Authentication: Uses Salesforce Session ID for authentication

Available MCP Tools

  • get_products(product_family) - Fetch products, optionally filtered by family/category

  • get_price_books() - Retrieve price books from Salesforce

  • get_quotes(limit) - Get quotes with configurable result limit

  • get_orders(limit) - Fetch orders with configurable result limit

  • query_salesforce(soql) - Execute custom SOQL queries

Prerequisites

Before you begin, ensure you have the following:

  • Python 3.8 or higher

  • Access to a Salesforce instance with API enabled

  • A valid Salesforce Session ID (see Configuration section for how to obtain)

  • Claude Desktop or another MCP-compatible client (optional, for testing)

  • pip for installing Python packages

Setup and Installation

  1. Clone the repository:

    git clone https://github.com/Bittersea1803/mcp_salesforce_revenue_cloud.git cd mcp_salesforce_revenue_cloud
  2. Create and activate a virtual environment:

    python -m venv .venv # On Windows .\.venv\Scripts\activate # On macOS/Linux source .venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Set up environment variables: Copy the example environment file and configure your credentials:

    cp .env.example .env # Edit .env and add your Salesforce Session ID and Domain URL
  5. Test the installation:

    # Test MCP server structure (no Salesforce connection required) python test_mcp_server.py # Test Salesforce authentication (requires valid credentials) python salesforce_auth.py

Quick Start

Once you have configured your .env file with valid Salesforce credentials:

# Run the MCP server python server.py

The server will start and listen for MCP protocol connections. To use it with Claude Desktop, see the "Using with Claude Desktop" section below.

Configuration

Environment Variables

Create a .env file in the project root with the following content:

# .env - Environment variables # Salesforce Session ID (see below for how to obtain) SALESFORCE_SESSION_ID="your_session_id_here" # Salesforce Domain URL SALESFORCE_DOMAIN_URL="https://your-instance.my.salesforce.com"

How to obtain a Salesforce Session ID:

  1. Log into your Salesforce org in a web browser

  2. Open Developer Console (Setup → Developer Console)

  3. Execute this Anonymous Apex code:

    System.debug('Session ID: ' + UserInfo.getSessionId());
  4. Copy the Session ID from the debug log

  5. Paste it into your .env file

Important Notes:

  • Session IDs expire after a period of inactivity (typically 2-8 hours depending on your org settings)

  • For SALESFORCE_DOMAIN_URL, use your actual Salesforce instance URL (e.g., https://mycompany.my.salesforce.com)

  • Ensure the .env file is added to your .gitignore to prevent committing credentials

Usage

Running the MCP Server

To run the MCP server directly:

python server.py

Or using the FastMCP CLI:

fastmcp run server.py

The server will start and listen for MCP protocol connections.

Using with Claude Desktop

To use this MCP server with Claude Desktop, add the following configuration to your Claude Desktop config file:

Location of config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Configuration:

{ "mcpServers": { "salesforce-revenue-cloud": { "command": "python", "args": [ "/absolute/path/to/mcp_salesforce_revenue_cloud/server.py" ], "env": { "SALESFORCE_SESSION_ID": "your_session_id_here", "SALESFORCE_DOMAIN_URL": "https://your-instance.my.salesforce.com" } } } }

Replace:

  • /absolute/path/to/mcp_salesforce_revenue_cloud/server.py with the actual path to server.py

  • your_session_id_here with your Salesforce Session ID

  • https://your-instance.my.salesforce.com with your Salesforce instance URL

After saving the config, restart Claude Desktop. The Salesforce Revenue Cloud tools will be available for Claude to use.

Example Queries

Once connected, you can ask Claude:

  • "Show me all products in Salesforce"

  • "Get products in the Solar Panels family"

  • "What price books are available?"

  • "Show me the latest quotes"

  • "Query Salesforce for SELECT Id, Name FROM Account LIMIT 5"

Project Structure

mcp_salesforce_revenue_cloud/ ├── server.py # Main MCP server (FastMCP) ├── salesforce_auth.py # Salesforce authentication module ├── requirements.txt # Python package dependencies ├── .env # Environment variables (DO NOT COMMIT) ├── .gitignore # Specifies intentionally untracked files ├── README.md # This file │ # Legacy Flask application (for reference) ├── app.py # Old Flask web application ├── handlers.py # Old handler functions ├── intents_config.yaml # Old intent definitions └── templates/ # Old HTML templates

Development

Testing Salesforce Connection

You can test the Salesforce authentication separately:

python salesforce_auth.py

This will verify your Session ID and display your API usage.

Adding New Tools

To add a new MCP tool, add a function decorated with @mcp.tool() in server.py:

@mcp.tool() def my_new_tool(param: str) -> str: """ Description of what this tool does. Args: param: Description of the parameter Returns: JSON string with results """ client = get_sf_client() # Your implementation here return json.dumps({"status": "success", "data": result})

Contributing

Contributions are welcome! If you'd like to contribute, please follow these steps:

  1. Fork the repository.

  2. Create a new branch (git checkout -b feature/your-feature-name).

  3. Make your changes.

  4. Commit your changes (git commit -m 'Add some feature').

  5. Push to the branch (git push origin feature/your-feature-name).

  6. Open a Pull Request.

Please ensure your code adheres to any existing coding standards and includes tests where appropriate.

License

This project is licensed under the [e.g., MIT License, Apache 2.0 License, etc.]. See the LICENSE file for details (if you add one).


This README is a template. Please update it with specific details about your project's functionality, setup, and usage as it evolves.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MarijanMiletic/mcp_salesforce_revenue_cloud'

If you have feedback or need assistance with the MCP directory API, please join our Discord server