MCP Salesforce Revenue Cloud
Provides AI assistants with direct access to Salesforce Revenue Cloud data and operations, enabling retrieval of products, price books, quotes, orders, and execution of custom SOQL queries through natural language.
README
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_cloud -
Create and activate a virtual environment:
python -m venv .venv # On Windows .\.venv\Scripts\activate # On macOS/Linux source .venv/bin/activate -
Install dependencies:
pip install -r requirements.txt -
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 -
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:
- 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:
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.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
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:
- 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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.