{"id":42873365,"url":"https://github.com/pilat/mcp-datalink","last_synced_at":"2026-01-30T13:25:16.983Z","repository":{"id":331451056,"uuid":"1126728517","full_name":"pilat/mcp-datalink","owner":"pilat","description":"MCP server for secure database access (PostgreSQL, MySQL, SQLite)","archived":false,"fork":false,"pushed_at":"2026-01-15T19:11:08.000Z","size":878,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-15T21:46:52.612Z","etag":null,"topics":["database","mcp","model-context-protocol","mysql","postgresql","sqlite"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@pilat/mcp-datalink","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pilat.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-02T13:23:30.000Z","updated_at":"2026-01-15T19:11:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pilat/mcp-datalink","commit_stats":null,"previous_names":["pilat/mcp-datalink"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/pilat/mcp-datalink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilat%2Fmcp-datalink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilat%2Fmcp-datalink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilat%2Fmcp-datalink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilat%2Fmcp-datalink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pilat","download_url":"https://codeload.github.com/pilat/mcp-datalink/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilat%2Fmcp-datalink/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28913889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","mcp","model-context-protocol","mysql","postgresql","sqlite"],"created_at":"2026-01-30T13:25:16.338Z","updated_at":"2026-01-30T13:25:16.977Z","avatar_url":"https://github.com/pilat.png","language":"TypeScript","funding_links":[],"categories":["🗄️ Database"],"sub_categories":[],"readme":"# @pilat/mcp-datalink\n\nMCP server for PostgreSQL, MySQL, and SQLite. Gives AI assistants secure database access via [Model Context Protocol](https://modelcontextprotocol.io).\n\n```\nnpx @pilat/mcp-datalink\n```\n\nWorks with Claude Desktop, Claude Code, Cursor, Cline, and any MCP-compatible client.\n\n## Installation\n\nAdd to your MCP client config file (see [config locations](#config-file-locations) below):\n\n```json\n{\n  \"mcpServers\": {\n    \"datalink\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@pilat/mcp-datalink\"],\n      \"env\": {\n        \"DATALINK_ANALYTICS_URL\": \"postgresql://user:password@localhost:5432/analytics\",\n        \"DATALINK_ANALYTICS_READONLY\": \"true\",\n\n        \"DATALINK_INVENTORY_URL\": \"mysql://user:password@localhost:3306/inventory\",\n\n        \"DATALINK_CACHE_URL\": \"sqlite:///path/to/cache.db\"\n      }\n    }\n  }\n}\n```\n\nThis creates three database connections: `analytics` (read-only), `inventory`, and `cache`.\n\n| Variable | Description |\n|----------|-------------|\n| `DATALINK_{NAME}_URL` | Connection URL (creates database named `{name}`) |\n| `DATALINK_{NAME}_READONLY` | Set to `true` to block writes |\n| `DATALINK_{NAME}_MAX_TIMEOUT` | Max query timeout in ms (caps model requests) |\n\n**Connection URL formats:**\n\n```bash\n# PostgreSQL\npostgresql://user:password@localhost:5432/dbname\npostgresql://user:password@localhost:5432/dbname?sslmode=require\n\n# MySQL\nmysql://user:password@localhost:3306/dbname\nmysql://user:password@localhost:3306/dbname?ssl=true\n\n# SQLite\nsqlite:///path/to/database.db\nsqlite:///Users/me/data/app.sqlite\nsqlite://../relative/path/data.db\n```\n\n### Environment Variable Substitution\n\nURLs support `${VAR}` syntax to reference other environment variables:\n\n```json\n{\n  \"mcpServers\": {\n    \"datalink\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@pilat/mcp-datalink\"],\n      \"env\": {\n        \"DATALINK_MAIN_URL\": \"${DATABASE_URL}\"\n      }\n    }\n  }\n}\n```\n\nThis allows reusing existing environment variables (like `DATABASE_URL` from your shell or `.env` file).\n\n**Supported syntax:**\n\n| Syntax | Description |\n|--------|-------------|\n| `${VAR}` | Expands to value of `VAR`, or keeps `${VAR}` if unset |\n| `${VAR:-default}` | Expands to value of `VAR`, or `default` if unset |\n\n**Examples:**\n\n```bash\n# Reference existing DATABASE_URL\nDATALINK_MAIN_URL=\"${DATABASE_URL}\"\n\n# Build URL from parts\nDATALINK_MAIN_URL=\"postgresql://${DB_USER}:${DB_PASS}@${DB_HOST}:5432/mydb\"\n\n# With default values\nDATALINK_MAIN_URL=\"postgresql://localhost:${DB_PORT:-5432}/mydb\"\n```\n\n### Config File Locations\n\n| Client | Config file |\n|--------|-------------|\n| Claude Code | `~/.claude/settings.local.json` (global) or `.mcp.json` (project) |\n| Claude Desktop (macOS) | `~/Library/Application Support/Claude/claude_desktop_config.json` |\n| Claude Desktop (Windows) | `%APPDATA%\\Claude\\claude_desktop_config.json` |\n| Cursor | `~/.cursor/mcp.json` or Settings → Features → MCP Servers |\n| Cline | `cline_mcp_settings.json` or VS Code settings `cline.mcpServers` |\n\n## Tools\n\n| Tool | Description |\n|------|-------------|\n| `list_databases` | List configured database connections |\n| `list_tables` | List tables with row counts |\n| `describe_table` | Get schema, indexes, foreign keys |\n| `query` | Run SELECT queries |\n| `execute` | Run INSERT/UPDATE/DELETE |\n| `explain` | Show query execution plans |\n\n## Security\n\n- Prepared statements only (no SQL injection)\n- Single statement per query (no chaining)\n- DDL blocked (no DROP, ALTER, TRUNCATE)\n- Readonly mode per connection\n- Output truncation (100 rows, 64KB max)\n- Query timeout: 30s default, model can request up to 10min, `MAX_TIMEOUT` caps it\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilat%2Fmcp-datalink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpilat%2Fmcp-datalink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilat%2Fmcp-datalink/lists"}