CData Salesforce MCP Server
A read-only MCP server by CData that allows LLMs to query live Salesforce data. Requires the CData JDBC Driver for Salesforce.
salesforce-mcp-server-by-cdata
CData's Model Context Protocol (MCP) Server for Salesforce
:heavy_exclamation_mark: This project builds a local, read-only MCP server. For fully remote MCP access, check out the first managed MCP platform: CData Connect AI. For locally hosted, full read, write, update, delete, and action capabilities and a simplified setup, check out our CData MCP Server for Salesforce.
Purpose
We created this read-only MCP Server to allow LLMs (like Claude Desktop) to query live data Salesforce supported by the CData JDBC Driver for Salesforce.
CData JDBC Driver connects to Salesforce by exposing them as relational SQL models.
This server wraps that driver and makes Salesforce data available through a simple MCP interface, so LLMs can retrieve live information by asking natural language questions — no SQL required.
Setup Guide
- Clone the repository:
git clone https://github.com/cdatasoftware/salesforce-mcp-server-by-cdata.git cd salesforce-mcp-server-by-cdata - Build the server:
This creates the JAR file: CDataMCP-jar-with-dependencies.jarmvn clean install - Download and install the CData JDBC Driver for {source}: https://www.cdata.com/drivers/salesforce/download/jdbc
- License the CData JDBC Driver:
- Navigate to the
libfolder in the installation directory, typically:- (Windows)
C:\Program Files\CData\CData JDBC Driver for Salesforce\ - (Mac/Linux)
/Applications/CData JDBC Driver for Salesforce/
- (Windows)
- Run the command
java -jar cdata.jdbc.salesforce.jar --license - Enter your name, email, and "TRIAL" (or your license key).
- Navigate to the
- Configure your connection to the data source (Salesforce as an example):
-
Run the command
java -jar cdata.jdbc.salesforce.jarto open the Connection String utility. -
Configure the connection string and click "Test Connection"
Note: If the data sources uses OAuth, you will need to authenticate in your browser.
-
Once successful, copy the connection string for use later.
-
- Create a
.prpfile for your JDBC connection (e.g.salesforce.prp) using the following properties and format:- Prefix - a prefix to be used for the tools exposed
- ServerName - a name for your server
- ServerVersion - a version for your server
- DriverPath - the full path to the JAR file for your JDBC driver
- DriverClass - the name of the JDBC Driver Class (e.g. cdata.jdbc.salesforce.SalesforceDriver)
- JdbcUrl - the JDBC connection string to use with the CData JDBC Driver to connect to your data (copied from above)
- Tables - leave blank to access all data, otherwise you can explicitly declare the tables you wish to create access for
Prefix=salesforce ServerName=CDataSalesforce ServerVersion=1.0 DriverPath=PATH\TO\cdata.jdbc.salesforce.jar DriverClass=cdata.jdbc.salesforce.SalesforceDriver JdbcUrl=jdbc:salesforce:InitiateOAuth=GETANDREFRESH; Tables=
Alternative: Using Environment Variables
Instead of using a .prp file, you can configure the server using environment variables. This is useful for containerized deployments or when you want to bundle the CData JAR inside the compiled JAR.
Environment Variables
CDATA_JDBC_URL- Required - The JDBC connection stringCDATA_PREFIX- (Optional) The prefix for exposed tools (defaults to "salesforce")CDATA_DRIVER_CLASS- (Optional) The JDBC driver class name (defaults to "cdata.jdbc.salesforce.SalesforceDriver" when using bundled JAR)CDATA_DRIVER_PATH- (Optional) Path to the CData JAR file (if not specified, uses bundled classes)CDATA_TABLES- (Optional) Comma-separated list of tables to exposeCDATA_LOG_FILE- (Optional) Path to log file
Bundling the CData JAR
To include the CData JAR in your compiled JAR:
- Create a
libdirectory in your project root - Copy the CData JDBC driver JAR (e.g.,
cdata.jdbc.salesforce.jar) into thelibdirectory - Build the project with
mvn clean install - The CData JDBC driver classes will be unpacked and included directly in
CDataMCP-jar-with-dependencies.jar
Note: The maven-shade-plugin will automatically extract and include all classes from the CData JAR during the build process.
Running with Environment Variables
# Minimal configuration - only JDBC URL is required
export CDATA_JDBC_URL="jdbc:salesforce:InitiateOAuth=GETANDREFRESH;"
java -jar CDataMCP-jar-with-dependencies.jar
# Or with custom configuration
export CDATA_PREFIX="myprefix"
export CDATA_DRIVER_PATH="/path/to/cdata.jdbc.salesforce.jar" # Only needed if not using bundled JAR
export CDATA_DRIVER_CLASS="cdata.jdbc.salesforce.SalesforceDriver" # Only needed if not using bundled JAR
export CDATA_JDBC_URL="jdbc:salesforce:InitiateOAuth=GETANDREFRESH;"
java -jar CDataMCP-jar-with-dependencies.jar
Using the Server with Claude Desktop
-
Create the config file for Claude Desktop ( claude_desktop_config.json) to add the new MCP server, using the format below. If the file already exists, add the entry to the
mcpServersin the config file.Windows
{ "mcpServers": { "{classname_dash}": { "command": "PATH\\TO\\java.exe", "args": [ "-jar", "PATH\\TO\\CDataMCP-jar-with-dependencies.jar", "PATH\\TO\\salesforce.prp" ] }, ... } }Linux/Mac
{ "mcpServers": { "{classname_dash}": { "command": "/PATH/TO/java", "args": [ "-jar", "/PATH/TO/CDataMCP-jar-with-dependencies.jar", "/PATH/TO/salesforce.prp" ] }, ... } }Using Environment Variables (Windows)
{ "mcpServers": { "salesforce": { "command": "PATH\\TO\\java.exe", "args": [ "-jar", "PATH\\TO\\CDataMCP-jar-with-dependencies.jar" ], "env": { "CDATA_JDBC_URL": "jdbc:salesforce:InitiateOAuth=GETANDREFRESH;" } } } }Using Environment Variables (Linux/Mac)
{ "mcpServers": { "salesforce": { "command": "/PATH/TO/java", "args": [ "-jar", "/PATH/TO/CDataMCP-jar-with-dependencies.jar" ], "env": { "CDATA_JDBC_URL": "jdbc:salesforce:InitiateOAuth=GETANDREFRESH;" } } } }If needed, copy the config file to the appropriate directory (Claude Desktop as the example). Windows
cp C:\PATH\TO\claude_desktop_config.json %APPDATA%\Claude\claude_desktop_config.jsonLinux/Mac
cp /PATH/TO/claude_desktop_config.json /Users/{user}/Library/Application\ Support/Claude/claude_desktop_config.json' -
Run or refresh your client (Claude Desktop).
Note: You may need to fully exit or quit your Claude Desktop client and re-open it for the MCP Servers to appear.
Running the Server
- Run the follow the command to run the MCP Server on its own
java -jar /PATH/TO/CDataMCP-jar-with-dependencies.jar /PATH/TO/Salesforce.prp
Note: The server uses
stdioso can only be used with clients that run on the same machine as the server.
Usage Details
Once the MCP Server is configured, the AI client will be able to use the built-in tools to read, write, update, and delete the underlying data. In general, you do not need to call the tools explicitly. Simply ask the client to answer questions about the underlying data system. For example:
- "What is the correlation between my closed won opportunities and the account industry?"
- "How many open tickets do I have in the SUPPORT project?"
- "Can you tell me what calendar events I have today?"
The list of tools available and their descriptions follow:
Tools & Descriptions
In the definitions below, {servername} refers to the name of the MCP Server in the config file (e.g. {classname_dash} above).
{servername}_get_tables- Retrieves a list of tables available in the data source. Use the{servername}_get_columnstool to list available columns on a table. The output of the tool will be returned in CSV format, with the first line containing column headers.{servername}_get_columns- Retrieves a list of columns for a table. Use the{servername}_get_tablestool to get a list of available tables. The output of the tool will be returned in CSV format, with the first line containing column headers.{servername}_run_query- Execute a SQL SELECT query
JSON-RPC Request Examples
If you are scripting out the requests sent to the MCP Server instead of using an AI Client (e.g. Claude), then you can refer to the JSON payload examples below – following the JSON-RPC 2.0 specification - when calling the available tools.
salesforce_get_tables
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "salesforce_get_tables",
"arguments": {}
}
}
salesforce_get_columns
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "salesforce_get_columns",
"arguments": {
"table": "Account"
}
}
}
salesforce_run_query
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "salesforce_run_query",
"arguments": {
"sql": "SELECT * FROM [Account] WHERE [IsDeleted] = true"
}
}
}
Troubleshooting
- If you cannot see your CData MCP Server in Claude Desktop, be sure that you have fully quit Claude Desktop (Windows: use the Task Manager, Mac: use the Activity Monitor)
- If Claude Desktop is unable to retrieve data, be sure that you have configured your connection properly. Use the Connection String builder to create the connection string (see above) and copy the connection string into the property (.prp) file.
- If you are having trouble connecting to your data source, contact the CData Support Team.
- If you are having trouble using the MCP server, or have any other feedback, join the CData Community.
License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
All Supported Sources
Related Servers
Kusto MCP Server
Provides access to Azure Data Explorer (ADX) clusters, requiring Azure credentials for configuration.
Snowflake
Snowflake database integration with read/write capabilities and insight tracking
CData Active Directory
MCP Server for Microsoft Active Directory, powered by CData.
PostgreSQL MCP Server
An MCP server for exploring and querying PostgreSQL databases.
SET-MCP
Access financial statements, including income, balance sheets, and cash flow, for companies listed on the Securities Exchange of Thailand (SET).
Qixin API Service
Access comprehensive enterprise data from the Qixin Open Platform APIs.
CData SAP HANA XS Advanced Server
A read-only MCP server for SAP HANA XS Advanced, powered by the CData JDBC Driver.
MySQL Server
A server for performing MySQL database operations.
KOSPI/KOSDAQ Stock Server
Provides KOSPI/KOSDAQ stock data, including ticker lookup, OHLCV, market capitalization, and fundamental data.
Supabase
Access and manage your Supabase projects through the Model Context Protocol (MCP).