Token导航 LogoToken导航TokenDH.com
Database Remote MCP logo
数据服务未说明官方级别未说明来源级核验

Database Remote MCP

MCP Server

一个通过Model Context Protocol (MCP)工具提供远程数据库访问功能的服务器,支持HTTP和stdio两种传输协议。

工具数

12

提示词数

0

GitHub Stars

0

资源数

0
数据分析远程服务TypeScriptClaudeHTTP传输Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

agts86

提供方

agts86

最后核验

2026/5/17 20:23

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

数据库远程MCP服务器

将远程数据库访问功能作为Model Context Protocol(MCP)工具公开的服务器。超文本传输协议标准 对较大场景进行渲染期间已观察到该故障。

概要

  • MCP_TRANSPORT 使用环境变量切换传输

- 未设定/ http →HTTP服务器模式(/mcp, /mcp/stream) - stdio →stdin/stdout MCP协议模式

  • DB_TYPE 根据需要自动切换运行时

- sqlserver / postgres / mysql ->RDBMS运行时 - mongodb ->NoSQL运行时

  • 使用环境变量控制工具的启用

- 关系数据库管理系统: ENABLED_TOOLS - NoSQL: ENABLED_NOSQL_TOOLS

当前功能

RDBMS工具

  • read_query
  • write_query
  • export_query
  • list_tables
  • describe_table
  • get_schema
  • create_table
  • alter_table
  • drop_table
  • append_insight
  • list_insights

NoSQL工具

  • list_collections(MongoDB的收藏一览取得)

NoSQL当前 list_collections 中所述修改相应参数的值。

支持数据库

  • SQL Server(mssql
  • PostgreSQL(pg
  • MySQL(mysql2
  • MongoDB(mongodb

系统要求

  • Node.js>=22
  • pnpm 推奨

起动

pnpm install
pnpm build
pnpm start          # HTTPモード(デフォルト)

stdio模式:

MCP_TRANSPORT=stdio pnpm start

开发模式(HTTP):

pnpm start:dev

MCP客户端设置示例

标准

克劳德代码/克劳德桌面

克劳德代码 —全局注册(可用于所有项目):

claude mcp add database-remote-mcp --scope user -e MCP_TRANSPORT=stdio -- \
  node --env-file=/path/to/database-remote-mcp/.env /path/to/database-remote-mcp/dist/main.js

克劳德代码 —项目本地(.mcp.json):

{
  "mcpServers": {
    "database-remote-mcp": {
      "command": "node",
      "args": [
        "--env-file=/path/to/database-remote-mcp/.env",
        "/path/to/database-remote-mcp/dist/main.js"
      ],
      "env": {
        "MCP_TRANSPORT": "stdio"
      }
    }
  }
}

克劳德桌面版claude_desktop_config.json:

{
  "mcpServers": {
    "database-remote-mcp": {
      "command": "node",
      "args": [
        "--env-file=/path/to/database-remote-mcp/.env",
        "/path/to/database-remote-mcp/dist/main.js"
      ],
      "env": {
        "MCP_TRANSPORT": "stdio"
      }
    }
  }
}

法典

~/.codex/config.toml:

[mcp_servers.database-remote-mcp]
command = "node"
args = [
  "--env-file=/path/to/database-remote-mcp/.env",
  "/path/to/database-remote-mcp/dist/main.js"
]

[mcp_servers.database-remote-mcp.env]
MCP_TRANSPORT = "stdio"

GitHub副本(VS代码)

.vscode/mcp.json:

{
  "servers": {
    "database-remote-mcp": {
      "type": "stdio",
      "command": "node",
      "args": [
        "--env-file=/path/to/database-remote-mcp/.env",
        "/path/to/database-remote-mcp/dist/main.js"
      ],
      "env": {
        "MCP_TRANSPORT": "stdio"
      }
    }
  }
}

超文本传输协议

克劳德代码/克劳德桌面

克劳德代码 —全局注册:

claude mcp add database-remote-mcp --scope user --transport http \
  http://localhost:3000/mcp/stream

克劳德桌面版claude_desktop_config.json:

{
  "mcpServers": {
    "database-remote-mcp": {
      "type": "http",
      "url": "http://localhost:3000/mcp/stream"
    }
  }
}

法典

~/.codex/config.toml:

[mcp_servers.database-remote-mcp]
url = "http://localhost:3000/mcp/stream"
enabled = true

GitHub副本(VS代码)

.vscode/mcp.json:

{
  "servers": {
    "database-remote-mcp": {
      "type": "http",
      "url": "http://localhost:3000/mcp/stream"
    }
  }
}

环境变数

.env.sample.env 中所述修改相应参数的值。

共通

APP_PORT=3000          # HTTPモードのみ使用
ALLOWED_ORIGINS=
DB_TYPE=postgres
MCP_TRANSPORT=         # 未設定またはhttp=HTTPモード / stdio=stdioモード

启用工具

ENABLED_TOOLS=
ENABLED_NOSQL_TOOLS=

RDBMS 接続

SERVER=localhost
PORT=5432
DATABASE=postgres
USER=postgres
PASSWORD=
DB_SSL=

DB_TYPEsqlserver / postgres / mysql 时褪色为此颜色。

MongoDB 接続

MONGO_URI=mongodb://localhost:27017
MONGO_DATABASE=admin

MONGO_URI 未设定时 mongodb://SERVER:PORT 来修改标记元素的显示属性。

体系结构

依存方向: Presentation -> Application -> Domain <- Infrastructure

src/
├── app.module.ts          # HTTPモード用ルートモジュール
├── app-stdio.module.ts    # stdioモード用ルートモジュール(Presentation層なし)
├── presentation/          # HTTPモードのみ使用
│   └── mcp/
│       ├── mcp.controller.ts
│       ├── mcp.controller.module.ts
│       └── sse.interceptor.ts
├── application/
│   └── mcp/
│       ├── mcp.service.ts
│       ├── runtime-resolver.service.ts
│       ├── shared/           # connectStdio() を含む共通実装
│       ├── rdbms/
│       └── nosql/
├── domain/
│   ├── mcp/
│   │   ├── shared/
│   │   ├── rdbms/
│   │   └── nosql/
│   ├── rdbms/
│   └── nosql/
└── infrastructure/
    ├── config/
    ├── rdbms/
    └── nosql/

测试和质量检查

pnpm lint
pnpm build
pnpm test

目录标签

目录标签

数据分析远程服务TypeScriptClaudeHTTP传输数据库访问本地部署MCP协议stdio传输

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

12

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP