MCP Database Server
The pattern can be adapted to Airtable bases, letting AI assistants inspect tables/fields and run read-only retrievals and summaries over base records.
The pattern can be adapted to HubSpot, giving AI assistants read-only access to CRM objects with schema discovery and filtered, row-capped queries/summaries.
The server can be adapted to give AI assistants read-only SQL access to a MySQL database, with schema exploration tools, guarded read-only query execution and prebuilt summary reports.
The server can be adapted to give AI assistants read-only SQL access to a PostgreSQL database, exposing schema discovery (list tables, describe columns/keys with samples), capped SELECT/WITH queries, and ready-made aggregate reports.
The pattern can be adapted to Stripe, letting AI assistants read-only query payments, customers and related billing data with built-in aggregation reports.
The server's protocol layer can be pointed at Supabase to let AI assistants explore schemas and run guarded, row-capped read-only queries against the project's data.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCP Database Server: let Claude or ChatGPT safely query your company data
A Model Context Protocol (MCP) server that gives AI assistants such as Claude Desktop, Claude Code and Cursor read-only access to a business database. Ask "What was revenue by category last quarter?" in plain English, and the AI explores the schema, writes the SQL and answers. It cannot change or delete anything.
Open-source demo project by Saad Rupai, a backend engineer who builds AI agents, integrations and data systems.

Why MCP?
MCP is the open standard for connecting AI assistants to tools and data. One MCP server works with every MCP-compatible client, so you don't need a separate integration for each AI app.
Related MCP server: Qora
Tools exposed to the AI
Tool | What it does |
| All tables with row counts |
| Columns, types, primary and foreign keys, and 3 sample rows |
| Read-only SQL (SELECT/WITH only), capped at 200 rows |
| Ready-made report: revenue, orders and average order value by month, product, category or country |
Safety: three layers of defense
Query guard: a single statement only, SELECT/WITH only. It blocks
INSERT/UPDATE/DELETE/DROP/ATTACH/PRAGMAand other write keywords, and comments and string literals are stripped first so the check can't be tricked.Read-only connection: the database is opened with
readOnly: true. Even a query that got past the guard couldn't write (there's a test for this).Row cap: every query is wrapped in an outer
LIMIT, so the AI can't dump a whole table.
Errors are returned to the AI as tool errors (isError: true), so it can fix its own SQL instead of crashing the session.
Use it
Requires Node 22.18+, with zero npm dependencies. On first run it creates a demo e-commerce database (customers, products, orders).
Claude Code
claude mcp add company-db -- node /path/to/mcp-database-server/src/index.tsClaude Desktop / Cursor (claude_desktop_config.json / mcp.json)
{
"mcpServers": {
"company-db": {
"command": "node",
"args": ["/path/to/mcp-database-server/src/index.ts"],
"env": { "DB_PATH": "/path/to/your.db" }
}
}
}Then ask: "Which product category makes the most money?" or "Who are our top 5 customers by spend?"
Tests
npm testThe tests cover the guard (allowed queries, blocked writes, multi-statement and comment tricks), every tool, the read-only connection, and a real MCP session over stdio (initialize → tools/list → tools/call → error codes).
Adapting it to your stack
The protocol layer (src/mcp.ts) is independent of the database. I adapt this pattern to PostgreSQL, MySQL, BigQuery, Supabase, Airtable, HubSpot, Stripe, internal REST APIs and more, with per-table permissions, audit logs and auth for remote (HTTP) MCP deployments.
Need an MCP server or AI integration for your business?
You can reach me on Fiverr.
MIT License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Query your Postgres from ChatGPT or Claude without exposing the database or handing over credentials. Run npx boltschema connect next to your database and it dials out over HTTPS — no inbound firewall rule, no open port, works with localhost and VPC-private databases. Read-only is enforced by a SQL guard, a Postgres READ ONLY transaction, and a scoped role generated for you.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to query SQL databases safely with read-only access, allowing schema discovery and SELECT queries while blocking writes and DDL operations.-
- AlicenseAqualityBmaintenanceLets AI assistants like Cursor and Claude safely explore your database and answer questions about your data in plain English.41MIT
- AlicenseNot gradedqualityCmaintenanceGives an LLM read-only, schema-aware SQL database access so users can ask business questions in plain English and receive the exact result set, with malformed queries returned as errors for automatic retry and correction.MIT
- AlicenseNot gradedqualityCmaintenanceLets an AI assistant explore and query Postgres, DuckDB, or Snowflake with read-only SQL, table and schema discovery, sampling, and explainable guardrails.MIT