{"_id":"@bemyak/omnisql-mcp","name":"@bemyak/omnisql-mcp","dist-tags":{"latest":"2.1.1"},"versions":{"2.1.1":{"name":"@bemyak/omnisql-mcp","version":"2.1.1","description":"Universal database MCP server — native drivers for PostgreSQL, MySQL, SQLite, SQL Server with CLI fallback, reading connections from your local DB client workspace","main":"dist/index.js","type":"module","bin":{"omnisql-mcp":"dist/index.js"},"scripts":{"build":"tsc && echo '#!/usr/bin/env node' > dist/index.js.tmp && cat dist/index.js >> dist/index.js.tmp && mv dist/index.js.tmp dist/index.js && shx chmod +x dist/index.js","dev":"tsc --watch","start":"node dist/index.js","clean":"rimraf dist","prepare":"husky","prepublish":"npm run clean && npm run build","watch":"tsc --watch","example":"node examples/example.js","bump":"bumpp","bump:patch":"bumpp patch","bump:minor":"bumpp minor","bump:major":"bumpp major","publish:patch":"npm version patch && npm publish","publish:minor":"npm version minor && npm publish","publish:major":"npm version major && npm publish","publish":"echo 'Use ./scripts/publish.sh or npm run publish:patch/minor/major instead'","prepublishOnly":"npm run clean && npm run build","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","lint":"eslint src/","lint:fix":"eslint src/ --fix","format":"prettier --write src/","format:check":"prettier --check src/","typecheck":"tsc --noEmit"},"lint-staged":{"*.ts":["eslint --fix","prettier --write"]},"keywords":["mcp","model-context-protocol","database","sql","claude","anthropic","cursor","ai","postgresql","mysql","oracle","sqlserver","sqlite","mongodb","database-tools","ai-assistant","database-connectivity","universal-database"],"author":{"name":"Sarthak Jain"},"license":"MIT","dependencies":{"@modelcontextprotocol/sdk":"^1.25.2","csv-parser":"^3.0.0","csv-stringify":"^6.4.6","mssql":"^12.2.0","mysql2":"^3.16.0","pg":"^8.13.1","ssh2":"^1.17.0","xml2js":"^0.6.2"},"devDependencies":{"@eslint/js":"^9.39.2","@types/mssql":"^9.1.8","@types/node":"^20.0.0","@types/pg":"^8.11.6","@types/ssh2":"^1.15.5","@types/xml2js":"^0.4.14","@vitest/coverage-v8":"^4.0.17","bumpp":"^11.1.0","eslint":"^9.39.2","husky":"^9.1.7","lint-staged":"^16.2.7","prettier":"^3.7.4","rimraf":"^5.0.5","shx":"^0.4.0","typescript":"^5.8.3","typescript-eslint":"^8.53.0","vitest":"^4.0.17"},"engines":{"node":">=18.0.0"},"repository":{"type":"git","url":"git+https://github.com/srthkdev/omnisql-mcp.git"},"bugs":{"url":"https://github.com/srthkdev/omnisql-mcp/issues"},"homepage":"https://github.com/srthkdev/omnisql-mcp#readme","gitHead":"ae20f37e0976007ba713e3405cd3699d88b03094","types":"./dist/index.d.ts","_id":"@bemyak/omnisql-mcp@2.1.1","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-mE3CduffSqONk/LBRTVJP9sTB2N+Xx00q/qdDE5BeKzp/FcR1Q/IXwEqSzbfEN6orvjcAPv8OUW/cuccz7vq0g==","shasum":"6ad5f81e12ef43f6e24f77a1f1155297d700a04e","tarball":"https://registry.npmjs.org/@bemyak/omnisql-mcp/-/omnisql-mcp-2.1.1.tgz","fileCount":56,"unpackedSize":343975,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD22q+8vcTBT7ftUaTl68wgvTfc7tIu3Gnry3hrmi885QIhAOp0Iifyxj3x3L2ZZJoBi7bxErbem5+/lklEx9BUWR2D"}]},"_npmUser":{"name":"bemyak","email":"bemyak@gmail.com"},"directories":{},"maintainers":[{"name":"bemyak","email":"bemyak@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/omnisql-mcp_2.1.1_1781371206995_0.980525459535786"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-13T17:20:06.878Z","2.1.1":"2026-06-13T17:20:07.176Z","modified":"2026-06-13T17:20:07.378Z"},"maintainers":[{"name":"bemyak","email":"bemyak@gmail.com"}],"description":"Universal database MCP server — native drivers for PostgreSQL, MySQL, SQLite, SQL Server with CLI fallback, reading connections from your local DB client workspace","homepage":"https://github.com/srthkdev/omnisql-mcp#readme","keywords":["mcp","model-context-protocol","database","sql","claude","anthropic","cursor","ai","postgresql","mysql","oracle","sqlserver","sqlite","mongodb","database-tools","ai-assistant","database-connectivity","universal-database"],"repository":{"type":"git","url":"git+https://github.com/srthkdev/omnisql-mcp.git"},"author":{"name":"Sarthak Jain"},"bugs":{"url":"https://github.com/srthkdev/omnisql-mcp/issues"},"license":"MIT","readme":"# OmniSQL MCP\n\nUniversal database MCP server — give AI assistants read/write access to your databases using connections already saved in your local DB client workspace (DBeaver-compatible).\n\n[![npm version](https://badge.fury.io/js/omnisql-mcp.svg)](https://www.npmjs.com/package/omnisql-mcp)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Node.js](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org/)\n\n## Database Support\n\n**Natively supported** (direct driver, fast):\n- PostgreSQL (via `pg`)\n- MySQL / MariaDB (via `mysql2`)\n- SQL Server / MSSQL (via `mssql`)\n- SQLite (via `sqlite3` CLI)\n\n**Postgres-compatible** (routed through `pg` driver automatically):\n- CockroachDB, TimescaleDB, Amazon Redshift, YugabyteDB, AlloyDB, Supabase, Neon, Citus\n\n**Other databases**: Fall back to an external CLI configured via `OMNISQL_CLI_PATH`. Results vary by CLI.\n\n## Features\n\n- Reuses connections already configured in your local DB client workspace — no duplicate setup\n- SSH tunnel support — connections with an SSH tunnel configured in DBeaver connect through it automatically\n- Native query execution for PostgreSQL, MySQL/MariaDB, SQLite, SQL Server\n- Connection pooling with configurable pool size and timeouts\n- Transaction support (BEGIN/COMMIT/ROLLBACK)\n- Query execution plan analysis (EXPLAIN)\n- Schema comparison between connections with migration script generation\n- Read-only mode with enforced SELECT-only on `execute_query`\n- Connection whitelist to restrict which databases are accessible\n- Tool filtering to disable specific operations\n- Query validation to block dangerous operations (DROP DATABASE, TRUNCATE, DELETE/UPDATE without WHERE)\n- Data export to CSV/JSON\n- Graceful shutdown with connection pool cleanup\n\n## Requirements\n\n- Node.js 18+\n- A local DB client (DBeaver-compatible) with at least one configured connection\n\n## Installation\n\n```bash\nnpm install -g omnisql-mcp\n```\n\n## Configuration\n\n### Claude Desktop\n\nAdd to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):\n\n```json\n{\n  \"mcpServers\": {\n    \"omnisql\": {\n      \"command\": \"omnisql-mcp\"\n    }\n  }\n}\n```\n\n### Claude Code\n\nAdd to `~/.claude/settings.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"omnisql\": {\n      \"command\": \"omnisql-mcp\"\n    }\n  }\n}\n```\n\n### Cursor\n\nAdd to Cursor Settings > MCP Servers:\n\n```json\n{\n  \"mcpServers\": {\n    \"omnisql\": {\n      \"command\": \"omnisql-mcp\"\n    }\n  }\n}\n```\n\n### Environment Variables\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| `OMNISQL_CLI_PATH` | Path to external DB client CLI (used for unsupported-driver fallback) | Unset |\n| `OMNISQL_WORKSPACE` | Path to local DB client workspace directory | OS default |\n| `OMNISQL_TIMEOUT` | Query timeout (ms) | `30000` |\n| `OMNISQL_DEBUG` | Enable debug logging | `false` |\n| `OMNISQL_READ_ONLY` | Disable all write operations | `false` |\n| `OMNISQL_ALLOWED_CONNECTIONS` | Comma-separated whitelist of connection IDs or names | All |\n| `OMNISQL_DISABLED_TOOLS` | Comma-separated tools to disable | None |\n| `OMNISQL_POOL_MIN` | Minimum connections per pool | `2` |\n| `OMNISQL_POOL_MAX` | Maximum connections per pool | `10` |\n| `OMNISQL_POOL_IDLE_TIMEOUT` | Idle connection timeout (ms) | `30000` |\n| `OMNISQL_POOL_ACQUIRE_TIMEOUT` | Connection acquire timeout (ms) | `10000` |\n\n### Read-Only Mode\n\nBlocks all write operations. The `execute_query` tool only allows SELECT, EXPLAIN, SHOW, and DESCRIBE statements. Transaction tools are disabled entirely.\n\n```json\n{\n  \"mcpServers\": {\n    \"omnisql\": {\n      \"command\": \"omnisql-mcp\",\n      \"env\": {\n        \"OMNISQL_READ_ONLY\": \"true\"\n      }\n    }\n  }\n}\n```\n\n### Connection Whitelist\n\nRestrict which workspace connections are visible. Accepts connection IDs or display names, comma-separated:\n\n```json\n{\n  \"mcpServers\": {\n    \"omnisql\": {\n      \"command\": \"omnisql-mcp\",\n      \"env\": {\n        \"OMNISQL_ALLOWED_CONNECTIONS\": \"dev-postgres,staging-mysql\"\n      }\n    }\n  }\n}\n```\n\n### Disable Specific Tools\n\n```json\n{\n  \"mcpServers\": {\n    \"omnisql\": {\n      \"command\": \"omnisql-mcp\",\n      \"env\": {\n        \"OMNISQL_DISABLED_TOOLS\": \"drop_table,alter_table,write_query\"\n      }\n    }\n  }\n}\n```\n\n## Available Tools\n\n### Connection Management\n- `list_connections` - List all database connections\n- `get_connection_info` - Get connection details\n- `test_connection` - Test connectivity\n\n### Data Operations\n- `execute_query` - Run read-only queries (SELECT, EXPLAIN, SHOW, DESCRIBE only)\n- `write_query` - Run INSERT/UPDATE/DELETE\n- `export_data` - Export to CSV/JSON\n\n### Schema Management\n- `list_tables` - List tables and views\n- `get_table_schema` - Get table structure\n- `create_table` - Create tables\n- `alter_table` - Modify tables\n- `drop_table` - Drop tables (requires confirmation)\n\n### Transactions\n- `begin_transaction` - Start a new transaction\n- `execute_in_transaction` - Execute query within a transaction\n- `commit_transaction` - Commit a transaction\n- `rollback_transaction` - Roll back a transaction\n\n### Query Analysis\n- `explain_query` - Analyze query execution plan\n- `compare_schemas` - Compare schemas between two connections\n- `get_pool_stats` - Get connection pool statistics\n\n### Other\n- `get_database_stats` - Database statistics\n- `append_insight` - Store analysis notes\n- `list_insights` - Retrieve stored notes\n\n## Security\n\n- **Read-only enforcement**: `execute_query` only accepts read-only statements (SELECT, EXPLAIN, SHOW, DESCRIBE, PRAGMA). Write operations must use `write_query`.\n- **Query validation**: Blocks DROP DATABASE, DROP SCHEMA, TRUNCATE, DELETE/UPDATE without WHERE, GRANT, REVOKE, and user management statements.\n- **Connection whitelist**: Restrict which connections are exposed via `OMNISQL_ALLOWED_CONNECTIONS`.\n- **Tool filtering**: Disable any tool via `OMNISQL_DISABLED_TOOLS`.\n- **Input sanitization**: Connection IDs and SQL identifiers are sanitized to prevent injection.\n- **Recommendation**: For production use, also use a database-level read-only user for defense in depth.\n\n## Workspace Format Support\n\nSupports both configuration formats written by DBeaver-compatible DB clients:\n- Legacy: XML config in `.metadata/.plugins/org.jkiss.dbeaver.core/`\n- Modern: JSON config in `General/.dbeaver/`\n\nCredentials are automatically decrypted from the workspace `credentials-config.json`.\n\nSSH tunnel configuration (`handlers.ssh_tunnel`) is read from the same workspace files and applied transparently — if DBeaver is configured to connect through a bastion host, omnisql-mcp will do the same. Password and public-key auth are supported.\n\n## Development\n\n```bash\ngit clone https://github.com/srthkdev/omnisql-mcp.git\ncd omnisql-mcp\nnpm install\nnpm run build\nnpm test\nnpm run lint\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-2032a206bc212c85231f6907f1772f03"}