Skip to content
GitHub (opens in a new tab)

Databases · Integration guide

How to connect DuckDB 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

A DuckDB database file on this computer: read-only queries with row, memory and time limits; changes wait for approval.

The screenshots show GateRook 2.0.0: the DuckDB 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 DuckDB, choose its card and select Continue to configure. GateRook downloads the official DuckDB connector module when you choose it. Wait for the download and verification to finish before configuring the connection.

Have an existing DuckDB database file on this computer. Choose the file yourself; this is a local file connection.

If you also want to query Parquet, CSV or JSON files, identify the specific data folders that may be read. Leave that access empty when the AI needs only the database.

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

Choose Database file or enter its path, for example ~/projects/analytics/warehouse.duckdb.

Add only the required Data folders. Use absolute paths in file-reading queries and keep those paths inside the selected folders.

Under Limits, review Max rows, Statement timeout, Memory limit and Threads. Reads open the database read-only; approved changes use a separate writable transaction.

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

GateRook 2.0.0 Configure DuckDB form before saving.
The DuckDB 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 file is locked, close another process that has it open for writing and retry. A rejected file-reading query may refer to a path outside Data folders; a large query can also exceed the memory limit without spilling to disk.

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 DuckDB on the endpoint and passing its connection test, ask your AI app to use duckdb-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.

For this local-file connection, file permissions and configured path restrictions determine which data can be read or changed.

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.

DuckDB connector tool names and default modes in the GateRook 2.0.0 endpoint preview.
DuckDB 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 in duckdb-demo.”
  • “Describe the columns and constraints of analytics.orders in duckdb-demo.”
  • “Using duckdb-demo, count orders by status without modifying the file.”
Tools your AI gets
ToolWhat it doesStarts as
duckdb_queryRuns one read-only statement on the DuckDB database file: SELECT, WITH … SELECT, FROM …, VALUES, TABLE, PIVOT, UNPIVOT, DESCRIBE, SHOW, SUMMARIZE or EXPLAIN. DuckDB opens the file read-only, with external access off and its settings locked, and the call has row, memory and time limits. read_parquet, read_csv, read_json, read_text, read_blob and glob read only absolute paths inside the connection's data folders (current_setting('allowed_directories') lists them). ATTACH, COPY, EXPORT, INSTALL, LOAD, SET, PRAGMA, CALL, transactions and SQL run from text (query()) are refused.Read only
duckdb_list_tablesThe tables and views of the database file by schema: kind, estimated rows, number of columns and comment.Read only
duckdb_describe_tableThe columns of one table or view with their types, nullability, defaults and comments, its primary key, constraints and indexes, and its CREATE statement.Read only
duckdb_executeRuns one INSERT, UPDATE, DELETE or DDL statement (CREATE, ALTER, DROP, TRUNCATE, COMMENT ON) on the database file, only after a person approved exactly this statement. DuckDB runs it as one transaction on its own read-write instance, with external access off and its settings locked. COPY, ATTACH, EXPORT, secrets, temporary objects and statements that change data inside a query 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 DuckDB 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)