Provides direct access to Salesforce Revenue Cloud data and operations, including tools for managing products, price books, quotes, orders, and executing custom SOQL queries.
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/categoryget_price_books()- Retrieve price books from Salesforceget_quotes(limit)- Get quotes with configurable result limitget_orders(limit)- Fetch orders with configurable result limitquery_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)
pipfor installing Python packages
Setup and Installation
Clone the repository:
git clone https://github.com/Bittersea1803/mcp_salesforce_revenue_cloud.git cd mcp_salesforce_revenue_cloudCreate and activate a virtual environment:
python -m venv .venv # On Windows .\.venv\Scripts\activate # On macOS/Linux source .venv/bin/activateInstall dependencies:
pip install -r requirements.txtSet 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 URLTest 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:
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:
How to obtain a Salesforce Session ID:
Log into your Salesforce org in a web browser
Open Developer Console (Setup → Developer Console)
Execute this Anonymous Apex code:
System.debug('Session ID: ' + UserInfo.getSessionId());Copy the Session ID from the debug log
Paste it into your
.envfile
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
.envfile is added to your.gitignoreto prevent committing credentials
Usage
Running the MCP Server
To run the MCP server directly:
Or using the FastMCP CLI:
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.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Configuration:
Replace:
/absolute/path/to/mcp_salesforce_revenue_cloud/server.pywith the actual path to server.pyyour_session_id_herewith your Salesforce Session IDhttps://your-instance.my.salesforce.comwith 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
Development
Testing Salesforce Connection
You can test the Salesforce authentication separately:
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:
Contributing
Contributions are welcome! If you'd like to contribute, please follow these steps:
Fork the repository.
Create a new branch (
git checkout -b feature/your-feature-name).Make your changes.
Commit your changes (
git commit -m 'Add some feature').Push to the branch (
git push origin feature/your-feature-name).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.