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-mysql-mcp-service-gateway

Establishes a read-only Model Context Protocol (MCP) endpoint for interacting with MySQL databases, enabling Large Language Models (LLMs) to query schema details and execute arbitrary SQL SELECT statements via natural language interpretation.

Author

cdata-mysql-mcp-service-gateway logo

CDataSoftware

MIT License

Quick Info

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

Tags

databasesmysqlsqlcdatasoftware mysqlmysql mcpmysql databases

CData MySQL Data Access Proxy via MCP

This repository provides code for deploying a specialized MCP server that leverages the CData JDBC Driver for MySQL to expose live relational data to intelligent agents.

:warning: Restriction Notice: This implementation is strictly configured for read-only operations. For full CRUD (Create, Read, Update, Delete) functionality and a simpler deployment package, please investigate the Complimentary CData MCP Server for MySQL (Beta).

Core Objective

The primary goal is facilitating natural language data retrieval from MySQL instances by LLM clients (e.g., Claude Desktop). The architecture relies on wrapping the robust CData JDBC Driver for MySQL, which translates the underlying database structure into an accessible SQL model.

This wrapper abstracts the complexities of direct SQL by presenting data endpoints consumable through the MCP interface, allowing AI to pose questions directly against live data.

Deployment Procedure

Follow these steps to compile and configure the server component: 1. Source Retrieval: bash git clone https://github.com/cdatasoftware/mysql-mcp-server-by-cdata.git cd mysql-mcp-server-by-cdata

  1. Compilation (Maven Build): bash mvn clean install

    This process generates the executable JAR: CDataMCP-jar-with-dependencies.jar 3. Driver Acquisition: Obtain and install the CData JDBC Driver for MySQL from: https://www.cdata.com/drivers/mysql/download/jdbc 4. Driver Licensing: * Locate the driver installation directory (e.g., C:\Program Files\CData\CData JDBC Driver for MySQL\ or /Applications/CData JDBC Driver for MySQL/). * Execute the licensing utility: bash java -jar cdata.jdbc.mysql.jar --license

    • Provide required identification details and use "TRIAL" or your valid key.
    • Data Source Configuration:
    • Launch the connection utility: bash java -jar cdata.jdbc.mysql.jar

    • Use the interface to define your connection parameters (e.g., server address, credentials). Test the link. OAuth connections will require browser-based authentication.

    • Capture the resulting connection string upon successful validation.
    • Configuration File (.prp) Creation: Define a properties file (e.g., mysql.prp) specifying the MCP service metadata:
    • Prefix: Namespace prefix for the exposed tools.
    • ServerName: Human-readable identifier for the server.
    • ServerVersion: Version tag.
    • DriverPath: Absolute path to the CData JAR file.
    • DriverClass: Fully qualified name of the JDBC driver class (cdata.jdbc.mysql.MySQLDriver).
    • JdbcUrl: The connection string copied in the previous step.
    • Tables: Optional. Specify table names to expose; leave empty to permit access to all available tables. env Prefix=mysql ServerName=CDataMySQL ServerVersion=1.0 DriverPath=PATH\TO\cdata.jdbc.mysql.jar DriverClass=cdata.jdbc.mysql.MySQLDriver JdbcUrl=jdbc:mysql:InitiateOAuth=GETANDREFRESH; Tables=

Integrating with LLM Clients (e.g., Claude Desktop)

To activate the connection within the client application, you must augment its configuration file (claude_desktop_config.json): 1. Configuration Modification: Add the service definition to the mcpServers object, substituting placeholders with actual file paths:

  **Windows Client Configuration Snippet:**

  {
    "mcpServers": {
      "{classname_dash}": {
        "command": "PATH\TO\java.exe",
        "args": [
          "-jar",
          "PATH\TO\CDataMCP-jar-with-dependencies.jar",
          "PATH\TO\mysql.prp"
        ]
      },
      ...
    }
  }


  **Linux/Mac Client Configuration Snippet:**

  {
    "mcpServers": {
      "{classname_dash}": {
        "command": "/PATH/TO/java",
        "args": [
          "-jar",
          "/PATH/TO/CDataMCP-jar-with-dependencies.jar",
          "/PATH/TO/mysql.prp"
        ]
      },
      ...
    }
  }
  1. Configuration Deployment: Copy the updated JSON configuration to the client's application data directory: Windows Deployment: bash cp C:\PATH\TO\claude_desktop_config.json %APPDATA%\Claude\claude_desktop_config.json

    Linux/Mac Deployment: bash cp /PATH/TO/claude_desktop_config.json /Users/{user}/Library/Application\ Support/Claude/claude_desktop_config.json'

  2. Client Refresh: Restart or relaunch the client application to load the new tool definitions.

Direct Server Execution

Alternatively, the MCP service can be initiated independently using: bash java -jar /PATH/TO/CDataMCP-jar-with-dependencies.jar /PATH/TO/Salesforce.prp

Constraint: This server relies on standard input/output (stdio) communication, mandating that the invoking client must execute on the same host machine as the server process.

Operational Overview

Once integrated, the AI agent can utilize implied actions against the data source by formulating requests in plain language, such as: * "Determine the relationship between closed sales and account sector classifications." * "Count active support incidents assigned to the OPERATIONS group." * "List all scheduled appointments for the current day."

Available Agent Capabilities

Tool names below use {servername} as a substitution for the prefix defined in the .prp file (e.g., mysql_get_tables). * {servername}_get_tables: Fetches the complete list of accessible database entities. Consult {servername}_get_columns for schema details. Output is formatted as CSV. * {servername}_get_columns: Retrieves column definitions for a specified table, also outputted in CSV format. * {servername}_run_query: Executes a provided SQL SELECT statement directly against the data source.

JSON-RPC Request Schemas (For Scripted Interaction)

If bypassing the AI client for direct programmatic calls conforming to JSON-RPC 2.0:

Invoking mysql_get_tables

{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "mysql_get_tables", "arguments": {} } }

Invoking mysql_get_columns (Example: Table 'Account')

{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "mysql_get_columns", "arguments": { "table": "Account" } } }

Invoking mysql_run_query (Example: Selection with Filter)

{ "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "mysql_run_query", "arguments": { "sql": "SELECT * FROM [Account] WHERE [IsDeleted] = true" } } }

Debugging Guidance

  1. Visibility Check: If the server does not appear in the client application, ensure the client process was completely terminated (use Task Manager/Activity Monitor).
  2. Data Retrieval Failure: Verify that the connection string copied into the .prp file is precise, as generated by the Connection String builder utility.
  3. Connection Errors: For issues establishing links to the underlying MySQL instance, engage the CData Technical Assistance Portal.
  4. MCP Tooling Feedback: Direct input regarding the server's operation or functionality should be submitted to the CData User Community.

Licensing

This server component is distributed under the permissive MIT License. Refer to the included LICENSE file for complete terms regarding usage, modification, and distribution.

Comprehensive Data Source Compatibility

This driver infrastructure supports connectivity to an extensive array of enterprise systems, including (but not limited to): * CRM/ERP Systems: Salesforce, SAP, Oracle Financials Cloud, Microsoft Dynamics suites. * Cloud Data Warehouses: Snowflake, BigQuery, Redshift. * File/Object Storage: Amazon S3, Google Drive, SharePoint, Box. * Databases: PostgreSQL, SQL Server, Oracle, Cassandra, Hive, MongoDB. * ... and dozens of other specialized connectors.

See Also

`