Labsco
srthkdev logo

DBeaver MCP Server

β˜… 67

from srthkdev

Integrates with DBeaver to provide AI assistants access to over 200 database types using existing connections.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeQuick setup

OmniSQL MCP

Universal database MCP server β€” give AI assistants read/write access to your databases using connections already saved in your local DB client workspace (DBeaver-compatible).

npm version License: MIT Node.js

Database Support

Natively supported (direct driver, fast):

  • PostgreSQL (via pg)
  • MySQL / MariaDB (via mysql2)
  • SQL Server / MSSQL (via mssql)
  • SQLite (via sqlite3 CLI)

Postgres-compatible (routed through pg driver automatically):

  • CockroachDB, TimescaleDB, Amazon Redshift, YugabyteDB, AlloyDB, Supabase, Neon, Citus

Other databases: Fall back to an external CLI configured via OMNISQL_CLI_PATH. Results vary by CLI.

Features

  • Reuses connections already configured in your local DB client workspace β€” no duplicate setup
  • Native query execution for PostgreSQL, MySQL/MariaDB, SQLite, SQL Server
  • Connection pooling with configurable pool size and timeouts
  • Transaction support (BEGIN/COMMIT/ROLLBACK)
  • Query execution plan analysis (EXPLAIN)
  • Schema comparison between connections with migration script generation
  • Read-only mode with enforced SELECT-only on execute_query
  • Connection whitelist to restrict which databases are accessible
  • Tool filtering to disable specific operations
  • Query validation to block dangerous operations (DROP DATABASE, TRUNCATE, DELETE/UPDATE without WHERE)
  • Data export to CSV/JSON
  • Graceful shutdown with connection pool cleanup

Available Tools

Connection Management

  • list_connections - List all database connections
  • get_connection_info - Get connection details
  • test_connection - Test connectivity

Data Operations

  • execute_query - Run read-only queries (SELECT, EXPLAIN, SHOW, DESCRIBE only)
  • write_query - Run INSERT/UPDATE/DELETE
  • export_data - Export to CSV/JSON

Schema Management

  • list_tables - List tables and views
  • get_table_schema - Get table structure
  • create_table - Create tables
  • alter_table - Modify tables
  • drop_table - Drop tables (requires confirmation)

Transactions

  • begin_transaction - Start a new transaction
  • execute_in_transaction - Execute query within a transaction
  • commit_transaction - Commit a transaction
  • rollback_transaction - Roll back a transaction

Query Analysis

  • explain_query - Analyze query execution plan
  • compare_schemas - Compare schemas between two connections
  • get_pool_stats - Get connection pool statistics

Other

  • get_database_stats - Database statistics
  • append_insight - Store analysis notes
  • list_insights - Retrieve stored notes

Security

  • Read-only enforcement: execute_query only accepts read-only statements (SELECT, EXPLAIN, SHOW, DESCRIBE, PRAGMA). Write operations must use write_query.
  • Query validation: Blocks DROP DATABASE, DROP SCHEMA, TRUNCATE, DELETE/UPDATE without WHERE, GRANT, REVOKE, and user management statements.
  • Connection whitelist: Restrict which connections are exposed via OMNISQL_ALLOWED_CONNECTIONS.
  • Tool filtering: Disable any tool via OMNISQL_DISABLED_TOOLS.
  • Input sanitization: Connection IDs and SQL identifiers are sanitized to prevent injection.
  • Recommendation: For production use, also use a database-level read-only user for defense in depth.

Workspace Format Support

Supports both configuration formats written by DBeaver-compatible DB clients:

  • Legacy: XML config in .metadata/.plugins/org.jkiss.dbeaver.core/
  • Modern: JSON config in General/.dbeaver/

Credentials are automatically decrypted from the workspace credentials-config.json.

Development

git clone https://github.com/srthkdev/omnisql-mcp.git
cd omnisql-mcp
npm install
npm run build
npm test
npm run lint

License

MIT