omnidb-mcp

MCP安全风控

提供方 AyushJain070401 · 包名 mcp-database-server

安全风控 stdio · 本地进程 会话登录 社区 / 第三方 Claude DesktopClaudeZed
查看接入方式

An MCP-based database connectivity server that enables any LLM to securely connect to and query 22 mainstream databases, ideal for AI assistants like Claude to explore, analyze, and operate on data.

一句话选型结论

按资料字段整理

omnidb-mcp 属于安全风控类 MCP 服务器,stdio · 本地进程,会话登录,可直接接入 Claude Desktop、Claude、Zed,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类安全风控 传输方式stdio · 本地进程 鉴权会话登录 部署方式本地部署
GitHub 星标 1 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

安全风控
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

Local Deployment Database Connectivity MCP Protocol TypeScript LLM Integration SQL Query NoSQL Support AI Data Access Data Security Multi-Database Adapter

支持客户端

适用场景

Local DeploymentDatabase ConnectivityMCP Protocol

安装与配置

stdio · 本地进程 会话登录
客户端在本机拉起子进程,数据不出本机
npx -y mcp-database-server

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 node,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
资产与漏洞排查

盘点资产、扫漏洞、看暴露面。

日志与审计

汇总日志、查异常行为。

合规检查

按规则检查配置与权限是否合规。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude、Zed,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好会话登录对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在安全风控场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
omnidb-mcp当前 未标注 stdio · 本地进程 本地部署 有 2026-03-08
Cyber Strike AI 75 未标注 未标注 无 2026-05-17
mcp-for-beginners 未标注 stdio · 本地进程 本地部署 有 2026-04-13
casdoor 未标注 stdio · 本地进程 本地部署 有 2026-04-12
kubeshark 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Modelcontextprotocol C22988b0 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

安全风控
字段来自项目仓库与公开索引,中文说明由本站标注
提供方AyushJain070401上游标注的维护方 AyushJain070401
分类安全风控本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式会话登录远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时mcp-database-server · node本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-03-08上游最后核验时间

详细介绍

51.9 KB
来自项目仓库与上游目录的原文,未做删改

🗄️ mcp-database-server

Connect any LLM to 22 databases in seconds.

> One MCP server. Every database you'll ever need. Secure by default. Zero boilerplate.

Built on the Model Context Protocol (MCP) — the open standard that lets AI assistants talk to your databases safely.```
┌──────────────┐ ┌─────────────────────────┐ ┌──────────────────┐
│ │ │ │ │ PostgreSQL │
│ Claude / │◄────►│ mcp-database-server │◄────►│ MySQL │
│ Any LLM │ MCP │ │ │ MongoDB │
│ │ │ • Security Layer │ │ Redis │
│ │ │ • Rate Limiting │ │ ... 18 more │
└──────────────┘ │ • Audit Logging │ └──────────────────┘
└─────────────────────────┘


---

## 📑 Table of Contents

- What Does This Do?
- Supported Databases
- Installation
- Quick Start (5 minutes)
- Setup with Claude Desktop
- Setup with Claude Code
- Setup with Config File
- All MCP Tools Reference
- **Database Guides** (click any to jump):
  - PostgreSQL
  - MySQL
  - MariaDB
  - SQLite
  - Microsoft SQL Server
  - Oracle
  - CockroachDB
  - Neon (Serverless Postgres)
  - Supabase
  - PlanetScale
  - TiDB
  - SingleStore
  - MongoDB
  - Redis
  - Cassandra / ScyllaDB
  - ClickHouse
  - Neo4j
  - DynamoDB
  - Elasticsearch / OpenSearch
  - CouchDB
  - InfluxDB
  - Firestore
- Security
- Environment Variables Reference
- Troubleshooting
- Publishing to NPM
- Architecture
- License

---

## 🤔 What Does This Do?

Imagine you could say to Claude:

> *"Show me all users who signed up last week"*

...and Claude actually queries your PostgreSQL database, gets the results, and shows you the data. That's what this does.

**Without this tool**, Claude has no way to talk to your databases.
**With this tool**, Claude can:

- ✅ Run queries on any of your databases
- ✅ Explore tables and schemas
- ✅ Understand your data model (columns, types, foreign keys)
- ✅ Work across multiple databases at once
- ✅ Do it all securely (read-only mode, injection protection, rate limits, audit logs)

---

## 🎯 Supported Databases (22)

| # | Database | Category | NPM Driver to Install |
|---|----------|----------|-----------------------|
| 1 | **PostgreSQL** | Relational | `npm install pg` |
| 2 | **MySQL** | Relational | `npm install mysql2` |
| 3 | **MariaDB** | Relational | `npm install mysql2` |
| 4 | **SQLite** | Relational | `npm install better-sqlite3` |
| 5 | **MS SQL Server** | Relational | `npm install tedious` |
| 6 | **Oracle** | Relational | `npm install oracledb` |
| 7 | **CockroachDB** | NewSQL | `npm install pg` |
| 8 | **Neon** | Serverless Postgres | `npm install pg` |
| 9 | **Supabase** | BaaS (Postgres) | `npm install pg` |
| 10 | **PlanetScale** | Serverless MySQL | `npm install mysql2` |
| 11 | **TiDB** | NewSQL | `npm install mysql2` |
| 12 | **SingleStore** | NewSQL | `npm install mysql2` |
| 13 | **MongoDB** | Document | `npm install mongodb` |
| 14 | **Redis** | Key-Value | `npm install redis` |
| 15 | **Cassandra** / ScyllaDB | Wide Column | `npm install cassandra-driver` |
| 16 | **ClickHouse** | Analytics | `npm install @clickhouse/client` |
| 17 | **Neo4j** | Graph | `npm install neo4j-driver` |
| 18 | **DynamoDB** | AWS Key-Value | `npm install @aws-sdk/client-dynamodb @aws-sdk/lib-dynamodb` |
| 19 | **Elasticsearch** / OpenSearch | Search | `npm install @elastic/elasticsearch` |
| 20 | **CouchDB** | Document | `npm install nano` |
| 21 | **InfluxDB** | Time Series | `npm install @influxdata/influxdb-client` |
| 22 | **Firestore** | Google Cloud Document | `npm install firebase-admin` |

> **Important:** You only install drivers for databases you actually use. Don't install all of them!

---

## 📦 Installation

### Step 1: Install the server```bash
npm install -g mcp-database-server

Step 2: Install ONLY the database driver(s) you need

Using PostgreSQL? Install pg:```bash
npm install -g pg


Using MongoDB? Install `mongodb`:```bash
npm install -g mongodb

Using multiple databases? Install multiple:```bash
npm install -g pg mongodb redis


That's it. You're ready.

---

## 🚀 Quick Start (5 minutes)

The fastest way to try it out:

### Option A: Environment Variables (simplest)```bash
# Set your database details
export MCP_DB_ENGINE=postgresql
export MCP_DB_HOST=localhost
export MCP_DB_PORT=5432
export MCP_DB_DATABASE=myapp
export MCP_DB_USER=postgres
export MCP_DB_PASSWORD=mypassword

# Run the server
npx mcp-database-server

Option B: Connection String (one line)```bash

export MCP_DB_ENGINE=postgresql
export MCP_DB_URL="postgresql://postgres:mypassword@localhost:5432/myapp"

npx mcp-database-server


### Option C: Config File (most flexible)```bash
# Copy the example
cp config.example.json config.json

# Edit it with your details
nano config.json

# Run it
MCP_DB_CONFIG=./config.json npx mcp-database-server

🖥️ Setup with Claude Desktop

Claude Desktop uses a config file at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Open that file and add:```json
{
"mcpServers": {
"database": {
"command": "npx",
"args": ["-y", "mcp-database-server"],
"env": {
"MCP_DB_ENGINE": "postgresql",
"MCP_DB_HOST": "localhost",
"MCP_DB_PORT": "5432",
"MCP_DB_DATABASE": "myapp",
"MCP_DB_USER": "postgres",
"MCP_DB_PASSWORD": "secret"
}
}
}
}


**Save the file, restart Claude Desktop.** That's it.

Now you can open Claude and say:
> *"Show me all tables in my database"*

---

## 💻 Setup with Claude Code```bash
# Simple: one database
claude mcp add database -- npx -y mcp-database-server

# With config file
claude mcp add database -- env MCP_DB_CONFIG=./config.json npx -y mcp-database-server

📁 Setup with Config File

Create a file called config.json:```json
{
"server": {
"name": "my-databases",
"logLevel": "info"
},

"connections": [
{
"id": "my-postgres",
"engine": "postgresql",
"host": "localhost",
"port": 5432,
"database": "myapp",
"username": "postgres",
"password": "secret",
"readOnly": true
}
],

"security": {
"sqlInjectionProtection": true,
"allowDDL": false,
"allowDML": true,
"rateLimitPerMinute": 120,
"auditLogging": true
}
}


### Multiple databases in one config:```json
{
  "connections": [
    {
      "id": "app-db",
      "engine": "postgresql",
      "connectionString": "postgresql://user:pass@host:5432/myapp",
      "readOnly": true
    },
    {
      "id": "cache",
      "engine": "redis",
      "host": "localhost",
      "port": 6379
    },
    {
      "id": "analytics",
      "engine": "clickhouse",
      "host": "localhost",
      "port": 8123,
      "database": "analytics",
      "readOnly": true
    }
  ],
  "security": {
    "allowDDL": false,
    "rateLimitPerMinute": 60
  }
}

🛠 All MCP Tools Reference

Once the server is running, these tools are available to the LLM:

list_supported_databases

Lists all 22 database engines with categories and aliases.

Example prompt to Claude:
> "What databases can you connect to?"


connect

Opens a new connection to a database.

Parameters:

Parameter Required Description
connection_id ✅ A name you pick, e.g. "my-postgres"
engine ✅ Database type, e.g. "postgresql"
connection_string Full URI, e.g. "postgresql://user:pass@host:5432/db"
host Hostname or IP
port Port number
database Database name
username Username
password Password
ssl true to enable SSL
read_only true to block all writes
region AWS region (DynamoDB only)
project_id GCP project ID (Firestore only)

Example prompt to Claude:
> "Connect to my PostgreSQL database at localhost, port 5432, database called myapp, user postgres, password secret"


disconnect

Closes a connection.

Example prompt:
> "Disconnect from my-postgres"


list_connections

Shows all open connections and their health status (🟢 or 🔴).

Example prompt:
> "Show me all active database connections"


query

Executes a query. This is the main tool. Works differently for each database type — see the database-specific guides below.

Parameters:

Parameter Required Description
connection_id ✅ Which connection to query
sql ✅ The query (SQL, Cypher, JSON, or Flux)
params Array of parameter values for safe queries

Example prompt:
> "Run this query on my-postgres: SELECT name, email FROM users WHERE created_at > '2024-01-01'"


list_tables

Lists all tables, collections, indexes, or key patterns.

Example prompt:
> "What tables are in my-postgres?"


describe_table

Shows the full schema of a table: column names, types, primary keys, foreign keys, indexes.

Example prompt:
> "Describe the users table in my-postgres"


list_schemas

Lists available schemas, databases, or keyspaces.

Example prompt:
> "What schemas are available in my-postgres?"


ping

Health check — tells you if a connection is alive.

Example prompt:
> "Is my-postgres still connected?"


get_server_info

Gets the database version info.

Example prompt:
> "What version of PostgreSQL is my-postgres running?"


get_audit_log

Shows recent query history for security review.

Example prompt:
> "Show me the last 20 queries that were run"


get_security_config

Displays the current security policy settings.

Example prompt:
> "What security settings are active?"



📘 Database Guides

Each guide below shows you exactly how to set up and use each database, with copy-paste examples.



🐘 PostgreSQL

What it is: The world's most popular open-source relational database.

Install the driver```bash

npm install -g pg


### Claude Desktop config```json
{
  "mcpServers": {
    "database": {
      "command": "npx",
      "args": ["-y", "mcp-database-server"],
      "env": {
        "MCP_DB_ENGINE": "postgresql",
        "MCP_DB_HOST": "localhost",
        "MCP_DB_PORT": "5432",
        "MCP_DB_DATABASE": "myapp",
        "MCP_DB_USER": "postgres",
        "MCP_DB_PASSWORD": "secret",
        "MCP_DB_READ_ONLY": "true",
        "MCP_DB_SSL": "false"
      }
    }
  }
}

Using a connection string instead```json

{
"env": {
"MCP_DB_ENGINE": "postgresql",
"MCP_DB_URL": "postgresql://postgres:secret@localhost:5432/myapp?sslmode=require"
}
}


### Config file version```json
{
  "connections": [{
    "id": "my-postgres",
    "engine": "postgresql",
    "host": "localhost",
    "port": 5432,
    "database": "myapp",
    "username": "postgres",
    "password": "secret",
    "readOnly": true,
    "ssl": { "enabled": false },
    "pool": { "min": 1, "max": 10 },
    "queryTimeout": 30000,
    "maxRows": 1000
  }]
}

Query examples

Simple SELECT:```sql
SELECT * FROM users WHERE active = true ORDER BY created_at DESC LIMIT 10


**With parameters (safe — prevents SQL injection):**```
sql:    "SELECT * FROM users WHERE age > $1 AND city = $2"
params: [25, "London"]

JOINs:```sql
SELECT u.name, o.total, o.created_at
FROM users u
JOIN orders o ON o.user_id = u.id
WHERE o.total > 100
ORDER BY o.created_at DESC
LIMIT 20


**Aggregation:**```sql
SELECT
  DATE_TRUNC('month', created_at) AS month,
  COUNT(*) AS signups,
  AVG(age) AS avg_age
FROM users
GROUP BY month
ORDER BY month DESC

INSERT (only works if readOnly is false):```
sql: "INSERT INTO users (name, email, age) VALUES ($1, $2, $3)"
params: ["Alice", "alice@example.com", 30]


**UPDATE:**```
sql:    "UPDATE users SET active = false WHERE last_login < $1"
params: ["2024-01-01"]

Example prompts to Claude

> "Show me all users who signed up this month"
>
> "What are the top 10 products by revenue?"
>
> "Find all orders that haven't been shipped yet"
>
> "How many users signed up each week for the last 3 months?"
>
> "Show me the schema of the orders table"


🐬 MySQL

What it is: The world's most popular open-source relational database (used by Facebook, Twitter, YouTube).

Install the driver```bash

npm install -g mysql2


### Claude Desktop config```json
{
  "mcpServers": {
    "database": {
      "command": "npx",
      "args": ["-y", "mcp-database-server"],
      "env": {
        "MCP_DB_ENGINE": "mysql",
        "MCP_DB_HOST": "localhost",
        "MCP_DB_PORT": "3306",
        "MCP_DB_DATABASE": "myapp",
        "MCP_DB_USER": "root",
        "MCP_DB_PASSWORD": "secret",
        "MCP_DB_READ_ONLY": "true"
      }
    }
  }
}

Connection string version```json

{
"env": {
"MCP_DB_ENGINE": "mysql",
"MCP_DB_URL": "mysql://root:secret@localhost:3306/myapp"
}
}


### Query examples

**Simple SELECT:**```sql
SELECT * FROM products WHERE price > 50 ORDER BY price DESC LIMIT 10

With parameters (use ? placeholders):```
sql: "SELECT * FROM users WHERE country = ? AND age >= ?"
params: ["India", 18]


**GROUP BY:**```sql
SELECT category, COUNT(*) AS product_count, AVG(price) AS avg_price
FROM products
GROUP BY category
ORDER BY product_count DESC

Example prompts to Claude

> "What are the most expensive products in each category?"
>
> "Show me all customers who haven't ordered in 6 months"
>
> "Count how many orders we got per day this week"


🦭 MariaDB

What it is: A drop-in replacement for MySQL, created by MySQL's original developers. Uses the exact same driver and syntax as MySQL.

Install the driver```bash

npm install -g mysql2


### Claude Desktop config```json
{
  "mcpServers": {
    "database": {
      "command": "npx",
      "args": ["-y", "mcp-database-server"],
      "env": {
        "MCP_DB_ENGINE": "mariadb",
        "MCP_DB_HOST": "localhost",
        "MCP_DB_PORT": "3306",
        "MCP_DB_DATABASE": "myapp",
        "MCP_DB_USER": "root",
        "MCP_DB_PASSWORD": "secret"
      }
    }
  }
}

Query examples

Same as MySQL! Use ? for parameters:```
sql: "SELECT * FROM orders WHERE status = ? AND total > ?"
params: ["pending", 100]


---

## 📁 SQLite

**What it is:** A file-based database. No server needed. Perfect for local apps, prototyping, or embedded databases.

### Install the driver```bash
npm install -g better-sqlite3

Claude Desktop config```json

{
"mcpServers": {
"database": {
"command": "npx",
"args": ["-y", "mcp-database-server"],
"env": {
"MCP_DB_ENGINE": "sqlite",
"MCP_DB_DATABASE": "/path/to/your/database.db",
"MCP_DB_READ_ONLY": "true"
}
}
}
}


### Using in-memory SQLite (for testing)```json
{
  "env": {
    "MCP_DB_ENGINE": "sqlite",
    "MCP_DB_DATABASE": ":memory:"
  }
}

Query examples

Standard SQL works:```sql
SELECT * FROM todos WHERE completed = 0 ORDER BY created_at DESC


**With parameters (use positional `?`):**```
sql:    "SELECT * FROM notes WHERE tag = ? AND archived = ?"
params: ["work", 0]

Check table info:```sql
PRAGMA table_info('users')


### Example prompts to Claude

> *"Open my local database at /Users/me/app/data.db and show me all tables"*
>
> *"How many records are in the notes table?"*

---

## 🏢 Microsoft SQL Server (MSSQL)

**What it is:** Microsoft's enterprise relational database.

### Install the driver```bash
npm install -g tedious

Claude Desktop config```json

{
"mcpServers": {
"database": {
"command": "npx",
"args": ["-y", "mcp-database-server"],
"env": {
"MCP_DB_ENGINE": "mssql",
"MCP_DB_HOST": "localhost",
"MCP_DB_PORT": "1433",
"MCP_DB_DATABASE": "MyDatabase",
"MCP_DB_USER": "sa",
"MCP_DB_PASSWORD": "YourStrong!Passw0rd",
"MCP_DB_SSL": "true"
}
}
}
}


### Query examples

**Note:** MSSQL uses `@p0`, `@p1`, `@p2` for parameter placeholders.```
sql:    "SELECT TOP 10 * FROM Employees WHERE Department = @p0 AND Salary > @p1"
params: ["Engineering", 80000]

Pagination with OFFSET/FETCH:```sql
SELECT * FROM Products
ORDER BY ProductName
OFFSET 20 ROWS
FETCH NEXT 10 ROWS ONLY


### Example prompts to Claude

> *"Show me all employees in the Engineering department"*
>
> *"What's the average salary by department?"*

---

## 🔮 Oracle

**What it is:** Oracle's enterprise relational database. Used by banks, governments, and Fortune 500 companies.

### Install the driver```bash
npm install -g oracledb

> Note: Oracle Instant Client must also be installed on your system. See Oracle's install guide.

Claude Desktop config```json

{
"mcpServers": {
"database": {
"command": "npx",
"args": ["-y", "mcp-database-server"],
"env": {
"MCP_DB_ENGINE": "oracle",
"MCP_DB_HOST": "localhost",
"MCP_DB_PORT": "1521",
"MCP_DB_DATABASE": "ORCL",
"MCP_DB_USER": "hr",
"MCP_DB_PASSWORD": "secret"
}
}
}
}


### Query examples

**Note:** Oracle uses `:1`, `:2`, `:3` for parameter placeholders.```
sql:    "SELECT * FROM employees WHERE department_id = :1 AND salary > :2"
params: [60, 5000]

🪳 CockroachDB

What it is: A distributed SQL database built for global scale. Wire-compatible with PostgreSQL.

Install the driver```bash

npm install -g pg


### Claude Desktop config```json
{
  "mcpServers": {
    "database": {
      "command": "npx",
      "args": ["-y", "mcp-database-server"],
      "env": {
        "MCP_DB_ENGINE": "cockroachdb",
        "MCP_DB_URL": "postgresql://user:pass@localhost:26257/defaultdb?sslmode=verify-full",
        "MCP_DB_READ_ONLY": "true"
      }
    }
  }
}

Query examples

Uses standard PostgreSQL syntax. Same $1, $2 parameters:```
sql: "SELECT * FROM accounts WHERE balance > $1"
params: [1000]


---

## ⚡ Neon (Serverless Postgres)

**What it is:** Serverless PostgreSQL. Scales to zero. Pay per query.

### Install the driver```bash
npm install -g pg

Claude Desktop config```json

{
"mcpServers": {
"database": {
"command": "npx",
"args": ["-y", "mcp-database-server"],
"env": {
"MCP_DB_ENGINE": "neon",
"MCP_DB_URL": "postgresql://user:pass@ep-cool-name-123456.us-east-2.aws.neon.tech/neondb?sslmode=require",
"MCP_DB_SSL": "true",
"MCP_DB_READ_ONLY": "true"
}
}
}
}


> **Where to find your connection string:** Neon Console → Your Project → Connection Details → Copy the connection string.

### Query examples

Standard PostgreSQL syntax. Same as PostgreSQL above.

---

## 🟢 Supabase

**What it is:** An open-source Firebase alternative built on PostgreSQL.

### Install the driver```bash
npm install -g pg

Claude Desktop config```json

{
"mcpServers": {
"database": {
"command": "npx",
"args": ["-y", "mcp-database-server"],
"env": {
"MCP_DB_ENGINE": "supabase",
"MCP_DB_URL": "postgresql://postgres.xxxxxxxxxxxx:YOUR-PASSWORD@aws-0-us-east-1.pooler.supabase.com:6543/postgres",
"MCP_DB_SSL": "true",
"MCP_DB_READ_ONLY": "true"
}
}
}
}


> **Where to find your connection string:** Supabase Dashboard → Settings → Database → Connection string → URI.

### Query examples

Standard PostgreSQL syntax. Same as PostgreSQL above.

---

## 🪐 PlanetScale

**What it is:** Serverless MySQL platform by Vitess.

### Install the driver```bash
npm install -g mysql2

Claude Desktop config```json

{
"mcpServers": {
"database": {
"command": "npx",
"args": ["-y", "mcp-database-server"],
"env": {
"MCP_DB_ENGINE": "planetscale",
"MCP_DB_HOST": "aws.connect.psdb.cloud",
"MCP_DB_USER": "xxxxxxxxxx",
"MCP_DB_PASSWORD": "pscale_pw_xxxxxxxx",
"MCP_DB_DATABASE": "mydb",
"MCP_DB_SSL": "true",
"MCP_DB_READ_ONLY": "true"
}
}
}
}


### Query examples

Standard MySQL syntax. Use `?` for parameters:```
sql:    "SELECT * FROM orders WHERE status = ?"
params: ["shipped"]

⚡ TiDB

What it is: An open-source, distributed SQL database compatible with MySQL.

Install the driver```bash

npm install -g mysql2


### Claude Desktop config```json
{
  "mcpServers": {
    "database": {
      "command": "npx",
      "args": ["-y", "mcp-database-server"],
      "env": {
        "MCP_DB_ENGINE": "tidb",
        "MCP_DB_HOST": "gateway01.us-east-1.prod.aws.tidbcloud.com",
        "MCP_DB_PORT": "4000",
        "MCP_DB_DATABASE": "mydb",
        "MCP_DB_USER": "root",
        "MCP_DB_PASSWORD": "secret",
        "MCP_DB_SSL": "true"
      }
    }
  }
}

Query examples

Standard MySQL syntax. Same as MySQL above.


⚡ SingleStore

What it is: A distributed SQL database designed for real-time analytics. MySQL-compatible.

Install the driver```bash

npm install -g mysql2


### Claude Desktop config```json
{
  "mcpServers": {
    "database": {
      "command": "npx",
      "args": ["-y", "mcp-database-server"],
      "env": {
        "MCP_DB_ENGINE": "singlestore",
        "MCP_DB_HOST": "svc-xxxxxxxxxx.svc.singlestore.com",
        "MCP_DB_PORT": "3306",
        "MCP_DB_DATABASE": "mydb",
        "MCP_DB_USER": "admin",
        "MCP_DB_PASSWORD": "secret",
        "MCP_DB_SSL": "true"
      }
    }
  }
}

🍃 MongoDB

What it is: The most popular document database. Stores data as flexible JSON-like documents instead of rows and columns.

Install the driver```bash

npm install -g mongodb


### Claude Desktop config```json
{
  "mcpServers": {
    "database": {
      "command": "npx",
      "args": ["-y", "mcp-database-server"],
      "env": {
        "MCP_DB_ENGINE": "mongodb",
        "MCP_DB_URL": "mongodb://localhost:27017/myapp",
        "MCP_DB_DATABASE": "myapp",
        "MCP_DB_READ_ONLY": "true"
      }
    }
  }
}

MongoDB Atlas (cloud)```json

{
"env": {
"MCP_DB_ENGINE": "mongodb",
"MCP_DB_URL": "mongodb+srv://user:pass@cluster0.xxxxx.mongodb.net/myapp?retryWrites=true&w=majority",
"MCP_DB_DATABASE": "myapp"
}
}


### How MongoDB queries work

MongoDB does NOT use SQL. Instead, you pass a **JSON command**. Here's the format:```json
{
  "collection": "name_of_collection",
  "operation": "find|findOne|aggregate|insertOne|...",
  "filter": {},
  "projection": {},
  "sort": {},
  "limit": 100
}

Query examples

Find all documents in a collection:```json
{
"collection": "users",
"operation": "find",
"filter": {},
"limit": 50
}


**Find with filters:**```json
{
  "collection": "users",
  "operation": "find",
  "filter": { "age": { "$gt": 25 }, "city": "Mumbai" },
  "projection": { "name": 1, "email": 1 },
  "sort": { "name": 1 },
  "limit": 20
}

Find one document:```json
{
"collection": "users",
"operation": "findOne",
"filter": { "email": "alice@example.com" }
}


**Count documents:**```json
{
  "collection": "orders",
  "operation": "countDocuments",
  "filter": { "status": "pending" }
}

Aggregation pipeline:```json
{
"collection": "orders",
"operation": "aggregate",
"pipeline": [
{ "$match": { "status": "completed" } },
{ "$group": { "_id": "$product", "total": { "$sum": "$amount" } } },
{ "$sort": { "total": -1 } },
{ "$limit": 10 }
]
}


**Get distinct values:**```json
{
  "collection": "users",
  "operation": "distinct",
  "field": "country"
}

Insert one document (only if readOnly is false):```json
{
"collection": "users",
"operation": "insertOne",
"document": { "name": "Alice", "email": "alice@example.com", "age": 30 }
}


**Insert many documents:**```json
{
  "collection": "products",
  "operation": "insertMany",
  "documents": [
    { "name": "Widget A", "price": 9.99 },
    { "name": "Widget B", "price": 19.99 }
  ]
}

Update one document:```json
{
"collection": "users",
"operation": "updateOne",
"filter": { "email": "alice@example.com" },
"update": { "$set": { "age": 31, "updatedAt": "2024-06-01" } }
}


**Update many documents:**```json
{
  "collection": "users",
  "operation": "updateMany",
  "filter": { "active": false },
  "update": { "$set": { "archived": true } }
}

Delete one document:```json
{
"collection": "users",
"operation": "deleteOne",
"filter": { "email": "bob@example.com" }
}


**Delete many documents:**```json
{
  "collection": "logs",
  "operation": "deleteMany",
  "filter": { "createdAt": { "$lt": "2024-01-01" } }
}

Example prompts to Claude

> "Show me all users from India who are over 25"
>
> "What are the top 10 products by total sales?"
>
> "Count how many pending orders we have"
>
> "List all unique countries in our user database"


🔴 Redis

What it is: An in-memory key-value store. Blazing fast. Used for caching, sessions, queues, and real-time data.

Install the driver```bash

npm install -g redis


### Claude Desktop config```json
{
  "mcpServers": {
    "database": {
      "command": "npx",
      "args": ["-y", "mcp-database-server"],
      "env": {
        "MCP_DB_ENGINE": "redis",
        "MCP_DB_HOST": "localhost",
        "MCP_DB_PORT": "6379"
      }
    }
  }
}

With password and SSL (e.g., Redis Cloud)```json

{
"env": {
"MCP_DB_ENGINE": "redis",
"MCP_DB_URL": "rediss://default:your_password@redis-12345.c1.us-east-1-2.ec2.redns.redis-cloud.com:12345",
"MCP_DB_SSL": "true"
}
}


### How Redis queries work

Redis uses **commands**, not SQL. You can type them as plain text or JSON.

### Query examples (plain text)

**Get a value:**```
GET user:1001

Set a value:```
SET user:1001 "Alice"


**Set with expiry (60 seconds):**```
SET session:abc123 "token_data" EX 60

Get a hash (like an object):```
HGETALL user:1001


**Set hash fields:**```
HSET user:1001 name "Alice" age "30" city "Mumbai"

List all keys matching a pattern:```
KEYS user:*


**Delete a key:**```
DEL user:1001

Get list items:```
LRANGE myqueue 0 -1


**Increment a counter:**```
INCR page:views:homepage

Check key type:```
TYPE user:1001


**Get TTL (time to live):**```
TTL session:abc123

Query examples (JSON format)```json

{ "command": "HGETALL", "args": ["user:1001"] }

{ "command": "SET", "args": ["greeting", "hello world"] }
```

### Example prompts to Claude

> *"What's stored in the key user:1001?"*
>
> *"Show me all session keys"*
>
> *"How many page views does the homepage have?"*

---

## 📊 Cassandra / ScyllaDB

**What it is:** A wide-column distributed database designed for massive scale. Used by Apple, Netflix, Discord.

### Install the driver```bash
npm install -g cassandra-driver
```

### Claude Desktop config```json
{
  "mcpServers": {
    "database": {
      "command": "npx",
      "args": ["-y", "mcp-database-server"],
      "env": {
        "MCP_DB_ENGINE": "cassandra",
        "MCP_DB_HOST": "localhost",
        "MCP_DB_PORT": "9042",
        "MCP_DB_DATABASE": "my_keyspace",
        "MCP_DB_USER": "cassandra",
        "MCP_DB_PASSWORD": "cassandra"
      }
    }
  }
}
```

### Config file with datacenter```json
{
  "connections": [{
    "id": "my-cassandra",
    "engine": "cassandra",
    "host": "node1.example.com,node2.example.com",
    "port": 9042,
    "database": "my_keyspace",
    "username": "admin",
    "password": "secret",
    "options": { "datacenter": "us-east-1" }
  }]
}
```

### Query examples

Cassandra uses CQL (Cassandra Query Language), which looks like SQL:```
sql:    "SELECT * FROM users WHERE user_id = ? LIMIT 10"
params: ["user-abc-123"]

sql: "SELECT * FROM events WHERE partition_key = ? AND event_time > ? ALLOW FILTERING"
params: ["sensor-01", "2024-06-01T00:00:00Z"]


> ⚠️ **Important:** Cassandra requires you to query by partition key. You can't do arbitrary WHERE clauses like in PostgreSQL.

---

## ⚡ ClickHouse

**What it is:** A column-oriented database for blazing-fast analytics. Can process billions of rows per second.

### Install the driver```bash
npm install -g @clickhouse/client

Claude Desktop config```json

{
"mcpServers": {
"database": {
"command": "npx",
"args": ["-y", "mcp-database-server"],
"env": {
"MCP_DB_ENGINE": "clickhouse",
"MCP_DB_HOST": "localhost",
"MCP_DB_PORT": "8123",
"MCP_DB_DATABASE": "analytics",
"MCP_DB_USER": "default",
"MCP_DB_PASSWORD": "",
"MCP_DB_READ_ONLY": "true"
}
}
}
}


### ClickHouse Cloud```json
{
  "env": {
    "MCP_DB_ENGINE": "clickhouse",
    "MCP_DB_URL": "https://xxxx.clickhouse.cloud:8443",
    "MCP_DB_USER": "default",
    "MCP_DB_PASSWORD": "your-password",
    "MCP_DB_DATABASE": "default",
    "MCP_DB_SSL": "true"
  }
}

Query examples

Standard SQL works, with ClickHouse-specific functions:sql SELECT toDate(timestamp) AS day, count() AS events, uniq(user_id) AS unique_users FROM events WHERE timestamp >= now() - INTERVAL 7 DAY GROUP BY day ORDER BY day DESC ``````sql SELECT country, count() AS users, avg(session_duration) AS avg_duration FROM user_sessions GROUP BY country ORDER BY users DESC LIMIT 20

Example prompts to Claude

> "How many events did we get per day this week?"
>
> "What countries have the most active users?"
>

…(正文过长,页面只展示前面部分,完整内容见仓库)

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
omnidb-mcp 怎么安装?

在客户端按下面的安装命令接入:npx -y mcp-database-server。对应的包名是 mcp-database-server。装完在客户端配置里引用同一个包或端点。

omnidb-mcp 怎么在 Claude Desktop、Claude、Zed 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

omnidb-mcp 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

omnidb-mcp 需要 API Key 吗?

资料标注需要会话登录认证,使用前准备好对应凭据,并按最小权限配置。

omnidb-mcp 支持哪些客户端?

资料标注支持 Claude Desktop、Claude、Zed;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

omnidb-mcp 能提供哪些能力?

资料显示能力标签包括 Local Deployment、Database Connectivity、MCP Protocol、TypeScript、LLM Integration、SQL Query。具体工具清单以官方文档为准。

omnidb-mcp 需要什么运行环境?

运行时为 node;属于本地进程,需要在本机装好运行环境。

omnidb-mcp 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-03-08。