logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

cdata-salesforce-mcp-adapter

Facilitates direct, natural language-driven querying of live Salesforce repositories via the Model Context Protocol (MCP) interface, eliminating the prerequisite for users to possess SQL expertise. This component bridges Large Language Models with Salesforce data structures (tables and fields) for immediate, context-aware data retrieval and query execution.

Author

cdata-salesforce-mcp-adapter logo

CDataSoftware

MIT License

Quick Info

GitHub GitHub Stars 0
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

cdatasoftwarecdataqueryingtools cdatasoftwarecdatasoftware salesforceserver cdata

CData Salesforce Connector for Model Context Protocol (MCP)

This utility establishes a read-only MCP endpoint targeting Salesforce data. For comprehensive data manipulation capabilities (CRUD operations) and a streamlined initial setup, please explore the fully featured, complimentary CData MCP Server for Salesforce (Beta release).

Core Functionality

We engineered this server specifically to empower Large Language Models (such as Claude Desktop) to issue queries against live data sourced from Salesforce. This capability is underpinned by the robust CData JDBC Driver for Salesforce.

The CData JDBC Driver transforms Salesforce endpoints into a standard relational SQL data model. Our server encapsulates this driver, exposing the Salesforce structure through a straightforward MCP layer. Consequently, sophisticated AI clients can access up-to-the-minute information simply by posing questions in plain English—SQL proficiency is unnecessary.

Deployment Instructions

  1. Obtain the Source Code: bash git clone https://github.com/cdatasoftware/salesforce-mcp-server-by-cdata.git cd salesforce-mcp-server-by-cdata
  2. Compile the Application: bash mvn clean install This step generates the executable JAR: CDataMCP-jar-with-dependencies.jar
  3. Acquire and Install the CData JDBC Driver for Salesforce: Download from: https://www.cdata.com/drivers/salesforce/download/jdbc
  4. License the JDBC Driver:
    • Navigate to the driver's installation lib directory (e.g., Windows: C:\Program Files\CData\CData JDBC Driver for Salesforce\ or Linux/Mac: /Applications/CData JDBC Driver for Salesforce/).
    • Execute the licensing command: java -jar cdata.jdbc.salesforce.jar --license
    • Input your credentials and use "TRIAL" or your official license key.
  5. Define Data Source Connection Configuration:
    • Launch the Connection String utility: java -jar cdata.jdbc.salesforce.jar
    • Configure the parameters necessary to connect to Salesforce and successfully 'Test Connection'. (OAuth connections require browser-based authentication).
    • Copy the finalized JDBC connection string.
  6. Create a Configuration Property File (e.g., salesforce.prp): This file dictates how the server interfaces with the data. Use the following structure, populating the necessary paths and connection details: env Prefix=salesforce_data_access ServerName=LiveSalesforceAdapter ServerVersion=2.1 DriverPath=PATH\TO\cdata.jdbc.salesforce.jar DriverClass=cdata.jdbc.salesforce.SalesforceDriver JdbcUrl=jdbc:salesforce:InitiateOAuth=GETANDREFRESH;ConnectionTimeout=30000; Tables= (Leave Tables empty to expose all accessible entities, or list specific table names.)

Configuration via Environment Variables

Alternatively, setup can be managed entirely through environment variables, ideal for containerized deployments or when embedding the CData JAR within the final build artifact.

Available Environment Variables

  • CDATA_JDBC_URL - Mandatory - The complete JDBC connection string.
  • CDATA_PREFIX - (Optional) Tool prefix for exposed services (default: "salesforce").
  • CDATA_DRIVER_CLASS - (Optional) Fully qualified name of the JDBC driver class.
  • CDATA_DRIVER_PATH - (Optional) File system location of the CData JAR (if omitted, bundled classes are used).
  • CDATA_TABLES - (Optional) A comma-delimited specification of entities to expose.
  • CDATA_LOG_FILE - (Optional) File path designated for server logging.

JAR Bundling Procedure

To integrate the CData driver classes directly into the final server executable: 1. Establish a lib directory at the project root. 2. Place the Salesforce JDBC JAR (e.g., cdata.jdbc.salesforce.jar) into the lib directory. 3. Execute the build: mvn clean install 4. The maven-shade-plugin handles merging the driver classes into CDataMCP-jar-with-dependencies.jar.

Execution Using Environment Variables

# Minimum required setup: define the connection URL
export CDATA_JDBC_URL="jdbc:salesforce:InitiateOAuth=GETANDREFRESH;"
java -jar CDataMCP-jar-with-dependencies.jar

# Or, specifying custom settings
export CDATA_PREFIX="sf_prod"
export CDATA_DRIVER_PATH="/absolute/path/to/cdata.jdbc.salesforce.jar" 
export CDATA_JDBC_URL="jdbc:salesforce:InitiateOAuth=GETANDREFRESH;"
java -jar CDataMCP-jar-with-dependencies.jar

Integration with AI Clients (e.g., Claude Desktop)

  1. Prepare the client configuration file (claude_desktop_config.json). Add a new entry under mcpServers using the structure below. If the file exists, append this definition.

    Configuration Examples (Using .prp file): ** Windows: json "{classname_dash}": { "command": "PATH\TO\java.exe", "args": [ "-jar", "PATH\TO\CDataMCP-jar-with-dependencies.jar", "PATH\TO\salesforce.prp" ] } Linux/Mac: json "{classname_dash}": { "command": "/PATH/TO/java", "args": [ "-jar", "/PATH/TO/CDataMCP-jar-with-dependencies.jar", "/PATH/TO/salesforce.prp" ] }

    Configuration Examples (Using Environment Variables): ** Windows: json "salesforce_env": { "command": "PATH\TO\java.exe", "args": ["-jar", "PATH\TO\CDataMCP-jar-with-dependencies.jar"], "env": { "CDATA_JDBC_URL": "jdbc:salesforce:InitiateOAuth=GETANDREFRESH;" } } Linux/Mac: json "salesforce_env": { "command": "/PATH/TO/java", "args": ["-jar", "/PATH/TO/CDataMCP-jar-with-dependencies.jar"], "env": { "CDATA_JDBC_URL": "jdbc:salesforce:InitiateOAuth=GETANDREFRESH;" } } 2. Deploy the configuration file to the client's designated directory (e.g., %APPDATA%\Claude\ on Windows). 3. Restart or refresh the client application to load the newly defined MCP service.

Important: Ensure the client application is completely shut down and reopened if the server does not appear immediately.

Executing the Adapter

To launch the adapter as a standalone service, use: ```bash java -jar /PATH/TO/CDataMCP-jar-with-dependencies.jar /PATH/TO/Salesforce.prp

> **Note:** Communication operates via standard input/output (`stdio`), limiting operation to clients running on the same host machine as the server process.

## Operational Use Case
Once the connection is established via the MCP Server, the integrated AI client gains access to native tooling for data inspection and interaction. Typically, explicit tool invocation is unnecessary; prompt the client with questions pertaining to the underlying Salesforce data.

* **Example Prompt:** "Analyze the relationship between closed-won revenue figures and the associated Account's primary industry classification."
* **Example Prompt:** "Quantify the volume of unresolved support cases currently assigned to the 'Tier 2 Engineering' queue."

### Exposed Tool Definitions
References to `{servername}` below should be substituted with the unique identifier used in the client configuration (e.g., `salesforce_data_access`).
* `{servername}_get_tables`: Fetches a comprehensive roster of accessible data entities. Follow up with `{servername}_get_columns` to detail attributes. Output is provided in CSV format, including a header row.
* `{servername}_get_columns`: Returns the attribute schema for a specified entity. Prerequisite: use `{servername}_get_tables` first. Output is provided in CSV format, including a header row.
* `{servername}_run_query`: Executes arbitrary SQL SELECT statements against the data source.

## JSON-RPC Payload Examples (for Scripted Calls)
These examples adhere to the JSON-RPC 2.0 standard for direct tooling interaction, bypassing the AI front-end.

#### Fetching Table Schema List
```json
{
    "jsonrpc": "2.0",
    "id": 101,
    "method": "tools/call",
    "params": {
        "name": "salesforce_data_access_get_tables",
        "arguments": {}
    }
}

Retrieving Column Definitions for 'Opportunity'

{
    "jsonrpc": "2.0",
    "id": 102,
    "method": "tools/call",
    "params": {
        "name": "salesforce_data_access_get_columns",
        "arguments": {
            "table":  "Opportunity"
        }
    }
}

Executing a Data Selection Query

{
    "jsonrpc": "2.0",
    "id": 103,
    "method": "tools/call",
    "params": {
        "name": "salesforce_data_access_run_query",
        "arguments": {
            "sql":  "SELECT Name, Amount FROM [Opportunity] WHERE StageName = 'Closed Won' AND CloseDate > '2024-01-01'"
        }
    }
}

Debugging Common Issues

  1. Server Not Appearing in Client: Confirm that the client application (e.g., Claude Desktop) was fully terminated and restarted.
  2. Data Retrieval Failures: Verify the connection string configuration within the .prp file or environment variables against the string generated by the CData Connection Utility.
  3. Connectivity Problems: For issues reaching the Salesforce instance, engage the CData Technical Assistance Group.
  4. General MCP Feedback: Share insights or report problems with the server operation by joining the CData User Forum.

This server implementation is governed by the MIT License terms. You are authorized to use, modify, and distribute this software according to the stipulations detailed in the accompanying LICENSE file.

Comprehensive Data Source Connectivity

This driver architecture supports integration with a vast array of external data repositories, including (but not limited to) the following:

Category Examples
CRM/Sales Salesforce, HubSpot, Zoho CRM, Pipedrive
Cloud Storage/Lakes Amazon S3, Google Cloud Storage, Azure Data Lake, Snowflake
Databases (SQL/NoSQL) PostgreSQL, MySQL, MongoDB, Cassandra, Oracle, SQL Server
Business Systems SAP, NetSuite, Workday, Jira, ServiceNow
Analytics/BI Google Analytics, Facebook Ads, BigQuery, Redshift
Spreadsheets/Files Excel Online, Google Sheets, CSV, JSON, Parquet

...and dozens of other platforms are supported via the CData connectivity framework.

See Also

`