pilat avatar

DataLink

pilat/mcp-datalink

Gives Claude direct access to PostgreSQL, MySQL, and SQLite databases through a secure query interface. Configure multiple connections via environment variables, mark any as read-only, and set timeouts to prevent runaway queries. Exposes tools for listing tables, inspecting schemas, running SELECT queries, and executing writes. All queries use prepared statements and block DDL operations like DROP or ALTER. Responses cap at 100 rows and 64KB by default. Useful when you want Claude to analyze production data, generate reports from live databases, or build features that query across multiple data sources without writing custom integration code.

GitHub stars
3
tools
6
auth
Secret needed
transport
STDIO
env vars
2
last updated
Jan 4, 2026

Tools

6 tools

Public tool metadata for what this MCP can expose to an agent.

list_databasesList configured database connections

List configured database connections

No parameter schema in public metadata yet.

list_tablesList tables with row counts

List tables with row counts

No parameter schema in public metadata yet.

describe_tableGet schema, indexes, foreign keys

Get schema, indexes, foreign keys

No parameter schema in public metadata yet.

queryRun SELECT queries

Run SELECT queries

No parameter schema in public metadata yet.

executeRun INSERT/UPDATE/DELETE

Run INSERT/UPDATE/DELETE

No parameter schema in public metadata yet.

explainShow query execution plans

Show query execution plans

No parameter schema in public metadata yet.

Sponsors

Configuration

DATALINK_ANALYTICS_URL*secret

Database connection URL. Pattern: DATALINK_<NAME>_URL where <NAME> identifies the database. Supports postgresql://, mysql://, or file path for SQLite.

DATALINK_ANALYTICS_READONLY

Set to 'true' for read-only access. Pattern: DATALINK_<NAME>_READONLY

Readme

@pilat/mcp-datalink

MCP server for PostgreSQL, MySQL, and SQLite. Gives AI assistants secure database access via Model Context Protocol.

npx @pilat/mcp-datalink

Works with Claude Desktop, Claude Code, Cursor, Cline, and any MCP-compatible client.

Installation

Add to your MCP client config file (see config locations below):

{
  "mcpServers": {
    "datalink": {
      "command": "npx",
      "args": ["-y", "@pilat/mcp-datalink"],
      "env": {
        "DATALINK_ANALYTICS_URL": "postgresql://user:password@localhost:5432/analytics",
        "DATALINK_ANALYTICS_READONLY": "true",

        "DATALINK_INVENTORY_URL": "mysql://user:password@localhost:3306/inventory",

        "DATALINK_CACHE_URL": "sqlite:///path/to/cache.db"
      }
    }
  }
}

This creates three database connections: analytics (read-only), inventory, and cache.


View the full README on GitHub

Details

Repository
github.com/pilat/mcp-datalink
Category
Databases
Package
@pilat/mcp-datalink
Transport
STDIO
Auth
Required
Registry
MCP registry, active

Related Databases MCP servers

View all
1atarkowska avatarFastmcp Sqltoolsatarkowska/fastmcp-sqltoolsA MCP server provides SQL database access with support for PostgreSQL, MySQL, and SQLite.1stars
2stucchi avatarDB MCP Serverstucchi/db-mcp-serverDatabase MCP server for MySQL, PostgreSQL, MongoDB, and SQLite with SSH tunneling support.0stars
3amansingh63 avatarDBHub Analyticsamansingh63/dbhub-analyticsMCP server for Databricks, BigQuery, PostgreSQL, MySQL, SQL Server, SQLite, MariaDB0stars
4thinair avatarDataco.thinair/dataPostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.0stars
5shyamolkonwar avatarRivtorshyamolkonwar/rivtor-cliDeploy full-stack apps (frontend, backend, Postgres, Redis) from your agent and get live URLs.0stars
6daedalus avatarMcp Psycopg2daedalus/mcp-psycopg2MCP server exposing psycopg2 PostgreSQL database adapter functionality0stars