OmniSQL MCPのロゴ

OmniSQL MCP

コミュニティ
srthkdev

omnisql-mcp

公開者srthkdev
リポジトリomnisql-mcp
言語TypeScript
フォーク
34
スター
79
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    OmniSQL MCPは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには79件のスターと34件のフォークがあります。

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.

Custom drivers wrapping any of the above are detected automatically — see Custom and IAM-Authenticated Drivers.

Features

  • Reuses connections already configured in your local DB client workspace — no duplicate setup
  • Native query execution for PostgreSQL, MySQL/MariaDB, SQLite, SQL Server
  • AWS RDS IAM authentication, including custom drivers built on the AWS Advanced JDBC Wrapper
  • 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

Requirements

  • Node.js 18+
  • A local DB client (DBeaver-compatible) with at least one configured connection

Installation

bash
npm install -g omnisql-mcp

Configuration

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

json
{
  "mcpServers": {
    "omnisql": {
      "command": "omnisql-mcp"
    }
  }
}

Claude Code

Add to ~/.claude/settings.json:

json
{
  "mcpServers": {
    "omnisql": {
      "command": "omnisql-mcp"
    }
  }
}

Cursor

Add to Cursor Settings > MCP Servers:

json
{
  "mcpServers": {
    "omnisql": {
      "command": "omnisql-mcp"
    }
  }
}

Environment Variables

VariableDescriptionDefault
OMNISQL_CLI_PATHPath to external DB client CLI (used for unsupported-driver fallback)Unset
OMNISQL_WORKSPACEPath to local DB client workspace directoryOS default
OMNISQL_PROJECTName of the DB client project/workspace folder (e.g. custom-named DBeaver project)General
OMNISQL_TIMEOUTQuery timeout (ms)30000
OMNISQL_DEBUGEnable debug loggingfalse
OMNISQL_READ_ONLYDisable all write operationsfalse
OMNISQL_ALLOWED_CONNECTIONSComma-separated whitelist of connection IDs or namesAll
OMNISQL_DISABLED_TOOLSComma-separated tools to disableNone
OMNISQL_POOL_MINMinimum connections per pool2
OMNISQL_POOL_MAXMaximum connections per pool10
OMNISQL_POOL_IDLE_TIMEOUTIdle connection timeout (ms)30000
OMNISQL_POOL_ACQUIRE_TIMEOUTConnection acquire timeout (ms)10000
OMNISQL_AWS_CLI_PATHPath to the AWS CLI (used for RDS IAM authentication)aws
OMNISQL_IAM_TOKEN_TIMEOUTTimeout for minting an RDS IAM auth token (ms)20000
OMNISQL_SSH_KNOWN_HOSTSknown_hosts file used to verify SSH tunnel hosts~/.ssh/known_hosts
OMNISQL_SSH_STRICT_HOST_KEYRefuse SSH tunnel hosts with no known_hosts entryfalse

Read-Only Mode

Blocks all write operations. The execute_query tool only allows SELECT, EXPLAIN, SHOW, and DESCRIBE statements. Transaction tools are disabled entirely.

json
{
  "mcpServers": {
    "omnisql": {
      "command": "omnisql-mcp",
      "env": {
        "OMNISQL_READ_ONLY": "true"
      }
    }
  }
}

Connection Whitelist

Restrict which workspace connections are visible. Accepts connection IDs or display names, comma-separated:

json
{
  "mcpServers": {
    "omnisql": {
      "command": "omnisql-mcp",
      "env": {
        "OMNISQL_ALLOWED_CONNECTIONS": "dev-postgres,staging-mysql"
      }
    }
  }
}

Disable Specific Tools

json
{
  "mcpServers": {
    "omnisql": {
      "command": "omnisql-mcp",
      "env": {
        "OMNISQL_DISABLED_TOOLS": "drop_table,alter_table,write_query"
      }
    }
  }
}

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/

The project/workspace folder name (General by default) is configurable via OMNISQL_PROJECT, so workspaces using a custom or renamed DBeaver project (e.g. DataPlatform) are discovered without needing to rename the project or symlink the folder.

Connection modes

DBeaver connections are configured either manually (host, port, database fields) or by URL (a JDBC URL). Both work. In URL mode DBeaver leaves the host/port fields at placeholder values — usually localhost — and reads only the URL, so the URL is what is used here too.

SSH tunnels

Connections that DBeaver reaches through an SSH tunnel are tunneled here as well. The tunnel is opened on first use and reused for the lifetime of the server, with a loopback-only local forward, and the connection's host/port are treated the way DBeaver treats them: as the database as seen from the SSH server.

  • Agent, password and public-key authentication are supported, taken from the connection's SSH tab. Credentials saved in the workspace (including the tunnel's own, stored separately from the database credentials) are decrypted and used.
  • Agent authentication needs SSH_AUTH_SOCK set in the MCP server's environment. MCP clients usually do not inherit your shell, so set it explicitly in the client's server config if you use an agent.
  • The SSH host key is checked against known_hosts. A host recorded there must match, or the tunnel is refused; a host that is not recorded is accepted, unless OMNISQL_SSH_STRICT_HOST_KEY=true.
  • If a tunnel cannot be opened the connection fails with that reason. It never falls back to connecting directly to the recorded host, which would reach an unrelated local database.

Querying another database on the same server

A connection id may carry a database override — my-connection/analytics — to run against a different database on the same server without adding a second connection in DBeaver. This does not apply to file-backed engines such as SQLite, where the "database" is a file path.

With OMNISQL_ALLOWED_CONNECTIONS set, whitelisting a connection allows the databases its credentials can reach. To pin it to specific databases, list connection/database entries instead of the bare connection.

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

Custom and IAM-Authenticated Drivers

Custom drivers

Native routing normally keys off the driver id (postgres-jdbc, mysql8). Custom drivers often use an opaque id instead — a UUID, say — which names no engine. Those connections are resolved by falling back to the connection's provider (postgresql, mysql, …) and then to the JDBC URL's sub-protocol, including wrapped ones such as jdbc:aws-wrapper:postgresql://…. A custom driver wrapping a supported engine therefore works with no extra configuration.

If an engine still cannot be identified, the resulting error names both the driver id and the provider so you can see what was missing.

AWS RDS IAM authentication

Connections that authenticate with an RDS IAM token instead of a stored password are detected and handled automatically. Both shapes are recognised:

  • AWS Advanced JDBC Wrapper drivers, which record wrapperPlugins: "iam" alongside awsProfile and iamRegion.
  • The DB client's own AWS IAM auth models.

For these connections OmniSQL:

  1. Mints a token with aws rds generate-db-auth-token (via the AWS CLI, so SSO and role-chained profiles work as configured) and uses it as the password.
  2. Caches each token for 13 minutes, under its 15-minute lifetime, and re-mints per physical connection so long-lived pools keep working.
  3. Forces TLS, which RDS requires for IAM tokens.
  4. Resolves the database username from the connection when present. Where it is absent, the username is derived from your AWS identity: either the per-developer role name (<profile>-<user>) or the assumed SSO session name.

Requirements: the AWS CLI on PATH (or OMNISQL_AWS_CLI_PATH), a valid session for the connection's profile (aws sso login --profile <profile>), and network reachability to the endpoint. An expired SSO session produces an error naming the profile to re-authenticate.

Development

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

License

MIT

インストール

TypingMind
{
  "mcpServers": {
    "omnisql-mcp": {
      "command": "omnisql-mcp",
      "args": []
    }
  }
}

OmniSQL MCPのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度OmniSQL MCPに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

OmniSQL MCPをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. OmniSQL MCPのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "omnisql-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "omnisql-mcp"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてOmniSQL MCPのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. OmniSQL MCPのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
OmniSQL MCPを使ってこのタスクを手伝ってもらえますか?
OmniSQL MCP
はい、読みました。
OmniSQL MCPで調べた結果をお伝えします。

よくある質問

OmniSQL MCP MCPサーバーは何に使いますか?

OmniSQL MCPは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでOmniSQL MCP MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでOmniSQL MCPを利用できます。

TypingMindでOmniSQL MCP MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。OmniSQL MCPを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

OmniSQL MCP MCPをTypingMindに接続するにはどうすればよいですか?

OmniSQL MCPはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでOmniSQL MCP MCPのどのようなツールを利用できますか?

OmniSQL MCPはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

OmniSQL MCP MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。OmniSQL MCPで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇