@pilat/mcp-datalink
Provides tools to interact with MySQL databases, including querying, schema inspection, and data manipulation, with support for read-only mode and timeout limits.
Provides tools to interact with PostgreSQL databases, including querying, schema inspection, and data manipulation, with support for read-only mode and timeout limits.
Provides tools to interact with SQLite databases, including querying, schema inspection, and data manipulation, with support for read-only mode and timeout limits.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@pilat/mcp-datalinkShow me the first 5 rows from the 'orders' table in analytics."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@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 |
| Connection URL (creates database named |
| Set to |
| 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.dbEnvironment Variable Substitution
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 |
| Expands to value of |
| Expands to value of |
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"Config File Locations
Client | Config file |
Claude Code |
|
Claude Desktop (macOS) |
|
Claude Desktop (Windows) |
|
Cursor |
|
Cline |
|
Tools
Tool | Description |
| List configured database connections |
| List tables with row counts |
| Get schema, indexes, foreign keys |
| Run SELECT queries |
| Run INSERT/UPDATE/DELETE |
| Show query execution plans |
Security
Prepared statements only (no SQL injection)
Single statement per query (no chaining)
DDL blocked (no DROP, ALTER, TRUNCATE)
Readonly mode per connection
Response size limit (100 rows, 64KB default, configurable via
DATALINK_MAX_TOTAL_SIZE)Query timeout: 30s default, model can request up to 10min,
MAX_TIMEOUTcaps it
License
MIT
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pilat/mcp-datalink'
If you have feedback or need assistance with the MCP directory API, please join our Discord server