SuperAPI AI Directory

jdbc-mcp-server

Read-only access to PostgreSQL, Oracle and SQL Server via JDBC: schema discovery, query validation, execution plans, benchmarking and index analysis.

Open website

About this tool

Purpose: jdbc-mcp-server is a stdio-based MCP server that exposes read-only access to relational databases to AI clients via JDBC, for schema discovery, query validation, execution plans, benchmarking, and index analysis. It has built-in PostgreSQL, Oracle, SQL Server, Firebird, and SQLite dialects with bundled drivers; other databases can be connected in generic JDBC mode via driverPath.

Main capabilities: Provides 49 tools, divided into 11 groups including metadata, query execution, plan analysis, column distribution and selectivity, table and index statistics, schema context, benchmarking, and usage catalog, which can be individually enabled or disabled with JDBC_MCP_TOOLS_* flags. Write protection uses a JSqlParser AST guard, allowing only a single SELECT / WITH / EXPLAIN, and supports session-, transaction-, or file-level read-only modes. Each connection maintains a local SQLite catalog that persistently stores schema snapshots and a known application query index.

Usage: Requires JDK 21+, download jdbc-mcp-server.jar from the latest release, or use the Docker image ghcr.io/igorolv/jdbc-mcp-server. Configure databases by connection name in ~/.jdbc-mcp-server/connections.json (on Windows, %USERPROFILE%.jdbc-mcp-server\connections.json; in Docker, /data/connections.json), where url is a required field and the engine is identified by its prefix. Then register the server in any MCP client that supports stdio; the client configuration does not require database settings.

Use cases: Let AI agents choose tools themselves to perform schema exploration, SQL writing assistance, query cost measurement, index and statistics analysis, and application query usage lookups.

Limitations: Using a read-only database user is recommended; credentials are not read from environment variables; tool calls in the same stdio session are executed sequentially; client cancellation notifications are not propagated to JDBC Statement.cancel(), and query timeouts are controlled by queryTimeoutSeconds; the usage catalog is not written to the database being inspected. See docs for specific client configuration examples./clients.md。