@pilat/mcp-datalink
MCP server for PostgreSQL, MySQL, and SQLite. Gives AI assistants secure database access via Model Context Protocol.
npx @pilat/mcp-datalinkWorks 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.
| 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) |






