Skip to main content
MCP server CX Codex

DataLink — Claude Code MCP server: features and setup

Connects PostgreSQL, MySQL, or SQLite to an AI assistant over MCP. Inspect schemas and run database queries from a supported client.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env DATALINK_ANALYTICS_URL=<DATALINK_ANALYTICS_URL> --env DATALINK_ANALYTICS_READONLY=<DATALINK_ANALYTICS_READONLY> --transport stdio datalink -- npx -y @pilat/mcp-datalink
Open on GitHub

What DataLink does

DataLink exposes database connections to an AI assistant. Its tools can list connections and tables, inspect schemas with indexes and foreign keys, show query plans, and run SQL. Use SELECT for reading; changes go through a separate execute tool.

Set connection URLs through environment variables, with an optional read-only mode for each database. URLs can also reference other variables with ${VAR} or ${VAR:-default}. Queries use prepared statements, allow one statement at a time, and block DDL such as DROP and ALTER. Read-only mode is a per-connection setting, so check it before allowing write operations.

Responses default to a limit of 100 rows and 64KB. The default query timeout is 30 seconds; size and timeout limits have configuration options. To add the server to Claude Code, provide a database URL with claude mcp add and run it through npx -y @pilat/mcp-datalink. You’ll need npx and a database connection URL.

What it helps with

  • inspect configured database connections
  • find tables and check their row counts
  • review a table’s schema, indexes, and foreign keys
  • run a SELECT query against PostgreSQL, MySQL, or SQLite
  • view the execution plan for a SQL query

Example prompts for the agent

  • List the database connections I can access.
  • Show the schema, indexes, and foreign keys for orders.
  • Run a SELECT query to retrieve recent rows from orders.

How to install DataLink

Platform CLI

claude mcp add --env DATALINK_ANALYTICS_URL=<DATALINK_ANALYTICS_URL> --env DATALINK_ANALYTICS_READONLY=<DATALINK_ANALYTICS_READONLY> --transport stdio datalink -- npx -y @pilat/mcp-datalink

Replace <…> with your own values

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about DataLink

How do I install DataLink in Claude Code?

Run claude mcp add mcp-datalink -e DATALINK_ANALYTICS_URL=<DATALINK_ANALYTICS_URL> -- npx -y @pilat/mcp-datalink. Replace the placeholder with your database URL.

What does DataLink do?

It connects PostgreSQL, MySQL, and SQLite databases to an AI assistant over MCP. The assistant can inspect database structure and run queries.

Can I restrict a connection to read-only access?

Set DATALINK_{NAME}_READONLY to true for that connection. DataLink then blocks writes on it.

Similar MCP servers

All MCP servers for Data and databases →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor