How cdatasoftware/dynamics-365-business-central-mcp-server-by-cdata works
Project type and purpose
• This is a Java-based, command-line/stdio JSON-RPC server implementing CData’s Model Context Protocol (MCP).
• Purpose: wrap the CData JDBC Driver for Dynamics 365 Business Central and expose read-only data via JSON-RPC “tools” so LLMs or scripts can query live data without writing SQL.
File structure
• src/main/java/com/cdata/mcp: core packages
• Program.java – entry point, reads .prp config, starts the JSON-RPC loop
• Config.java – loads/holds connection properties from the .prp file
• ITool, IResource – interfaces defining tools and metadata resources
• tools/ – individual tool implementations (GetTablesTool, GetColumnsTool, RunQueryTool)
• resources/ – metadata endpoints (TableMetadataResource)
• CsvUtils, CsvWriter, JsonSchemaBuilder – utility classes for formatting output
• pom.xml – Maven build & dependencies (shade plugin to bundle driver JAR)
• src/test – unit tests for core builders and Table model
README for additional insights
• Describes MCP Server’s runtime workflow:
1. Java process launched with -jar CDataMCP-jar-with-dependencies.jar + .prp file
2. JSON-RPC 2.0 messages in/stdout
3. Commands map to tool implementations, which open a JDBC connection via the CData driver JAR
4. Query results are returned in CSV or JSON schema form
Main components
a. Client Layer
• LLM or custom script (e.g. Claude Desktop)
• Communicates via stdin/stdout JSON-RPC
b. Server Core (Application Layer)
1. Program (Main)
• Reads .prp config via Config loader
• Initializes Tool registry and Resource endpoints
• Enters JSON-RPC request loop
2. JSON-RPC Dispatcher
• Parses incoming method calls (tools/call)
• Routes to the appropriate ITool implementation
3. Tools Layer
• GetTablesTool → returns table names
• GetColumnsTool → returns column metadata
• RunQueryTool → executes arbitrary SELECT SQL
4. Metadata Resources Layer
• TableMetadataResource
5. Utilities
• CsvUtils, CsvWriter – format tabular data as CSV with headers
• JsonSchemaBuilder – build JSON schema from table definitions
c. Data Access Layer
• CData JDBC Driver (external JAR)
• JDBC Connection managed by Program or tools
d. External Systems
• Dynamics 365 Business Central (the actual data source)
• License & JDBC configuration utility (out of band)
Relationships and data flow
• Client → stdin JSON-RPC → Program/Main
• Program → dispatch → Tool implementation
• Tool → JDBC driver (DriverManager) → Dynamics 365 Business Central
• Results → Utilities (CSV/JSON builder) → JSON-RPC response → stdout → Client
Architectural patterns & design principles
• Layered architecture: Presentation (JSON-RPC) → Application (dispatcher/tools) → Data (JDBC)
• Interface-driven design: ITool and IResource abstractions for future extension
• Single-process, no HTTP—uses stdio to ensure client and server run co-located
• Configuration-based wiring: .prp file dictates driver path, URL, tables
Detail
• Every layer and abstraction (IResource vs. ITool) even if they’re small interfaces
• Build artifact (uber-jar) contains both server code and JDBC driver
• Stdio contract (no HTTP server) so engineers don’t assume a web tier