SuperAPI AI Directory

mcp-datalink

Secure access to PostgreSQL, MySQL and SQLite databases with parameterized queries and schema inspection.

Open website

About this tool

mcp-datalink is an MCP (Model Context Protocol) server designed to let AI assistants securely access PostgreSQL, MySQL, and SQLite databases through a standard protocol. It is suitable for Claude Desktop, Claude Code, Cursor, Cline, and any MCP-compatible client.

Key capabilities and security mechanisms:

  • Uses only parameterized queries, avoiding SQL injection.
  • Allows only a single statement per query; statement chaining is prohibited.
  • Blocks all DDL operations (such as DROP, ALTER, TRUNCATE).
  • Read-only mode can be enabled individually for each connection.
  • The default response size limit is 100 rows or 64KB, adjustable via the environment variable DATALINK_MAX_TOTAL_SIZE.
  • The query timeout defaults to 30 seconds; the model may request an extension of up to 10 minutes, subject to the upper limit set by the MAX_TIMEOUT environment variable.

Usage: Add mcp-datalink to the configuration file of the MCP client, and specify the database connection using the connection URL format. The configuration supports defining multiple connections at once (for example, analytics as read-only, inventory, cache, etc.). Connection URLs support the ${VAR} syntax to reference other environment variables, making it easy to reuse existing environment variables (such as DATABASE_URL in the shell or a .env file).

Use cases: Suitable for developers and data scenarios that need to let AI assistants securely query relational databases, including database exploration, data queries, schema inspection, etc., while limiting the AI's write and schema modification permissions.