Spanner
[!NOTE]
Currently in beta (pre-v1.0), and may see breaking changes until the first stable release (v1.0).
This repository packages MCP Toolbox's prebuilt spanner server as a plugin/extension to interact with Google Cloud Spanner instances. It can be used with various AI agents, including Antigravity, Claude Code and Codex, to manage your databases, execute queries, explore schemas, and troubleshoot issues using natural language prompts.
[!IMPORTANT]
We Want Your Feedback!
Please share your thoughts with us by filling out our feedback form.
Your input is invaluable and helps us improve the project for everyone.
Table of Contents
Why Use Spanner?
- Seamless Workflow: Integrates seamlessly into your AI agent's environment. No need to constantly switch contexts for common database tasks.
- Natural Language Queries: Stop wrestling with complex commands. Explore schemas and query data by describing what you want in plain English.
- Full Lifecycle Control: Manage your Spanner databases, from exploring schemas to running queries.
- Code Generation: Accelerate development by asking your agent to generate data classes and other code snippets based on your table schemas.
Prerequisites
Before you begin, ensure you have the following:
- One of these AI agents installed
- Node.js — the MCP server runs via
npx.
- A Google Cloud project with the Spanner API enabled.
- Ensure Application Default Credentials are available in your environment.
- IAM Permissions:
- Cloud Spanner Database Reader (
roles/spanner.databaseReader)
- Cloud Spanner Database User (
roles/spanner.databaseUser)
Getting Started
Configuration
Please keep these env vars handy during the installation process:
SPANNER_PROJECT: The GCP project ID.
SPANNER_INSTANCE: The Spanner instance ID.
SPANNER_DATABASE: The Spanner database ID.
SPANNER_DIALECT: (Optional) The SQL dialect of the Spanner Database: 'googlesql' or 'postgresql'. Defaults to "googlesql".
[!NOTE]
Installation & Usage
To start interacting with your database, install the extension for your preferred AI agent, then launch the agent and use natural language to ask questions or perform tasks.
For the latest version, check the releases page.
Antigravity
You can use either of these two agents for Antigravity: