cdata-mcp-gateway-for-salesforce
Provides an interface layer for large language models to execute natural language queries against live Salesforce records, eliminating the necessity for direct SQL proficiency. This solution facilitates AI-driven data retrieval, schema introspection, and query execution against Salesforce instances.
Author

CDataSoftware
Quick Info
Actions
Tags
CData Model Context Protocol (MCP) Server Implementation for Salesforce
:warning: This specific deployment functions strictly for read operations. For a comprehensive data manipulation suite (CRUD operations and advanced actions) coupled with a more streamlined initial configuration, consider exploring our beta offering: CData MCP Server for Salesforce (Free).
Objective
This read-only MCP conduit was engineered to empower language models (such as Claude Desktop) with the capability to interrogate active data residing within Salesforce. This connectivity is underpinned by the robust CData JDBC Driver for Salesforce.
The CData JDBC Driver acts by abstracting Salesforce structures into a conventional relational SQL framework.
This server component encapsulates that driver, exposing Salesforce assets through a straightforward MCP schema, thereby permitting LLMs to source real-time insights merely by posing conversational queries—no SQL syntax required.
Deployment Instructions
-
Clone the Repository: bash git clone https://github.com/cdatasoftware/salesforce-mcp-server-by-cdata.git cd salesforce-mcp-server-by-cdata
-
Compile the Server Artifact: bash mvn clean install
This generates the executable JAR:
CDataMCP-jar-with-dependencies.jar3. Acquire and Install the CData JDBC Driver for {source}: https://www.cdata.com/drivers/salesforce/download/jdbc 4. License the JDBC Driver: * Navigate to thelibdirectory within the driver's installation path (typical locations): * (Windows)C:\Program Files\CData\CData JDBC Driver for Salesforce\* (Mac/Linux)/Applications/CData JDBC Driver for Salesforce/* Execute the licensing utility:java -jar cdata.jdbc.salesforce.jar --license* Input your identification details and use "TRIAL" or your official license key. 5. Configure Data Source Connection: * Launch the Connection String utility:java -jar cdata.jdbc.salesforce.jar- Define the connection parameters and validate with "Test Connection".
Important: OAuth-based sources mandate interactive browser authentication.
- Upon validation success, capture and retain the resulting connection string.
- Define the Configuration File (
.prp): - Construct a properties file (e.g.,
salesforce.prp) containing the necessary metadata: - Prefix: A namespace tag for the exposed capabilities.
- ServerName: A unique label for this service endpoint.
- ServerVersion: The version identifier for the server.
- DriverPath: Absolute location of the acquired JDBC driver JAR.
- DriverClass: The fully qualified name of the JDBC Driver implementation (e.g.,
cdata.jdbc.salesforce.SalesforceDriver). - JdbcUrl: The connection string obtained in step 5.
- Tables: Specify target tables; leave empty (
Tables=) to grant access to the entire schema. env 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=
- Define the connection parameters and validate with "Test Connection".
Configuration via Environment Variables (Alternative)
Environment variables supersede the .prp file method, making this approach ideal for containerized deployment or when embedding the CData JAR within the primary application artifact.
Environment Variable Mapping
CDATA_JDBC_URL- Mandatory - The JDBC connection URI.CDATA_PREFIX- (Optional) Defines the namespace prefix (defaults to "salesforce").CDATA_DRIVER_CLASS- (Optional) Driver class name (defaults tocdata.jdbc.salesforce.SalesforceDriverif bundled).CDATA_DRIVER_PATH- (Optional) Path to the CData JAR (if not using bundled classes).CDATA_TABLES- (Optional) A comma-delimited enumeration of tables to expose.CDATA_LOG_FILE- (Optional) Specifies the output file path for logging.
Embedding the CData JAR
To integrate the driver directly:
1. Establish a lib subdirectory within the project root.
2. Place the CData JDBC driver JAR (e.g., cdata.jdbc.salesforce.jar) into this lib folder.
3. Execute the build: mvn clean install
4. The maven-shade-plugin will automatically merge the driver classes into CDataMCP-jar-with-dependencies.jar.
Execution Using Environment Variables
bash
Minimum setup (requires only JDBC URL)
export CDATA_JDBC_URL="jdbc:salesforce:InitiateOAuth=GETANDREFRESH;" java -jar CDataMCP-jar-with-dependencies.jar
Custom configuration example
export CDATA_PREFIX="myprefix" export CDATA_DRIVER_PATH="/path/to/cdata.jdbc.salesforce.jar" # Omit if bundled export CDATA_DRIVER_CLASS="cdata.jdbc.salesforce.SalesforceDriver" export CDATA_JDBC_URL="jdbc:salesforce:InitiateOAuth=GETANDREFRESH;" java -jar CDataMCP-jar-with-dependencies.jar
Integrating with Claude Desktop
-
Modify/Create the Configuration File (
claude_desktop_config.json) to register the new MCP server entry. Append the configuration object to the existingmcpServersstructure.Windows Integration Snippet
{ "mcpServers": { "{classname_dash}": { "command": "PATH\TO\java.exe", "args": [ "-jar", "PATH\TO\CDataMCP-jar-with-dependencies.jar", "PATH\TO\salesforce.prp" ] }, ... } }
Linux/Mac Integration Snippet
{ "mcpServers": { "{classname_dash}": { "command": "/PATH/TO/java", "args": [ "-jar", "/PATH/TO/CDataMCP-jar-with-dependencies.jar", "/PATH/TO/salesforce.prp" ] }, ... } }
Using Environment Variables (Windows Example)
{ "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 Example)
{ "mcpServers": { "salesforce": { "command": "/PATH/TO/java", "args": [ "-jar", "/PATH/TO/CDataMCP-jar-with-dependencies.jar" ], "env": { "CDATA_JDBC_URL": "jdbc:salesforce:InitiateOAuth=GETANDREFRESH;" } } } }
If necessary, relocate the resulting configuration file to the client's designated directory: Windows Directory Relocation bash cp C:\PATH\TO\claude_desktop_config.json %APPDATA%\Claude\claude_desktop_config.json
Linux/Mac Directory Relocation bash cp /PATH/TO/claude_desktop_config.json /Users/{user}/Library/Application\ Support/Claude/claude_desktop_config.json'
-
Initiate a full restart or refresh of your client application (Claude Desktop) to register the new MCP endpoint.
Tip: If the server remains invisible in Claude Desktop, ensure the application process is completely terminated (check Task Manager/Activity Monitor).
Server Execution
To launch the MCP gateway independently: bash java -jar /PATH/TO/CDataMCP-jar-with-dependencies.jar /PATH/TO/Salesforce.prp
Constraint: The server communicates via
stdiopipes, restricting its use to clients executing on the same host machine as the server process.
Operational Details
Once the MCP server is correctly integrated, the consuming AI client gains access to built-in capabilities for schema discovery and data interaction. Explicit tool invocation is generally not required; the client should be able to satisfy data-related inquiries directly. Examples of effective natural language prompts include: * "Analyze the relationship between closed-won opportunities and the associated account's sector classification." * "Count the volume of unresolved incidents within the 'SUPPORT' organizational unit." * "List all scheduled appointments I possess for the current day."
The complete set of exposed capabilities and their functional definitions are detailed below. In these definitions, {servername} maps to the identifier specified in the configuration (e.g., {classname_dash}).
Available Tools & Descriptions
{servername}_get_tables- Fetches a delimited list of accessible schemas/tables from the data source. Follow this with{servername}_get_columnsto enumerate fields within a specific table. Output is CSV format, starting with header definitions.{servername}_get_columns- Retrieves the field definitions for a designated table. Reference{servername}_get_tablesbeforehand to identify valid table names. Output is CSV format, starting with header definitions.{servername}_run_query- Executes an arbitrary SQL SELECT command against the data layer.
JSON-RPC Invocation Examples
For programmatic interaction (bypassing an AI client like Claude) conforming to the JSON-RPC 2.0 specification, use the following payload structures when calling the server methods:
{servername}_get_tables Request Example
{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "salesforce_get_tables", "arguments": {} } }
{servername}_get_columns Request Example
{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "salesforce_get_columns", "arguments": { "table": "Account" } } }
{servername}_run_query Request Example
{ "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "salesforce_run_query", "arguments": { "sql": "SELECT * FROM [Account] WHERE [IsDeleted] = true" } } }
Troubleshooting Guidelines
- If Claude Desktop fails to list your CData MCP Server, ensure you have forcibly closed and restarted the client (verify termination via system monitors).
- If data retrieval fails, re-verify the connection setup. Use the Connection String utility to confirm validity, then ensure the string is correctly ported to the configuration file (either
.prpor environment variables). - For connectivity issues to the data source itself, please engage the CData Support Team.
- For technical issues specific to the MCP server functionality or to provide feature suggestions, visit the CData Community.
Licensing Information
This MCP server component is distributed under the permissive MIT License. Modification, utilization, and redistribution are permissible, subject to the terms outlined in the accompanying LICENSE file.
Comprehensive Data Source Connectivity List
| Source Category | Supported Systems | Source Category | Supported Systems |
|---|---|---|---|
| CRM/ERP | Access, Act CRM, Acumatica, Dynamics 365, NetSuite, SAP, Workday | Cloud Storage/Data Lakes | Amazon S3, Azure Data Lake Storage, Google Cloud Storage, HDFS |
| Marketing Automation | Act-On, MailChimp, Marketo, Pardot, Eloqua | Productivity/Collaboration | Asana, Box, Confluence, Dropbox, GitHub, Jira, SharePoint, Slack, Trello |
| Databases (SQL/NoSQL) | Cassandra, CockroachDB, MongoDB, MySQL, PostgreSQL, Redshift, SQL Server, Snowflake | Web/APIs | OData, REST, GraphQL, JSON, XML |
| Analytics/BI | BigQuery, Databricks, Tableau CRM Analytics | Financial/Accounting | QuickBooks Online, Xero, Sage Cloud Accounting |
| ... | ... | ... | ... |
| A partial list; refer to the documentation for the complete matrix of over 300 supported connectors. |
WIKIPEDIA NOTE on XMLHttpRequest (XHR): XMLHttpRequest is a JavaScript object API designed to issue HTTP requests between a web application running in a browser and a remote server. Its primary benefit is enabling background data exchange after the initial page load, a cornerstone of Asynchronous JavaScript and XML (Ajax) development. Before XHR, server interaction typically involved full page refreshes via standard form submissions or hyperlinks.
== Historical Context ==
The foundation for XHR originated with Microsoft developers in 2000, first appearing in Internet Explorer 5 (1999) using proprietary ActiveXObject identifiers. By IE 7 (2006), the standardized XMLHttpRequest identifier became universally adopted across major browser engines, including Mozilla's Gecko (2002), Safari (2004), and Opera (2005).
=== Standardization Progression ===
The W3C released the initial Working Draft for XMLHttpRequest in 2006. Level 2 followed in 2008, introducing crucial features like event progress tracking, cross-site request support, and binary stream handling. By late 2011, Level 2 features were merged into the primary specification. Development transitioned to WHATWG in 2012, which now maintains the specification as a living document using Web IDL.
== Standard Operation Pattern == Utilizing XMLHttpRequest generally involves a sequence of programming steps:
- Instantiate the object via its constructor.
- Invoke the
open()method to define the request method (GET/POST), target URI, and whether the operation will be synchronous or asynchronous. - For asynchronous calls, assign a callback function (event listener) to handle state changes.
- Initiate the transmission using the
send()method (optionally including request payload data). - Process the response within the listener. Upon reaching state 4 ("done"), the received data is typically accessible via the
responseTextproperty, though advanced parsing can process data incrementally or directly into JavaScript objects from formats like JSON. Requests can also be canceled or time out if necessary.
