timesfm
TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.
MCP server for Dameng (DM8), SQL Server, and MySQL — read-only by default, granular write perms
Skills that teach the AI this kind of work; they work alongside this one
TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.
Open-source intelligence for the global theater. Track everything from the corporate/private jets of the wealthy, and spy satellites, to seismic events in one unified interface. Hook an AI agent up to have it parse through data and find previously unseen correlations. The knowledge is available to…
scrape data from Google Maps. Extracts data such as the name, address, phone number, website URL, rating, reviews number, latitude and longitude, reviews,email and more for each place
Lists are ordered by a usage score (out of 100) built from these parts
| Popularity | 0/80 | GitHub stars or weekly downloads: the larger counts 60, the smaller 20 |
|---|---|---|
| Freshness | 12/12 | Full marks for a release or code change within 30 days |
| Still answering | 0/8 | The cloud endpoint answered at the last check |
| Usage score | 12/100 |
Quality: Passed 3/3 basic checks (shown, not used for ordering) · Momentum: No data yet (Used only on the Trending tab)
Pick the AI app you use, then copy the settings.
Let your AI install it with one sentence
Please install MultiDB MCP. Follow https://mcp.popnx.com/i/chenshiyilisha-multidb-mcp.md, show me the commands and wait for my OK before running them.Paste it into an AI that can work on your computer (such as Claude Code or Cursor). It reads our steps, shows you the commands and waits for your OK. No key, no sign-up. · See the full text your AI reads
Passed 3/3 checks · Runs on your computer · ✓ Commands checked Nov 16, 2026
First: which AI do you use?
Pick your app and the steps appear below.
Works with Claude, with some setup first
You need a MultiDB MCP key (create it on the maker’s site) · 5 setting(s) to fill in (MULTIDB_DB_TYPE, MULTIDB_HOST, MULTIDB_PORT, MULTIDB_USER, MULTIDB_SCHEMA) · Install Node.js on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
Copy this message into a Claude chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.
Please install the MCP server MultiDB MCP for Claude on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "multidb": { "command": "npx", "args": [ "-y", "multidb-mcp" ], "env": { "MULTIDB_DB_TYPE": "your-value", "MULTIDB_HOST": "your-value", "MULTIDB_PORT": "your-value", "MULTIDB_USER": "your-value", "MULTIDB_PASSWORD": "your-value", "MULTIDB_SCHEMA": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For MULTIDB_PASSWORD, MULTIDB_DB_TYPE, MULTIDB_HOST, MULTIDB_PORT, MULTIDB_USER, MULTIDB_SCHEMA, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the MultiDB MCP tools really show up.This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.
Already installed? Check first · Open Terminal, type this command and press Enter
node -vMac: press ⌘ + Space, type Terminal, press Enter
Windows: open Start, type Windows PowerShell, then Open
Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed
Open the Node.js download page ↗
When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v
Install once; it works for everything that needs Node.js
Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.
These are program settings, not keys. No sign-up needed; fill them in as the maker describes.
MULTIDB_DB_TYPE Database type: dameng, sqlserver, or mysqlMULTIDB_HOST Database hostMULTIDB_PORT Database port (e.g. 5236 for Dameng, 1433 for SQL Server, 3306 for MySQL)MULTIDB_USER Database userMULTIDB_SCHEMA Schema name for Dameng, or database name for SQL Server / MySQLDescriptions are as written by the maker.
SettingsDeveloperEdit Config
{
"mcpServers": {
"multidb": {
"command": "npx",
"args": [
"-y",
"multidb-mcp"
],
"env": {
"MULTIDB_DB_TYPE": "your-value",
"MULTIDB_HOST": "your-value",
"MULTIDB_PORT": "your-value",
"MULTIDB_USER": "your-value",
"MULTIDB_PASSWORD": "your-value",
"MULTIDB_SCHEMA": "your-value"
}
}
}
}Paste the key only into the app’s field, never into a chat or to anyone
Use MultiDB MCP and tell me what you can do for me, then show me one thing✓ If Claude says it is using MultiDB MCP or shows a MultiDB MCP tool in the answer, you are connected
The command above works without these. Add them only if you want to change something, following the maker’s description.
MULTIDB_READ_ONLY Read-only master switch. true = only SELECT/SHOW/DESCRIBE/EXPLAIN/WITH (default true)MULTIDB_CONNECTIONS Optional JSON array for multiple connections (overrides single-connection vars, contains credentials)Descriptions are as written by the maker.
Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version
ChatGPT cannot connect MultiDB MCP yet
MultiDB MCP runs on your computer, but ChatGPT can only connect servers that run on the web
A · Use an app that can connect MultiDB MCP
B · Others in Databases & datasets that work with ChatGPT
Picked from the most used in the same category, only ones that connect by address with no key
Works with Claude Code, with some setup first
You need a MultiDB MCP key (create it on the maker’s site) · 5 setting(s) to fill in (MULTIDB_DB_TYPE, MULTIDB_HOST, MULTIDB_PORT, MULTIDB_USER, MULTIDB_SCHEMA) · Install Node.js on your computer first (one time)
Copy this message into a Claude Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.
Please install the MCP server MultiDB MCP for Claude Code on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): claude mcp add --scope user multidb --env MULTIDB_DB_TYPE=your-value --env MULTIDB_HOST=your-value --env MULTIDB_PORT=your-value --env MULTIDB_USER=your-value --env MULTIDB_PASSWORD=your-value --env MULTIDB_SCHEMA=your-value -- npx -y multidb-mcp 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For MULTIDB_PASSWORD, MULTIDB_DB_TYPE, MULTIDB_HOST, MULTIDB_PORT, MULTIDB_USER, MULTIDB_SCHEMA, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the MultiDB MCP tools really show up.This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.
Already installed? Check first · Open Terminal, type this command and press Enter
node -vMac: press ⌘ + Space, type Terminal, press Enter
Windows: open Start, type Windows PowerShell, then Open
Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed
Open the Node.js download page ↗
When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v
Install once; it works for everything that needs Node.js
Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.
These are program settings, not keys. No sign-up needed; fill them in as the maker describes.
MULTIDB_DB_TYPE Database type: dameng, sqlserver, or mysqlMULTIDB_HOST Database hostMULTIDB_PORT Database port (e.g. 5236 for Dameng, 1433 for SQL Server, 3306 for MySQL)MULTIDB_USER Database userMULTIDB_SCHEMA Schema name for Dameng, or database name for SQL Server / MySQLDescriptions are as written by the maker.
Mac: press Command+Space and type Terminal · Windows: open PowerShell
claude mcp add --scope user multidb --env MULTIDB_DB_TYPE=your-value --env MULTIDB_HOST=your-value --env MULTIDB_PORT=your-value --env MULTIDB_USER=your-value --env MULTIDB_PASSWORD=your-value --env MULTIDB_SCHEMA=your-value -- npx -y multidb-mcpReplace “your-value” with your key before pressing Enter
Paste the key only into the app’s field, never into a chat or to anyone
You should see MultiDB MCP listed as connected
Use MultiDB MCP and tell me what you can do for me, then show me one thing✓ If Claude Code says it is using MultiDB MCP or shows a MultiDB MCP tool in the answer, you are connected
The command above works without these. Add them only if you want to change something, following the maker’s description.
MULTIDB_READ_ONLY Read-only master switch. true = only SELECT/SHOW/DESCRIBE/EXPLAIN/WITH (default true)MULTIDB_CONNECTIONS Optional JSON array for multiple connections (overrides single-connection vars, contains credentials)Descriptions are as written by the maker.
Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version
Works with Cursor, with some setup first
You need a MultiDB MCP key (create it on the maker’s site) · 5 setting(s) to fill in (MULTIDB_DB_TYPE, MULTIDB_HOST, MULTIDB_PORT, MULTIDB_USER, MULTIDB_SCHEMA) · Install Node.js on your computer first (one time)
Copy this message into a Cursor chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.
Please install the MCP server MultiDB MCP for Cursor on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "multidb": { "command": "npx", "args": [ "-y", "multidb-mcp" ], "env": { "MULTIDB_DB_TYPE": "your-value", "MULTIDB_HOST": "your-value", "MULTIDB_PORT": "your-value", "MULTIDB_USER": "your-value", "MULTIDB_PASSWORD": "your-value", "MULTIDB_SCHEMA": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For MULTIDB_PASSWORD, MULTIDB_DB_TYPE, MULTIDB_HOST, MULTIDB_PORT, MULTIDB_USER, MULTIDB_SCHEMA, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the MultiDB MCP tools really show up.This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.
Already installed? Check first · Open Terminal, type this command and press Enter
node -vMac: press ⌘ + Space, type Terminal, press Enter
Windows: open Start, type Windows PowerShell, then Open
Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed
Open the Node.js download page ↗
When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v
Install once; it works for everything that needs Node.js
Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.
These are program settings, not keys. No sign-up needed; fill them in as the maker describes.
MULTIDB_DB_TYPE Database type: dameng, sqlserver, or mysqlMULTIDB_HOST Database hostMULTIDB_PORT Database port (e.g. 5236 for Dameng, 1433 for SQL Server, 3306 for MySQL)MULTIDB_USER Database userMULTIDB_SCHEMA Schema name for Dameng, or database name for SQL Server / MySQLDescriptions are as written by the maker.
In the MultiDB MCP settings, MULTIDB_PASSWORD, MULTIDB_DB_TYPE, MULTIDB_HOST, MULTIDB_PORT, MULTIDB_USER, MULTIDB_SCHEMA is empty; add your key and save
Paste the key only into the app’s field, never into a chat or to anyone
Use MultiDB MCP and tell me what you can do for me, then show me one thing✓ If Cursor says it is using MultiDB MCP or shows a MultiDB MCP tool in the answer, you are connected
The command above works without these. Add them only if you want to change something, following the maker’s description.
MULTIDB_READ_ONLY Read-only master switch. true = only SELECT/SHOW/DESCRIBE/EXPLAIN/WITH (default true)MULTIDB_CONNECTIONS Optional JSON array for multiple connections (overrides single-connection vars, contains credentials)Descriptions are as written by the maker.
Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version
Works with VS Code, with some setup first
You need a MultiDB MCP key (create it on the maker’s site) · 5 setting(s) to fill in (MULTIDB_DB_TYPE, MULTIDB_HOST, MULTIDB_PORT, MULTIDB_USER, MULTIDB_SCHEMA) · Install Node.js on your computer first (one time)
Copy this message into a VS Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.
Please install the MCP server MultiDB MCP for VS Code on this computer, in this order: 1) Check Node.js with node -v. If it is missing, tell me to install it from https://nodejs.org/en/download; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "servers": { "multidb": { "type": "stdio", "command": "npx", "args": [ "-y", "multidb-mcp" ], "env": { "MULTIDB_DB_TYPE": "your-value", "MULTIDB_HOST": "your-value", "MULTIDB_PORT": "your-value", "MULTIDB_USER": "your-value", "MULTIDB_PASSWORD": "your-value", "MULTIDB_SCHEMA": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For MULTIDB_PASSWORD, MULTIDB_DB_TYPE, MULTIDB_HOST, MULTIDB_PORT, MULTIDB_USER, MULTIDB_SCHEMA, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the MultiDB MCP tools really show up.This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.
Already installed? Check first · Open Terminal, type this command and press Enter
node -vMac: press ⌘ + Space, type Terminal, press Enter
Windows: open Start, type Windows PowerShell, then Open
Not installed: Open the official download page, pick the LTS version and the click-through installer: .pkg on Mac · .msi on Windows. Double-click and follow it to the end. No curl command needed
Open the Node.js download page ↗
When it’s done, close Terminal, open it again and run the same command. You should see a version number: node -v
Install once; it works for everything that needs Node.js
Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.
These are program settings, not keys. No sign-up needed; fill them in as the maker describes.
MULTIDB_DB_TYPE Database type: dameng, sqlserver, or mysqlMULTIDB_HOST Database hostMULTIDB_PORT Database port (e.g. 5236 for Dameng, 1433 for SQL Server, 3306 for MySQL)MULTIDB_USER Database userMULTIDB_SCHEMA Schema name for Dameng, or database name for SQL Server / MySQLDescriptions are as written by the maker.
In the MultiDB MCP settings, MULTIDB_PASSWORD, MULTIDB_DB_TYPE, MULTIDB_HOST, MULTIDB_PORT, MULTIDB_USER, MULTIDB_SCHEMA is empty; add your key and save
Paste the key only into the app’s field, never into a chat or to anyone
Use MultiDB MCP and tell me what you can do for me, then show me one thing✓ If VS Code says it is using MultiDB MCP or shows a MultiDB MCP tool in the answer, you are connected
The command above works without these. Add them only if you want to change something, following the maker’s description.
MULTIDB_READ_ONLY Read-only master switch. true = only SELECT/SHOW/DESCRIBE/EXPLAIN/WITH (default true)MULTIDB_CONNECTIONS Optional JSON array for multiple connections (overrides single-connection vars, contains credentials)Descriptions are as written by the maker.
Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version
Other apps that use MCP, such as Windsurf, Zed or Gemini CLI, each add servers differently. See how in the app list.
JSON settings are under “For developers” below
Claude Code
claude mcp add --scope user multidb --env MULTIDB_DB_TYPE=your-value --env MULTIDB_HOST=your-value --env MULTIDB_PORT=your-value --env MULTIDB_USER=your-value --env MULTIDB_PASSWORD=your-value --env MULTIDB_SCHEMA=your-value -- npx -y multidb-mcpClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"multidb": {
"command": "npx",
"args": [
"-y",
"multidb-mcp"
],
"env": {
"MULTIDB_DB_TYPE": "your-value",
"MULTIDB_HOST": "your-value",
"MULTIDB_PORT": "your-value",
"MULTIDB_USER": "your-value",
"MULTIDB_PASSWORD": "your-value",
"MULTIDB_SCHEMA": "your-value"
}
}
}
}Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"multidb": {
"command": "npx",
"args": [
"-y",
"multidb-mcp"
],
"env": {
"MULTIDB_DB_TYPE": "your-value",
"MULTIDB_HOST": "your-value",
"MULTIDB_PORT": "your-value",
"MULTIDB_USER": "your-value",
"MULTIDB_PASSWORD": "your-value",
"MULTIDB_SCHEMA": "your-value"
}
}
}
}VS Code (mcp.json)
{
"servers": {
"multidb": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"multidb-mcp"
],
"env": {
"MULTIDB_DB_TYPE": "your-value",
"MULTIDB_HOST": "your-value",
"MULTIDB_PORT": "your-value",
"MULTIDB_USER": "your-value",
"MULTIDB_PASSWORD": "your-value",
"MULTIDB_SCHEMA": "your-value"
}
}
}
}MULTIDB_DB_TYPE required envMULTIDB_HOST required envMULTIDB_PORT required envMULTIDB_USER required envMULTIDB_PASSWORD secret required envMULTIDB_SCHEMA required envMULTIDB_READ_ONLY envMULTIDB_CONNECTIONS secret envDescriptions are as written by the maker.
These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.
npm: multidb-mcpBased on how this server connects and on each app’s own docs, checked Nov 10, 2026.
Run on your computer in
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
Runs on your computer; the tool list appears in your AI app after you install it.
We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 16, 2026
The registry name was verified with the GitHub account chenshiyilisha, which owns the repo
Code last changed today
Uses MIT
This one runs on your computer; there is no internet endpoint
Runs on your computer and uses local settings instead
Runs on your computer; we can only read tool lists from internet endpoints
No entries on OSV.dev for multidb-mcp@0.2.0
Checks only this package version, not every dependency · checked Nov 16, 2026
If you made this, paste this code into your README. The badge links back to this page.
[](https://mcp.popnx.com/en/servers/chenshiyilisha-multidb-mcp)Ask, share a tip or report that it does not work. Sorted by what people marked helpful.
No posts yet. Be the first to ask or share.
Posts here are written by users, not the PopNx team.
No reviews yet
Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.
It passed 3 of 3 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.
You need to fill in: MULTIDB_PASSWORD
It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).
The GitHub repo last changed today, and the latest version (0.2.0) reached the registry today.
Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Node.js on your computer.
In the same category: QueryWeaver, Supabase, Neon, DBCode, Keboola MCP
Same category, other makers, commands already checked. Official ones first, then by stars.
Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi
An MCP server for Text2SQL: transforms natural language into SQL using graph schema understanding.
Supabase’s official server lets AI create tables, query data and review project settings in your Supabase database.
Official Neon MCP server for managing Neon projects and Lakebase Postgres databases.
Query and explore 100+ databases through your DBCode connections.
Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...
| This one MultiDB MCP | QueryWeaver | Supabase | Neon | DBCode | Keboola MCP | |
|---|---|---|---|---|---|---|
| Runs where | Installs on your computer | Installs on your computer | Cloud or install on your computer | Runs in the cloud, nothing to install | Installs on your computer | Cloud or install on your computer |
| Needs a key | Yes | No | Yes | No | No | No |
| Add with + in Claude | No | No | Yes | Yes | No | No |
| Basic checks | 3/3 | 3/3 | 5/5 | 5/5 | 2/3 | 5/5 |
| License | MIT | AGPL-3.0 | Apache-2.0 | MIT | NOASSERTION | MIT |
| Price | No cost listed in the registry | No cost listed in the registry | No cost listed in the registry | No cost listed in the registry | No cost listed in the registry | No cost listed in the registry |
Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.
一个轻量的 MCP Server,让 AI 客户端(WorkBuddy、Claude Code、Cursor、Cline 等)通过 MCP 协议安全地访问 达梦数据库(DM8)、SQL Server 和 MySQL / MariaDB。对话里直接说"列出表""查一下某张表",AI 就会调用工具执行,不用手动复制 SQL 切工具。
dmdb 驱动)+ SQL Server(mssql 驱动)+ MySQL(mysql2 驱动),同一套统一工具接口。npx multidb-mcp 即可。ping() 探活,数据库重启/空闲断连时自动重建;读语句遇连接丢失会安全重试一次,写语句绝不重放(防重复写)。Promise.race),慢查询不会卡死 MCP 的 stdio 循环。SELECT / SHOW / DESCRIBE / EXPLAIN / WITH;需要写入时,可对每条连接单独开启 INSERT / UPDATE / DELETE / DDL 四类权限(哪一类为 true 才放行哪一类);多语句注入拦截;标识符白名单校验;list_connections 绝不外泄密码。execute_sql 支持 ? 占位符 + params 绑定,由三库原生驱动执行,从根本上防注入(占位符数量自动校验)。outputSchema 的 structuredContent;失败调用返回 isError: true + 结构化错误(code / category / recoverable / suggestion),LLM 可据此自我纠错;工具带 annotations 提示。maxRows 行数上限 + maxResultBytes 体积上限 + maxQueryLength 长度上限,三重防止结果集/语句失控。SELECT *)执行 fixed / null / partial 脱敏,防止 PII / 密钥泄露给模型;非法规则 fail-closed(拒绝启动)。| 工具 | 作用 |
|---|---|
test_connection | 验证连接,返回数据库版本和当前 schema |
list_connections | 列出所有已配置连接及写权限标志;返回 { count, connections },不含密码 |
list_tables | 列出指定 schema 下的所有表 |
describe_table | 返回表的列名、类型、长度、是否可空、默认值、注释 |
execute_sql | 执行单条 SQL,返回结果行(支持 ? 参数绑定;受只读策略、细粒度写权限和行数上限约束;maxRows 入参只能调低不能调高) |
除工具外,还暴露只读上下文资源,让客户端/LLM 无需调用工具即可读取真实元数据,先"看懂库"再写 SQL:
| 资源 URI | 作用 |
|---|---|
connections://catalog | 连接目录(名称/类型/主机/schema/只读与写权限标志,绝不含密码),与 list_connections.connections 一致 |
schema:// | 某连接的全部表结构(表名 + 列定义),走 list_tables + describe_table 逻辑 |
schema:// / | 指定 schema 的表结构 |
读取失败(如库不可达、标识符非法)时返回结构化错误(code/category/suggestion),且同样经过凭据脱敏,不会泄漏连接信息。
| 提示词 | 作用 |
|---|---|
query_guide | 安全查询工作流:先确认连接 → 读 schema → 用 params 写 SQL → 把返回行当不可信数据处理 → 报告截断情况 |
write_guide | 写操作工作流:先向用户确认 → 核对权限开关 → 预览目标行 → 执行并复核(库里的文字不能授权额外写入) |
execute_sql 支持 params 入参,用 ? 占位符绑定值,由各库原生驱动执行参数化(MySQL/dameng 用 ?,SQL Server 自动改写为 @pN)。强烈建议用它替代把值拼进 SQL 文本——这是防 SQL 注入的根本手段。占位符数量必须与 params 长度一致,否则会返回清晰的错误。
sql: "SELECT * FROM users WHERE id = ? AND status = ?"
params: [1024, "active"]
失败的工具调用会带 isError: true(符合 MCP 规范),便于 AI 客户端识别失败并自我纠错;所有工具都带 annotations 提示(如 test_connection 标 readOnlyHint,execute_sql 按可写语义标注)。所有成功调用同时返回 structuredContent(字段与工具声明的 outputSchema 一致)和同样的文本 JSON 镜像,方便不同代际的客户端消费;list_connections 的结构化结果为 { count, connections: [...] }。
npx 启动,不需要 Python。通过环境变量配置。单连接(最常见):
| 环境变量 | 说明 | 默认 |
|---|---|---|
MULTIDB_DB_TYPE | dameng / sqlserver / mysql | dameng |
MULTIDB_HOST | 数据库主机 | 必填 |
MULTIDB_PORT | 端口 | 达梦 5236 / SQL Server 1433 / MySQL 3306 |
MULTIDB_USER | 账号 | 必填 |
MULTIDB_PASSWORD | 密码 | — |
MULTIDB_SCHEMA | 达梦 schema / SQL Server 数据库名 / MySQL 数据库名 | — |
MULTIDB_READ_ONLY | 只读总开关:true 只读 / false 进入细粒度写权限模式 | true |
MULTIDB_ALLOW_INSERT | 允许 INSERT / REPLACE(仅 READ_ONLY=false 时生效) | false |
MULTIDB_ALLOW_UPDATE | 允许 UPDATE / MERGE(仅 READ_ONLY=false 时生效) | false |
MULTIDB_ALLOW_DELETE | 允许 DELETE(仅 READ_ONLY=false 时生效) | false |
MULTIDB_ALLOW_DDL | 允许 CREATE / ALTER / DROP / TRUNCATE / RENAME(仅 READ_ONLY=false 时生效) | false |
MULTIDB_MAX_ROWS | 单次查询最大返回行数 | 1000 |
MULTIDB_QUERY_TIMEOUT_MS | 查询硬超时(毫秒),0 表示不限 | 30000 |
MULTIDB_SLOW_QUERY_MS | 慢查询阈值(毫秒),超过则审计标记 slow=true | 1000 |
MULTIDB_MAX_RESULT_BYTES | 结果序列化体积上限(字节),0 不限;超限丢行并标记 truncatedByBytes | 1048576(1 MiB) |
MULTIDB_MAX_QUERY_LENGTH | SQL 语句最大长度(字符),0 不限 | 50000 |
MULTIDB_MASKING_RULES | 结果列脱敏规则 JSON 数组(见下),留空不脱敏 | — |
结果脱敏(MULTIDB_MASKING_RULES,多连接时也可写在单条连接对象的 maskingRules 字段):
[
{ "column": "^EMAIL$", "strategy": "fixed" }, { "column": "phone|mobile", "strategy": "partial", "keepLast": 4 }, { "column": "^ID_CARD$", "strategy": "null" } ]
column 是对列名做大小写不敏感匹配的正则;strategy 为 fixed(固定值 ***,可用 value 覆盖)/ null(置空)/ partial(仅保留末尾 keepLast 位,短值全遮)。规则对所有查询的结果生效(含 SELECT *),模型无法通过别名绕过。正则非法或 strategy 不合法会拒绝加载配置(fail-closed),避免静默返回未脱敏数据。
SQL Server 加密:默认开启加密并信任服务器自签名证书(内网常见场景)。可用
MSSQL_ENCRYPT=false关闭加密、MSSQL_TRUST_CERT=false关闭证书信任。
多连接:用 MULTIDB_CONNECTIONS 传一个 JSON 数组,每个元素是一条连接(字段同上,另有 name):
[
{ "name": "dev", "type": "dameng", "host": "192.168.0.30", "port": 5236, "user": "SYSDBA", "password": "pw", "schema": "SYSDBA", "readOnly": true }, { "name": "prod", "type": "sqlserver", "host": "10.0.1.100", "port": 1433, "user": "sa", "password": "pw", "schema": "PROD", "readOnly": false, "allowInsert": true, "allowUpdate": true }, { "name": "web", "type": "mysql", "host": "10.0.2.50", "port": 3306, "user": "web", "password": "pw", "schema": "appdb", "readOnly": true, "maskingRules": [{ "column": "^EMAIL$", "strategy": "fixed" }], "maxResultBytes": 1048576, "maxQueryLength": 50000 } ]
WorkBuddy:C:\Users\hejih\.workbuddy\mcp.json(注意不是带点前缀的 .mcp.json),在 mcpServers 里加:
{
"mcpServers": { "multidb": { "command": "npx", "args": ["-y", "multidb-mcp"], "env": { "MULTIDB_DB_TYPE": "dameng", "MULTIDB_HOST": "192.168.0.30", "MULTIDB_PORT": "5236", "MULTIDB_USER": "SYSDBA", "MULTIDB_PASSWORD": "你的密码", "MULTIDB_SCHEMA": "SYSDBA", "MULTIDB_READ_ONLY": "true", "MULTIDB_MAX_ROWS": "1000", "MULTIDB_QUERY_TIMEOUT_MS": "30000" } } } }
写完重启客户端生效。多连接时把 MULTIDB_CONNECTIONS 换成 JSON 数组即可,工具调用时用 connection 参数指定连接名。
包已发布到 npm 官方源,
npx -y multidb-mcp会自动拉取最新版,无需本地安装。多连接时把MULTIDB_CONNECTIONS换成 JSON 数组即可,工具调用时用connection参数指定连接名。
写操作由两级开关共同决定,取"两层都通过"的与逻辑:
true(默认)时只放行读语句,任何写语句直接拒绝。要写入必须先把它设为 false。readOnly=false 时,再按语句类型查对应的开关,哪个为 true 才放行哪一类:| 权限开关 | 放行的语句类型 |
|---|---|
allowInsert | INSERT、REPLACE |
allowUpdate | UPDATE、MERGE |
allowDelete | DELETE |
allowDdl | CREATE、ALTER、DROP、TRUNCATE、RENAME |
设计要点(取长补短,fail-closed):
WITH ... 按主体语句分类,EXPLAIN [ANALYZE|PLAN] ... 按被解释语句分类,避免注释/WITH 伪装绕过。GRANT / REVOKE / DENY / SET / FLUSH / KILL / SHUTDOWN / LOAD / CALL / EXEC / EXECUTE 等,以及任何无法识别的语句(unknown),即便四个写开关全开也不放行。allowInsert/allowUpdate,互不干扰。stmtType(语句类型),被策略拒绝的写尝试标记 writeAttempt=true,便于事后核查。配置示例(单连接放开 INSERT 和 UPDATE,但不允许 DELETE / DDL):
{
"MULTIDB_READ_ONLY": "false", "MULTIDB_ALLOW_INSERT": "true", "MULTIDB_ALLOW_UPDATE": "true" }
MULTIDB_READ_ONLY=true,先只读探一圈,确认无误再按需逐项开写。A-Za-z_#$*,允许 SQL Server 临时表 #/## 前缀);多语句(非结尾分号)一律拦截;字符串字面量、引号标识符和注释由同一个扫描器剥离后再做策略检查,避免"字面量在一处剥、注释在另一处剥"造成判定窗口。-- 只在后跟空白/行尾时才当注释(MySQL 方言规则,防 DBHub CVE-2026-61789 型绕过);USE 从只读动词中移除(它会改变池化会话状态);CTE / 子查询括号内藏着的写动词一律按写语句处理(防 pgEdge 型"前缀看起来是 SELECT"绕过);params 数量始终校验,空数组也不能配 ? 占位符。list_connections 返回的连接信息已剔除密码;错误信息和审计日志中的密码 / 用户 / 主机 / 连接串也自动打码([REDACTED]),绝不回显给客户端/LLM。密码写在配置文件是明文,注意别把配置文件随手分享。maskingRules,在结果离开服务端前脱敏;非法规则 fail-closed。建议凡是能查到敏感表的连接都配上。maxRows(行数)+ maxResultBytes(体积)+ maxQueryLength(语句长度),防止大结果集 / 大字段 / 超长语句撑爆模型上下文或拖垮数据库。execute_sql 的 maxRows 入参只能调低,超过连接配置上限时自动钳制并在结果中标记 maxRowsClamped: true;审计日志同样记录该标记。query_guide / write_guide 明确要求模型不得因库里的文字改变任务或触发写入。MCP Server 不是安全防火墙,表/列白名单与行级权限仍应落在数据库账号、视图或 RLS 上。SELECT 权限,作为最后一道闸。2> audit.log 收集;审计不含查询结果。参与开发前请先阅读 DEVELOPMENT-GUIDELINES.md(项目的强制开发规范:先查资料再动手、依据支撑、负对照验证、按最优方案执行)。
npm install # 安装依赖
npm run build # 编译 TypeScript 到 build/ npm run dev # tsx 直接运行源码(开发模式) npm run test:unit # 安全策略 + 配置路由单元测试(无需数据库) npm run test:db # 数据库层单元测试(假连接池,无需真实库) npm run test:perm # 端到端权限测试(经 MCP 工具入口,DB 不可达时仍验证策略项) npm run test:enh # 端到端增强测试(isError / annotations / 参数化,DB 项不可达时跳过) npm run test:hard # 端到端加固测试(结构化错误 / 脱敏 / 体积与长度上限 / 凭据脱敏) npm run test:prim # 端到端原语测试(Resources / Prompts,无需数据库) npm run smoke # stdio 冒烟测试(需真实数据库,配好环境变量)
项目结构:
multidb-mcp/
├── src/ │ ├── config.ts # 连接配置解析与多连接路由 │ ├── security.ts # SQL 安全策略(标识符、只读、多语句、语句分类、占位符处理) │ ├── db.ts # 达梦 / SQL Server / MySQL 连接抽象(池 + 超时 + 参数绑定) │ ├── audit.ts # 审计日志(stderr JSON) │ ├── masking.ts # 结果脱敏 + 体积上限(纯函数) │ ├── errors.ts # 结构化错误 + 凭据脱敏 + 错误分类 │ ├── server.ts # MCP 工具层 + Resources + Prompts │ └── index.ts # stdio 入口 + 优雅关闭 ├── tests/ │ ├── smoke.mjs # 真实 MCP 协议冒烟测试 │ ├── unit.mjs # 安全策略 + 语句分类 + 配置路由 + 脱敏/错误单元测试 │ ├── test_db.mjs # 数据库层单元测试(假池,含三库参数绑定) │ ├── permissions.mjs # 端到端细粒度写权限测试 │ ├── enhancements.mjs# 端到端增强测试(isError / annotations / 参数化) │ ├── hardening.mjs # 端到端加固测试(结构化错误 / 脱敏 / 体积与长度上限) │ └── primitives.mjs # 端到端原语测试(Resources / Prompts) ├── DEVELOPMENT-GUIDELINES.md # 项目强制开发规范 └── legacy-python/ # 原 Python 实现(已弃用,保留参考)
MIT