DB-Whisper

DB-Whisper

db-whisper•by404-unknow

A production-grade, AST-hardened database inspection tool based on the Model Context Protocol that lets AI assistants safely query databases in a read-only, controlled environment.

License: Not specified•Runtime: Awaiting documentation review•Category: databases storage

WHAT IT DOES

  • •Enforces a strict SELECT-only AST whitelist using a default-deny policy.
  • •Blocks access to system metadata tables such as information_schema, pg_catalog and SQLite aliases.
  • •Guarantees read-only at the driver level: SQLite readonly mode with query_only, and PostgreSQL queries run in BEGIN READ ONLY transactions.
  • •Applies rate limiting (default 10 queries per minute) and masks sensitive data such as passwords, API keys, emails and card numbers in logs.

BEST FOR

  • •AI assistants such as Cursor and Claude Desktop that need safe read-only database access.
  • •Teams wanting least-privilege database access restricted to an ALLOWED_TABLES whitelist.
  • •Production deployments needing query timeouts and SSL verification against man-in-the-middle attacks.

ABOUT DB-WHISPER

DB-Whisper is cataloged as an MCP server attributed to 404-unknow. A production-grade, AST-hardened database inspection tool based on the Model Context Protocol that lets AI assistants safely query databases in a read-only, controlled environment. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for DB-Whisper are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Which databases does DB-Whisper support?

It supports PostgreSQL and SQLite, using a Postgres URI or absolute SQLite path in DATABASE_URL.

What are the default query limits?

The default query timeout is 10000 ms and the rate limit is 10 queries per minute.

Does it limit SQL complexity?

Yes, it limits AST nodes to 150 and nesting depth to 8 to prevent resource-exhaustion attacks.

上游原版 README

在 GitHub 查看同一版本原文

README.md · a92fb1066417 · 采集于 2026-11-13 11:03:21 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

🛡️ DB-Whisper (Production-Hardened MCP Server)

[中文] | [English]

DB-Whisper 是一个基于 Anthropic Model Context Protocol (MCP) 的生产级数据库只读访问工具。它专为 AI 助手(如 Cursor, Claude Desktop)设计,提供严苛的安全边界和深度 AST 校验,确保 AI 只能在受控环境下安全地查询并理解你的数据库。

A production-grade, AST-hardened database inspection tool based on the Model Context Protocol (MCP). Designed for AI assistants (Cursor, Claude Desktop), providing strict security boundaries to ensure AI can safely query and understand your database in a read-only, controlled environment.


🌟 核心安全性 / Core Security (Production-Ready)

1. 深度 AST 防火墙 (Deep AST Firewall)

  • 🛡️ 严格白名单 (Strict Whitelist): 采用 Default Deny 策略,仅允许必要的 SELECT 节点类型。
  • 🚫 系统表隔离 (System Metadata Isolation): 彻底封堵对 information_schema, pg_catalog 以及 SQLite 3.33.0+ 别名(如 sqlite_schema, sqlite_temp_schema)的访问。
  • 🧩 复杂度限制 (Complexity Limits): 限制 AST 节点数 (≤150) 与嵌套深度 (≤8),防止通过超大规模 SQL 进行资源耗尽攻击。

2. 驱动级只读保障 (Driver-Level Read-Only)

  • 🗄️ SQLite 强制只读: 启用 readonly: true 模式并强制 PRAGMA query_only = ON。
  • 🐘 PostgreSQL 事务保障: 每一条查询均在 BEGIN READ ONLY 事务中执行,确保数据库层面无法写入。
  • 🔒 SSL 安全加固: 默认启用 rejectUnauthorized: true,防止中间人攻击。

3. 运行限流与脱敏 (Rate Limiting & Masking)

  • ⏱️ 令牌桶限流 (Rate Limiting): 默认限制为 10 次查询/分钟,防止 AI 滥用导致数据库负载过高。
  • 🤫 零信息泄露 (Zero Leakage): 安全拦截均返回通用错误信息,不泄露表名、列名等具体元数据。
  • 🕵️ 审计脱敏 (Audit Masking): 自动识别并脱敏日志中的密码、API Key、邮箱及信用卡号。

🚀 快速上手 / Quick Start

1. 配置建议 / Mandatory Setup (Least Privilege)

重要安全提示:请务必为 MCP 创建专用的 只读数据库用户,并配合环境变量进行权限细化。 Critical: Always use a dedicated Read-Only DB User.

2. 环境变量配置 / Environment Variables

变量说明默认值
DATABASE_URL数据库连接串 (Postgres URI 或 SQLite 绝对路径)(必填)
ALLOWED_TABLES表名白名单,用逗号分隔 (如 users,orders)* (仅黑名单模式)
DB_SSL是否强制启用 SSL 验证false
QUERY_TIMEOUT_MS单次查询硬超时时间10000

3. 在 Claude Desktop / Cursor 中集成

{
  "mcpServers": {
    "db-whisper": {
      "command": "npx",
      "args": ["-y", "db-whisper-mcp"],
      "env": {
        "DATABASE_URL": "postgresql://user:pass@localhost:5432/db",
        "ALLOWED_TABLES": "public_users,products",
        "NODE_ENV": "production"
      }
    }
  }
}

🛠️ 工程化支持 / Engineering & QA

  • 自动化测试: 已通过 vitest 实现 100% 对抗性安全测试,覆盖 SQLite 别名绕过、嵌套 DML 拦截及限流逻辑。
  • 依赖安全: 所有关键依赖已升级至最新版,并通过 npm audit 验证。
npm install   # 安装依赖
npm test      # 运行安全与限流测试 (需 DATABASE_URL 环境)
npm run build # 编译项目

🔗 相关资源 / Resources


Note: All logs are directed to stderr; stdout is reserved strictly for MCP protocol data.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for DB-Whisper from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/db-whisper)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related databases storage MCP Servers

Alternative and complementary servers in the same category

View all in databases storage →
AIStor MCP server
mcp-server-aistor•minio

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

Repository stats unavailable
Databases & Storage
InfluxDB v2 MCP Server
influxdb-mcp-server•idoru

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.

Repository stats unavailable
Databases & Storage