Skip to content
GitHub (opens in a new tab)

Databases · Integration guide

How to connect Google Cloud Spanner 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

Tables and GoogleSQL or PostgreSQL queries in read-only transactions. Changes wait for approval.

The screenshots show GateRook 2.0.0: the Google Cloud Spanner 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 Google Cloud Spanner, choose its card and select Continue to configure.

Find the Google Cloud project ID, Spanner instance ID and database ID. GateRook supports both GoogleSQL and PostgreSQL-dialect databases.

Use Application Default Credentials on this computer or a service account key. A service account that only reads can use the Spanner Database Reader role on the intended database.

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

Enter Project, Instance and Database using their IDs, rather than display names.

Under Authentication, select Existing Google sign-in (ADC) or Service account key (JSON). For ADC, prepare a local sign-in with gcloud auth application-default login; for a key, enter its JSON in Service account key.

Set Service account to impersonate when using a dedicated identity. If your database uses fine-grained access control, enter its Database role under Advanced and grant the identity access to that role.

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

GateRook 2.0.0 Configure Google Cloud Spanner form before saving.
The Google Cloud Spanner 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.

For access errors, check the project and database IDs, the identity used by ADC, and its database permissions. Impersonation also requires permission for the signed-in identity to obtain tokens for the named service account.

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

Google Cloud Spanner connector tool names and default modes in the GateRook 2.0.0 endpoint preview.
Google Cloud Spanner 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 available on spanner-demo.”
  • “Describe the primary key and indexes of Orders on spanner-demo.”
  • “Using spanner-demo, count orders by status with a read-only query.”
Tools your AI gets
ToolWhat it doesStarts as
spanner_list_tablesTables and views of the database, with their schema, kind and the parent an interleaved table belongs to.Read only
spanner_describe_tableColumns with their types, the primary key, indexes, the interleaving parent and, where the credentials may read it, the table's DDL.Read only
spanner_queryOne GoogleSQL or PostgreSQL-dialect query, run in a read-only transaction in which Spanner refuses every change. Pages with nextCursor at the first page's snapshot; add ORDER BY for stable pages.Read only
spanner_executeOne INSERT, UPDATE or DELETE, committed in its own transaction, or one schema change (CREATE, ALTER, DROP). You approve the exact text.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 Google Cloud Spanner 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)