uniquery
Allows connecting to a MongoDB database in read-only mode and querying it with natural language, returning markdown tables and chart suggestions.
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., "@uniqueryConnect to my Postgres as 'analytics' and show top 5 customers by revenue."
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.
UniQuery
Ask your database questions in plain English — from any MCP client, or from the web UI.
UniQuery connects to a Postgres or MongoDB database in read-only mode and exposes it as a natural-language query agent. It ships two front doors onto the same engine: an MCP server that plugs into Claude Desktop, Claude Code, Cursor, or any other MCP client, and a Next.js web app for exploring results with charts.
The interesting part isn't the natural-language-to-SQL step — plenty of tools do that. It's what sits around it: PII masking before rows reach the model, hard clamps on row counts and query timeouts, read-only enforcement at the connector, and a semantic schema store so the agent gets better at your schema over time.
Architecture
apps/
web/ Next.js 16 + React 19 + Recharts UI
packages/
core/ The engine — connectors, agent loop, guardrails, viz
connectors/ Postgres (Neon serverless / pg) and MongoDB, read-only
agent/ Tool-calling loop over Vercel AI Gateway / Google Gemini
guardrails/ PII masking + row/timeout clamps
semantic/ Schema knowledge store with SQL migrations
viz/ Result-shape classifier that picks a chart type
mcp-server/ MCP server exposing core over @modelcontextprotocol/sdkRelated MCP server: Company Data MCP Server
Guardrails
These are the reason this is more than a demo:
Guardrail | Behavior |
Read-only access | Connectors never issue writes, regardless of what the model generates |
PII masking | Columns matching |
Row limit clamp | Every request is clamped to |
Timeout clamp | Every query is clamped to |
Zod-validated tools | MCP tool inputs are schema-checked before they touch a connector |
MCP server
The MCP server registers three tools:
connectDatabase— register a Postgres or MongoDB connection under aconnectionIdyou chooseaskQuestion— ask a natural-language question against a registered connection; returns a markdown table plus a suggested visualizationplus a connection-listing tool for discovering what's registered
Results come back as markdown tables (capped at 50 rows for display) with an appended chart suggestion — bar, line, table, or none — derived from the result's shape rather than guessed by the model.
Configure it in an MCP client
{
"mcpServers": {
"uniquery": {
"command": "node",
"args": ["/path/to/uniquery/packages/mcp-server/dist/index.js"]
}
}
}Then, in the client:
Connect to my Postgres at
postgres://…asanalytics, then tell me which five customers generated the most revenue last quarter.
Getting started
Requires Node.js >= 20 and pnpm 11.
pnpm install
pnpm build
# web app
pnpm dev
# MCP server
node packages/mcp-server/dist/index.jsCopy .env.example to .env.local and fill in your database URL and an LLM key — either a Vercel AI Gateway key (default) or a Google Gemini key with provider: "google".
Stack
TypeScript · pnpm workspaces · Model Context Protocol SDK · Vercel AI SDK 6 · Google Gemini · Neon serverless Postgres · MongoDB · Zod · Next.js 16 · Recharts · Vitest
Status
Working prototype. The engine, guardrails, and MCP server are functional; the web app covers the core query-and-chart flow.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Query your warehouse or a CSV with Claude/ChatGPT over MCP, governed by table-level ACL + audit.
Ask your databases questions in plain English, run read-only SQL and set up data alerts.
Ask questions in plain language, get answers from your business database. No SQL required.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables read-only exploration and querying of PostgreSQL or MySQL databases via MCP, with schema discovery, safe SQL validation, natural language to SQL conversion, and CSV export.111-
- FlicenseNot gradedqualityCmaintenanceEnables read-only access to company data across PostgreSQL, MongoDB Atlas, and flat files through MCP tools, allowing AI assistants to query and retrieve information via natural language.-
- AlicenseNot gradedqualityCmaintenanceMCP server that enables natural-language SQL queries across multiple databases (ClickHouse, Teradata, PostgreSQL, MySQL, SQL Server, DB2, Oracle, MongoDB) with dialect-correct SQL generation, PII masking, and security-by-construction controls.MIT
- AlicenseNot gradedqualityBmaintenanceProvides read-only, guarded access to business databases via MCP. Enables natural language querying with built-in security barriers like table allowlists, PII masking, and audit logging.MIT