postgresql -by-cdata
This read-only MCP Server allows you to connect to PostgreSQL data from Claude Desktop through CData JDBC Drivers. For full CRUD support, check out the first managed MCP platform: CData Connect AI (https://www.cdata.com/ai/).
claude mcp add --transport stdio cdatasoftware-postgresql-mcp-server-by-cdata java -jar CDataMCP-jar-with-dependencies.jar /PATH/TO/postgresql.prp
How to use
This MCP server exposes your PostgreSQL data through CData's MCP interface in a read-only mode. It wraps the CData JDBC driver for PostgreSQL and presents tables and columns as MCP tools that an AI client can query without writing SQL. The server is configured via a .prp file (postgresql.prp) and is invoked by running the provided JAR with the path to that configuration. Tools exposed by the server include: postgresql_by_cdata_get_tables to list available tables, postgresql_by_cdata_get_columns to list columns for a specific table, and postgresql_by_cdata_run_query to execute a SELECT query. Clients like Claude Desktop or other MCP-enabled clients will automatically discover and use these tools once the server entry is added to the client's mcpServers config.
How to install
Prerequisites:
- Java Runtime Environment (JRE) or JDK installed and available on your PATH
- Maven (optional, for building the MCP JAR)
- Access to the CData JDBC Driver for PostgreSQL and your JDBC driver license
Install and run steps:
-
Clone the repository: git clone https://github.com/cdatasoftware/postgresql-mcp-server-by-cdata.git cd postgresql-mcp-server-by-cdata
-
Build the MCP server JAR (required to generate CDataMCP-jar-with-dependencies.jar): mvn clean install
After successful build, the JAR should be available as CDataMCP-jar-with-dependencies.jar
-
Obtain and license the CData JDBC Driver for PostgreSQL (as documented in the README), then place the licensed JAR in your driver directory.
-
Create the MCP PRP file (postgresql.prp) with your JDBC connection details (Prefix, ServerName, ServerVersion, DriverPath, DriverClass, JdbcUrl, Tables) as shown in the README. Ensure the JdbcUrl points to your PostgreSQL data source.
-
Run the MCP server: java -jar CDataMCP-jar-with-dependencies.jar /PATH/TO/postgresql.prp Note: The server uses stdio for input/output, so it should run on the same machine as the client.
-
Add the server to your MCP client configuration (e.g., Claude Desktop) under mcpServers with a name like postgresql_by_cdata and point the command to your Java executable and pass the JAR path and PRP path accordingly.
Prerequisites recap:
- Java installed and accessible
- The CData JDBC Driver for PostgreSQL properly licensed and accessible
- A valid PostgreSQL JDBC connection string in the prp file
- Access to an MCP-enabled client or CLI to interact with the server
Additional notes
Tips and troubleshooting:
- The MCP server runs via stdio; ensure clients and server are on the same host or adjust the config accordingly for your environment.
- If the server does not appear in Claude Desktop, fully quit and restart the client after starting the MCP server, then refresh the server list.
- Ensure the /PATH/TO/postgresql.prp path is correct in your client configuration. Incorrect PRP file paths will prevent the server from starting.
- The provided tools follow the naming pattern {servername}_get_tables, {servername}_get_columns, and {servername}_run_query. Replace {servername} with the configured server name (e.g., postgresql_by_cdata) in your tool calls.
- For write or delete operations, this server is read-only by design. If you need full read/write capabilities, use the alternative MCP server provided by CData MCP Server for PostgreSQL.