Skip to main content
Glama
yashdhingra0

uniquery

by yashdhingra0

UniQuery

用自然语言向你的数据库提问——从任何 MCP 客户端,或从 Web UI。

UniQuery 以只读模式连接到 Postgres 或 MongoDB 数据库,并将其作为自然语言查询代理暴露出来。它为同一个引擎提供了两个入口:一个MCP 服务器,可接入 Claude Desktop、Claude Code、Cursor 或任何其他 MCP 客户端;以及一个Next.js Web 应用,用于通过图表探索结果。

有趣的部分不是自然语言到 SQL 的转换步骤——很多工具都能做到。而是围绕它的部分:在行数据到达模型之前进行 PII 脱敏,对行数和查询超时进行硬性限制,在连接器层面强制只读,以及一个语义模式存储,让代理随着时间的推移越来越了解你的模式。

架构

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/sdk

Related MCP server: Vela MCP Server

安全护栏

这些是它不仅仅是一个演示的原因:

安全护栏

行为

只读访问

无论模型生成什么,连接器都不会发出写操作

PII 脱敏

匹配 emailssnphonedobcredit_cardcvvpassportapi_keypassword 等列会在代理工具内部被脱敏——脱敏后的值永远不会进入 LLM 上下文。额外的列可以手动标记

行数限制

每个请求都被限制在 [1, 1000] 行,无论代理或 MCP 客户端要求什么

超时限制

每个查询都被限制在 [1s, 30s]

Zod 验证工具

MCP 工具输入在接触连接器之前会经过模式检查

MCP 服务器

MCP 服务器注册了三个工具:

  • connectDatabase — 在你选择的 connectionId 下注册一个 Postgres 或 MongoDB 连接

  • askQuestion — 针对已注册的连接提出自然语言问题;返回一个 Markdown 表格以及一个建议的可视化方案

  • 以及一个连接列表工具,用于查看已注册的内容

结果以 Markdown 表格形式返回(显示上限为 50 行),并附带一个图表建议——barlinetablenone——该建议根据结果的形状推导而来,而非由模型猜测。

在 MCP 客户端中配置

{
  "mcpServers": {
    "uniquery": {
      "command": "node",
      "args": ["/path/to/uniquery/packages/mcp-server/dist/index.js"]
    }
  }
}

然后,在客户端中:

analytics 身份连接到 postgres://… 处的 Postgres,然后告诉我上个季度创收最多的五个客户。

快速开始

需要 Node.js >= 20 和 pnpm 11。

pnpm install
pnpm build

# web app
pnpm dev

# MCP server
node packages/mcp-server/dist/index.js

.env.example 复制为 .env.local,并填写你的数据库 URL 和 LLM 密钥——可以是 Vercel AI Gateway 密钥(默认)或带有 provider: "google" 的 Google Gemini 密钥。

技术栈

TypeScript · pnpm workspaces · Model Context Protocol SDK · Vercel AI SDK 6 · Google Gemini · Neon serverless Postgres · MongoDB · Zod · Next.js 16 · Recharts · Vitest

状态

可用的原型。引擎、安全护栏和 MCP 服务器均可正常工作;Web 应用覆盖了核心的查询和图表流程。

许可证

MIT

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    A
    quality
    C
    maintenance
    Enables 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.
    11
    1
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables governed, agent-agnostic data exploration by allowing users to ask natural language questions through MCP-compatible agents, executing safe, permission-scoped queries against data sources and returning interactive charts.
    48
    Apache 2.0
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables natural language querying of SQL databases and REST APIs through the MCP protocol, grounded in a semantic layer.
    2,309
    1
    AGPL 3.0
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables 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.

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yashdhingra0/uniquery'

If you have feedback or need assistance with the MCP directory API, please join our Discord server