Skip to content
GitHub (opens in a new tab)

Databases · Integration guide

How to connect H2 to any AI IDE (Claude/Codex/Cursor/VS Code/Antigravity)

Before you start, install GateRook and connect it to your AI development environment: Claude Desktop, Codex, Cursor, Antigravity or VS Code.

Connect your AI app

An H2 database server: checked read-only queries with row and time limits, always rolled back; changes wait for approval.

The screenshots show GateRook 2.0.0: the H2 form, the endpoint selector, and this connector’s actual tool preview. The form and preview have not been saved. Select a screenshot to open it at full size.

1. Create a connection and enter the settings

In GateRook, open Connections, select Add connection, search for H2, choose its card and select Continue to configure. GateRook downloads the official H2 connector module when you choose it. Wait for the download and verification to finish before configuring the connection.

Use an existing H2 database exposed by an H2 TCP server. GateRook connects to the server and does not create a database.

The connector’s TCP connection is unencrypted, so use a server on this computer or a private network allowed by the environment. Use a non-administrator user with only the intended data privileges.

Enter a Name, for example h2-demo. Your AI app uses this name to choose the connection.

Enter Host and Port for the H2 TCP server. In Database, enter the server’s database name or path, such as ~/orders or mem:orders, rather than a complete JDBC URL.

Enter User and Password. Under Limits, review Max rows and Statement timeout.

Choose Development, Staging or Production to match the service. Review the connector’s limit and access settings before continuing.

GateRook 2.0.0 Configure H2 form before saving.
The H2 configuration form. Enter your own connection settings before testing.

2. Test the connection and add it to an endpoint

Select Continue to test. GateRook checks the settings from your computer. Review the result and resolve any connection, certificate or permission error before continuing.

If the database is not found, confirm the exact name and the TCP server’s base directory. H2 administrator privileges are broader than the SQL operations this guide needs; check the user’s grants before exposing the connection.

After the test passes, select Continue to add to an endpoint. Choose the endpoint your AI app uses, review its tool modes, then select Save connection. GateRook offers default as the starter endpoint.

GateRook endpoint selector with default selected; no connector tool list is shown.
Choose the endpoint your AI app uses. This selector is shared across connector types; the next screenshot shows this connector’s own tools.

3. Use the connection from your AI IDE

After saving H2 on the endpoint and passing its connection test, ask your AI app to use h2-demo, or the name you chose. If its tools are missing, confirm the endpoint assignment and refresh the MCP connection or start a new chat.

The preview below shows this connector’s default tools before saving. The table explains what each tool can do; connection settings, credentials and endpoint policies can restrict access further.

H2 connector tool names and default modes in the GateRook 2.0.0 endpoint preview.
H2 tools in the Development endpoint preview. This is an unsaved preview, not a successful service call.

Start with a small read request. Replace example resource names with existing resources your connection may access. Open Activity after the call to inspect its connection, tool, arguments, policy decision and result metadata.

Ask your AI, for example

  • “List the tables and views on h2-demo.”
  • “Describe PUBLIC.ORDERS on h2-demo.”
  • “Using h2-demo, count orders by status with a read query.”
Tools your AI gets
ToolWhat it doesStarts as
h2_list_tablesThe tables and views of the database by schema: kind, estimated rows and comment.Read only
h2_describe_tableThe columns of one table or view with their types, nullability, defaults and comments, its primary key, foreign keys and indexes, and a view's query.Read only
h2_queryRuns one query on the H2 server: SELECT, WITH … SELECT, VALUES, TABLE, EXPLAIN or SHOW. It may call H2's built-in functions only (not FILE_READ, CSVREAD, LINK_SCHEMA or the database's own functions), and runs in a transaction GateRook always rolls back, with row and time limits. Data change tables (FINAL TABLE …), NEXT VALUE FOR, FOR UPDATE, CALL, SET and JDBC escapes are refused.Read only
h2_executeRuns one INSERT, UPDATE, DELETE, MERGE, TRUNCATE, COMMENT ON or DDL statement on tables, views, indexes, sequences, schemas, domains, constants or synonyms, only after a person approved exactly this statement, and commits it once. Java functions, triggers, linked tables, users, rights, scripts, settings and functions that reach the server's files are refused. A change is never retried.Approval

You can change each tool’s mode on the endpoint. Every call your AI makes appears in Activity.

Service documentation

Keep exploring

PostgreSQL

Connect PostgreSQL to Claude, Codex, Cursor, VS Code or Antigravity in three steps. Your AI runs read queries; changes wait for your approval.

MySQL

Connect MySQL to Claude, Codex, Cursor, VS Code or Antigravity in three steps. GateRook keeps the password; your AI reads data and asks before changes.

MariaDB

Connect MariaDB to Claude, Codex, Cursor, VS Code or Antigravity in three steps with GateRook’s MySQL connector. Changes wait for your approval.

Browse all integration guides

Your local MCP gateway and firewall.

Connect H2 to your AI IDE.

Choose a connector. Start with read-only access. Approve changes and inspect the audit trail.

Read the getting started guide

Get GateRook

Download GateRook 2.0.0 for your Mac, or get the Windows app from Microsoft Store.

macOS

Version 2.0.0 for Apple Silicon (arm64). This download does not support Intel Macs.

Open the DMG and drag GateRook to Applications.

Windows

Available for free from Microsoft Store. Install GateRook and receive updates through the Store.

macOS release notes and checksums (opens in a new tab)