cdata-dynamics365-mcp-gateway
Provides a read-only Model Context Protocol (MCP) endpoint for interacting with live Microsoft Dynamics 365 datasets. This service abstracts the underlying complexity, enabling Large Language Models (LLMs) to query enterprise data using natural language queries, entirely bypassing the need for direct SQL expertise. It leverages the CData JDBC Driver technology to ensure timely data retrieval and up-to-date insights.
Author

CDataSoftware
Quick Info
Actions
Tags
CData Dynamics 365 Read-Only Data Access Server (via MCP)
This repository hosts a specific implementation of a Model Context Protocol (MCP) server dedicated to exposing Microsoft Dynamics 365 data.
:warning: Crucial Distinction: This artifact provides strictly read-only data interaction capabilities. For comprehensive CRUD (Create, Read, Update, Delete) operations, transactional support, and a streamlined deployment experience, please examine the complimentary, fully-featured CData MCP Server for Dynamics 365 (Beta release).
Core Objective
The primary goal of this implementation is to equip sophisticated AI agents (such as Claude Desktop) with the ability to interrogate active data residing within Dynamics 365 environments. This accessibility is achieved by utilizing the robust CData JDBC Driver for Dynamics 365 as the foundational connector.
The CData JDBC Driver serves to map the complex structure of Dynamics 365 entities into a standardized, relational (SQL-like) schema view. Our server component encapsulates this driver, presenting the Dynamics 365 information via a straightforward MCP interface. Consequently, LLMs can derive contemporary intelligence simply by posing conversational questions, eliminating any requirement for formulating database queries.
Deployment Instructions
Follow these steps to compile and configure the server instance:
-
Acquire Source Code: bash git clone https://github.com/cdatasoftware/dynamics-365-mcp-server-by-cdata.git cd dynamics-365-mcp-server-by-cdata
-
Build Artifact: Execute the Maven build process: bash mvn clean install
This generates the executable JAR:
CDataMCP-jar-with-dependencies.jar3. Install JDBC Driver: Download and install the requisite CData JDBC Driver for Dynamics 365 from: https://www.cdata.com/drivers/dynamics365/download/jdbc 4. License the Driver: Activate the installed driver: * Locate the driver's installation directory, typically: * (Windows)C:\Program Files\CData\CData JDBC Driver for Dynamics 365\* (Mac/Linux)/Applications/CData JDBC Driver for Dynamics 365/* Execute the licensing utility: bash java -jar cdata.jdbc.dyanmics365.jar --license- Input your credentials and use "TRIAL" or your acquired license key.
- Define Data Source Connection:
-
Launch the connection utility via the driver JAR: bash java -jar cdata.jdbc.dyanmics365.jar
-
Configure the necessary connection parameters (using Dynamics 365 credentials) and validate connectivity using "Test Connection".
Note: If OAuth is employed, browser-based authentication will be necessary.
- Upon success, capture the resulting JDBC connection string.
- Create Configuration File (
.prp): Define an execution profile file (e.g.,dynamics-365-connector.prp) specifying the server's operational parameters: - Prefix: A short identifier for exposed functionalities.
- ServerName: A descriptive name for this service instance.
- ServerVersion: The version identifier.
- DriverPath: Absolute path to the installed JDBC driver JAR file.
- DriverClass: The fully qualified name of the JDBC driver class (e.g.,
cdata.jdbc.dyanmics365.Dyanmics365Driver). - JdbcUrl: The connection string obtained in the previous step.
- Tables: Specify table names to expose, or leave empty (
Tables=) to permit access to all available data entities. env Prefix=d365_data_reader ServerName=CDataDynamics365Gateway ServerVersion=1.0.1 DriverPath=ABSOLUTE/PATH/TO/cdata.jdbc.dyanmics365.jar DriverClass=cdata.jdbc.dyanmics365.Dyanmics365Driver JdbcUrl=jdbc:dyanmics365:InitiateOAuth=GETANDREFRESH;...[Your Full Connection String]... Tables=
Integrating with AI Clients (e.g., Claude Desktop)
To enable the AI environment to recognize and utilize this data source, you must augment its configuration file (claude_desktop_config.json):
-
Generate Client Configuration Entry: Add a new entry under the
mcpServersobject in your client's configuration file. Use a URL-safe version of your class name as the key (e.g.,cdata-dynamics365-gateway).Windows Example:
{ "mcpServers": { "cdata-dynamics365-gateway": { "command": "C:\PATH\TO\java.exe", "args": [ "-jar", "C:\PATH\TO\CDataMCP-jar-with-dependencies.jar", "C:\PATH\TO\dynamics-365-connector.prp" ] }, ... // Other existing servers } }
Linux/Mac Example:
{ "mcpServers": { "cdata-dynamics365-gateway": { "command": "/usr/bin/java", "args": [ "-jar", "/opt/mcp/CDataMCP-jar-with-dependencies.jar", "/etc/configs/dynamics-365-connector.prp" ] }, ... // Other existing servers } }
-
Deploy Configuration: Ensure this modified configuration file resides in the client's expected location (e.g., Windows AppData or Mac Application Support directory).
- Reload Client: Restart or refresh the AI client application to load the newly defined MCP server endpoint.
Direct Server Execution Mode
Alternatively, the server can be launched independently, communicating via standard input/output (stdio):
bash java -jar /ABSOLUTE/PATH/TO/CDataMCP-jar-with-dependencies.jar /ABSOLUTE/PATH/TO/dynamics-365-connector.prp
Constraint: This direct method confines the server and client usage to the same local machine.
Querying Data via AI Interface
Once the gateway is active and exposed to the LLM client, users can direct queries about the underlying Dynamics 365 data without crafting SQL. The system translates the request into one of the provided low-level tools. Example conversational prompts include:
- "What is the trend in revenue growth across different customer segments this quarter?"
- "List all active sales opportunities exceeding $50,000 associated with the 'Technology' industry."
- "Summarize today's scheduled service appointments."
Available Tools & Signatures
In the tool definitions below, {gateway_prefix} corresponds to the Prefix defined in your .prp file (e.g., d365_data_reader).
{gateway_prefix}_get_tables: Queries the data source schema to return a complete list of accessible entities. Follow this with{gateway_prefix}_get_columnsto inspect entity attributes. Output is standardized CSV format.{gateway_prefix}_get_columns: Retrieves the attribute list (schema) for a specified entity (table). Requires the entity name as an argument.{gateway_prefix}_run_query: Permits the execution of raw SQLSELECTstatements against the data source.
Programmatic Tool Invocation Examples (JSON-RPC 2.0)
For scripting or direct testing against the MCP endpoint, use these JSON payloads:
Requesting Entity List (e.g., d365_data_reader_get_tables)
{ "jsonrpc": "2.0", "id": 101, "method": "tools/call", "params": { "name": "d365_data_reader_get_tables", "arguments": {} } }
Fetching Entity Schema (e.g., d365_data_reader_get_columns)
{ "jsonrpc": "2.0", "id": 102, "method": "tools/call", "params": { "name": "d365_data_reader_get_columns", "arguments": { "table": "AccountSet" } } }
Executing a SQL Query (e.g., d365_data_reader_run_query)
{ "jsonrpc": "2.0", "id": 103, "method": "tools/call", "params": { "name": "d365_data_reader_run_query", "arguments": { "sql": "SELECT Name, Revenue FROM Account WHERE Status = 'Active' ORDER BY Revenue DESC" } } }
Support and Licensing
This server component is distributed under the permissive MIT License. Full details are available in the accompanying LICENSE file.
For connection difficulties, please utilize the CData Support portal: https://www.cdata.com/support/submit.aspx. For general feedback or integration questions, visit the CData User Community.
Supported Data Sources Catalog
The underlying CData JDBC technology supports a vast array of enterprise systems. While this specific build targets Dynamics 365, the driver architecture is compatible with hundreds of sources, including (but not limited to):
| Category | Examples |
|---|---|
| CRM/Sales | Salesforce, HubSpot, Zoho CRM |
| ERP/Finance | SAP, NetSuite, QuickBooks Online, Oracle Financials |
| Cloud Storage | Amazon S3, Azure Data Lake, Google Cloud Storage |
| Databases | PostgreSQL, MySQL, Snowflake, BigQuery, SQL Server |
| Productivity | SharePoint, Google Sheets, Jira, ServiceNow |
See the full, extensive list of supported connectors available via the CData product suite.
