Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"datalink": {
"env": {
"DATALINK_CACHE_URL": "sqlite:///path/to/cache.db",
"DATALINK_ANALYTICS_URL": "postgresql://user:password@localhost:5432/analytics",
"DATALINK_INVENTORY_URL": "mysql://user:password@localhost:3306/inventory",
"DATALINK_ANALYTICS_READONLY": "true"
},
"args": [
"-y",
"@pilat/mcp-datalink"
],
"command": "npx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
MCP server for PostgreSQL, MySQL, and SQLite. Gives AI assistants secure database access via Model Context Protocol.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
npx -y '@pilat/mcp-datalink' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked @pilat/mcp-datalink against OSV.dev.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in data
Manage Supabase projects — databases, auth, storage, and edge functions
🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients.
The Apify MCP server enables your AI agents to extract data from social media, search engines, maps, e-commerce sites, or any other website using thousands of ready-made scrapers, crawlers, and automation tools available on the Apify Store.
An official Qdrant Model Context Protocol (MCP) server implementation
MCP Security Weekly
Get CVE alerts and security updates for Datalink MCP Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
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.
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.
| Variable | Description |
|---|---|
DATALINK_{NAME}_URL | Connection URL (creates database named {name}) |
DATALINK_{NAME}_READONLY | Set to true to block writes |
DATALINK_{NAME}_MAX_TIMEOUT | Max query timeout in ms (caps model requests) |
Connection URL formats:
# PostgreSQL
postgresql://user:password@localhost:5432/dbname
postgresql://user:password@localhost:5432/dbname?sslmode=require
# MySQL
mysql://user:password@localhost:3306/dbname
mysql://user:password@localhost:3306/dbname?ssl=true
# SQLite
sqlite:///path/to/database.db
sqlite:///Users/me/data/app.sqlite
sqlite://../relative/path/data.db
URLs support ${VAR} syntax to reference other environment variables:
{
"mcpServers": {
"datalink": {
"command": "npx",
"args": ["-y", "@pilat/mcp-datalink"],
"env": {
"DATALINK_MAIN_URL": "${DATABASE_URL}"
}
}
}
}
This allows reusing existing environment variables (like DATABASE_URL from your shell or .env file).
Supported syntax:
| Syntax | Description |
|---|---|
${VAR} | Expands to value of VAR, or keeps ${VAR} if unset |
${VAR:-default} | Expands to value of VAR, or default if unset |
Examples:
# Reference existing DATABASE_URL
DATALINK_MAIN_URL="${DATABASE_URL}"
# Build URL from parts
DATALINK_MAIN_URL="postgresql://${DB_USER}:${DB_PASS}@${DB_HOST}:5432/mydb"
# With default values
DATALINK_MAIN_URL="postgresql://localhost:${DB_PORT:-5432}/mydb"
| Client | Config file |
|---|---|
| Claude Code | ~/.claude.json (global) or .mcp.json (project) |
| Claude Desktop (macOS) | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Claude Desktop (Windows) | %APPDATA%\Claude\claude_desktop_config.json |
| Cursor | ~/.cursor/mcp.json or Settings → Features → MCP Servers |
| Cline | cline_mcp_settings.json or VS Code settings cline.mcpServers |
| Tool | Description |
|---|---|
list_databases | List configured database connections |
list_tables | List tables with row counts |
describe_table | Get schema, indexes, foreign keys |
query | Run SELECT queries |
execute | Run INSERT/UPDATE/DELETE |
explain | Show query execution plans |
DATALINK_MAX_TOTAL_SIZE)MAX_TIMEOUT caps itMIT