gong-nl-db-mcp
Allows read-only querying of a Google Cloud SQL Postgres database with tools for listing schemas, tables, describing columns, sample rows, and running read-only SQL queries.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@gong-nl-db-mcp show me the top 10 accounts by call volume last week"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
gong-nl-db-mcp
Read-only Claude Desktop access to the BairesDev gong-nl-db Cloud SQL
Postgres instance.
This is an MCP server that colleagues install on their Mac. Once set up, they can ask Claude Desktop questions like "what tables are in gong-nl-db?" or "show me last week's top 10 accounts by call volume" and Claude will query the database directly — always read-only, always audited to their personal @bairesdev.com identity.
For colleagues (one-time setup, ~3 minutes)
You need:
Claude Desktop (download)
That's it — the installer handles everything else.
macOS
Open Terminal and paste:
curl -LsSf https://raw.githubusercontent.com/andyhorvitz/gong-nl-db-mcp/main/scripts/install.sh | bashWindows
Open PowerShell (search "PowerShell" in the Start menu) and paste:
irm https://raw.githubusercontent.com/andyhorvitz/gong-nl-db-mcp/main/scripts/install.ps1 | iexBoth installers will:
Install
uv(tiny Python runner) if you don't have it.Install Google Cloud SDK if you don't have it.
Prompt you to sign in to Google — use your
@bairesdev.comaccount.Register the
gong-nl-dbMCP server in Claude Desktop's config.
Restart Claude Desktop and try asking it: "List the schemas in gong-nl-db."
If you get a permissions error, ping Andy — he needs to grant your Google account access to the Cloud SQL instance (see the owner setup section below).
Troubleshooting
CERTIFICATE_VERIFY_FAILED / SSL errors in Claude Desktop's logs
This is the most common failure. The installer pins the server to Python 3.12
(--python 3.12 in the Claude Desktop config), which avoids the issue entirely
on a fresh install. If you hit it anyway (e.g. you installed before this fix):
# 1. Clear the cached old package
uv cache clean gong-nl-db-mcp
# 2. Re-run the installer to update your Claude Desktop config
curl -LsSf https://raw.githubusercontent.com/andyhorvitz/gong-nl-db-mcp/main/scripts/install.sh | bash
# 3. Fully quit and reopen Claude Desktop (⌘Q, not just close the window)serviceusage.services.use permission error / list_schemas hangs
The ADC quota project isn't set. Run:
# macOS
gcloud auth application-default set-quota-project planar-ray-494004-b8
# Windows (PowerShell)
gcloud auth application-default set-quota-project planar-ray-494004-b8Then restart Claude Desktop. The installer now does this automatically, so a fresh install won't hit this.
"Could not determine IAM DB username"
You either aren't logged in or logged in with the wrong account. Run:
# macOS
gcloud auth application-default login
# Windows (PowerShell)
gcloud auth application-default loginUse your @bairesdev.com account when the browser opens, then restart Claude Desktop.
Failed to spawn process: No such file or directory
Claude Desktop launches with a stripped PATH that excludes ~/.local/bin
(where uv installs its tools by default). Fix: symlink uvx into a
directory Claude Desktop can see, then re-run the installer:
sudo ln -sf "$(which uvx)" /usr/local/bin/uvx
curl -LsSf https://raw.githubusercontent.com/andyhorvitz/gong-nl-db-mcp/main/scripts/install.sh | bashThe installer now writes the absolute path to uvx into the config
automatically, so a fresh install won't hit this.
MCP server not appearing in Claude Desktop
macOS: Check
~/Library/Logs/Claude/for errors. Verify the entry exists in~/Library/Application Support/Claude/claude_desktop_config.jsonundermcpServers.gong-nl-db.Windows: Check
%APPDATA%\Claude\logs\for errors. Verify the entry exists in%APPDATA%\Claude\claude_desktop_config.jsonundermcpServers.gong-nl-db.
Windows: PowerShell says "running scripts is disabled"
Run this once in PowerShell as Administrator, then retry the installer:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserWhat you can do
Claude will have these tools available under the gong-nl-db MCP server:
Tool | What it does |
| Show non-system schemas |
| Show tables/views in a schema |
| Show columns, types, nullability |
| Return up to 50 sample rows |
| Run a read-only SELECT / WITH / set-op (max 1000 rows) |
| Return the query plan |
| Full-text keyword search across transcript segments (FTS/GIN index) |
| Per-rep daily call stats from the |
| Meaning-based search using Vertex AI embeddings — finds conceptually related transcript chunks even without exact word matches |
What you can't do
Every query is checked against a read-only allow-list before it reaches
the database. Attempting INSERT, UPDATE, DELETE, DROP, TRUNCATE,
COPY, CALL, VACUUM, SET, etc. will be rejected. Even if that layer
somehow let a write through, the Postgres role you connect as only has
SELECT grants and the transaction is explicitly READ ONLY. Four layers
of defense — you are not going to accidentally drop prod.
Related MCP server: mcp-postgres-query
For the owner (Andy): initial Cloud SQL setup
This is a one-time-per-instance setup. After this, each new colleague just needs the per-user steps below.
1. Enable IAM database authentication on the instance
gcloud sql instances patch gong-nl-db \
--database-flags=cloudsql.iam_authentication=on,cloudsql.enable_pgaudit=on,pgaudit.log=read2. Create the read-only Postgres role
Connect as a superuser (e.g. via cloud-sql-proxy + psql):
CREATE ROLE readonly_analysts;
GRANT CONNECT ON DATABASE <db> TO readonly_analysts;
GRANT USAGE ON SCHEMA public TO readonly_analysts;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly_analysts;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT SELECT ON TABLES TO readonly_analysts;
ALTER DATABASE <db> SET default_transaction_read_only = on;Repeat the GRANT USAGE / GRANT SELECT / ALTER DEFAULT PRIVILEGES block
for each additional schema you want to expose.
3. For each colleague (e.g. alice@bairesdev.com)
# GCP IAM — lets them authenticate to the instance
gcloud projects add-iam-policy-binding <PROJECT_ID> \
--member=user:alice@bairesdev.com --role=roles/cloudsql.client
gcloud projects add-iam-policy-binding <PROJECT_ID> \
--member=user:alice@bairesdev.com --role=roles/cloudsql.instanceUser
# Cloud SQL — registers them as an IAM DB user on the instance
gcloud sql users create alice@bairesdev.com \
--instance=gong-nl-db --type=cloud_iam_userThen, in Postgres:
GRANT readonly_analysts TO "alice@bairesdev.com";4. Configure the installer
Edit scripts/install.sh and replace the REPLACE_ME placeholders with:
INSTANCE_CONNECTION_NAME—<project>:<region>:gong-nl-dbDB_NAME— the Postgres database name
Commit, push to main. Next colleague who re-runs the one-liner picks up the
new config.
Development
uv venv --python 3.12
uv pip install -e ".[dev]"
.venv/bin/pytest # run the safety test suiteTest the MCP server locally against a running Cloud SQL Auth Proxy or the live instance:
INSTANCE_CONNECTION_NAME=... DB_NAME=... \
.venv/bin/gong-nl-db-mcp # speaks MCP over stdioReleasing
Tag-driven: git tag v0.2.0 && git push --tags triggers
.github/workflows/release.yml, which publishes to PyPI. Colleagues' uvx gong-nl-db-mcp@latest picks it up automatically.
The safety guarantee
src/gong_nl_db_mcp/safety.py is the statement-level allow-list. Any
change to that file must go through PR review. The file's git history is
the audit trail for the read-only guarantee. See tests/test_safety.py for
the allow/deny corpus.
Available Tools
9 toolsdescribe_tableA
Describe a table's columns, types, and nullability. Use this before writing a query against an unfamiliar table.
Inputs: table (required), schema. Returns: result
explain_queryA
Return the Postgres query plan for a SELECT statement. Useful for debugging slow queries.
Inputs: sql (required). Returns: result
list_schemasA
List non-system schemas in the gong-nl-db database. Call this first when exploring.
Inputs: no named parameters. Returns: result
list_tablesA
List tables and views in a schema. Use list_schemas first to find valid schema names. Defaults to 'public'.
Inputs: schema. Returns: result
run_queryA
Run a read-only SQL query against gong-nl-db. Only SELECT, WITH (terminating in SELECT), and set-operation queries are allowed — any INSERT/UPDATE/DELETE/DDL is rejected before the query reaches the database. Results are capped at limit rows (max 1000).
Inputs: sql (required), limit. Returns: result
sample_rowsA
Return up to limit sample rows from a table (max 50). Useful for getting a feel for the data shape before running real analytical queries.
Inputs: table (required), limit, schema. Returns: result
search_transcriptsA
Full-text search across transcript_segments. Prefer this over ILIKE when searching for phrases in calls — it uses the GIN FTS index and is ~100x faster. Returns matching segments joined to call metadata. query supports websearch syntax: "pricing objection", pricing OR discount, -competitor. since / until are ISO-8601 dates or timestamps (optional). host_email filters to calls owned by one user (optional).
Inputs: query (required), limit, since, until, +1 more. Returns: result
semantic_searchA
Semantic / meaning-based search across call transcript chunks using Vertex AI embeddings (text-embedding-005) and cosine similarity. Use this when the user asks to find calls 'about' a topic or concept — e.g. 'calls where pricing came up', 'conversations about churn risk', 'mentions of competitor X'. Unlike search_transcripts (FTS keyword matching), this finds conceptually related content even without exact word matches. since/until are ISO-8601 dates (optional). host_email filters to one rep's calls (optional). limit caps results 1–20 (default 10).
Inputs: query (required), limit, since, until, +1 more. Returns: result
user_activityA
Per-user daily call activity from the mv_user_daily materialized view — answers questions like 'how many calls did X have this week', 'avg talk ratio by person last month'. Filter by host_email (single user) or leave blank for team view. since/until are ISO-8601 dates (inclusive / exclusive). Returns one row per (host, date).
Inputs: limit, since, until, host_email. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool serves a distinct purpose: schema exploration, table inspection, sampling, query execution, query planning, keyword search, semantic search, and user activity. The two transcript search tools are clearly differentiated by their descriptions (FTS keyword vs. semantic meaning), and all other tools have non-overlapping boundaries.
Most tools follow a clear verb_noun pattern (e.g., list_schemas, describe_table, search_transcripts), but user_activity and semantic_search deviate from this pattern, making naming slightly inconsistent. However, the names remain intuitive and readable.
With 9 tools, the set is well-scoped for a database MCP server, covering schema exploration, data sampling, query execution, and specialized search/analysis. No clutter or redundancy; each tool earns its place.
The tool set covers the full analytical workflow: discover schemas/tables, inspect columns, sample data, run queries, explain slow queries, and perform targeted transcript/activity searches. The generic run_query provides an escape hatch for any missing operations, though a few niche endpoints like a direct user list are absent, which is a minor gap.
Maintenance
Related MCP Connectors
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Read-only Google Ads, GA4 and Search Console data for Claude, with no Google Cloud setup.
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables Claude Desktop to interact with PostgreSQL databases through natural language for schema exploration, data analysis, and query execution. Users can search schemas, describe tables, and perform read or write operations without needing to write manual SQL.-
- AlicenseAqualityDmaintenanceConnects Claude to any PostgreSQL database, enabling schema exploration, query execution, and performance analysis through natural conversation.76 npm1MIT
- FlicenseNot gradedqualityDmaintenanceEnables Claude Desktop to connect to PostgreSQL databases, allowing users to query, explore schemas, and analyze data using plain English without writing SQL.-
- AlicenseNot gradedqualityFmaintenanceEnables connecting to any SQL database, exploring schemas, running queries, and visualizing results with interactive charts from Claude Desktop.MIT