Feedback

MCP 数据库服务器 (TypeScript)

@cherl Claim

Basic information

Runtime
node
Category
License
Not specified
Transports
stdio
Author
cherl
Submitted by
Community
Quality
10

About MCP 数据库服务器 (TypeScript) Server

# MCP 数据库服务器 (TypeScript)

MCP 数据库服务器 (TypeScript) is a MCP server in the Databases category listed in the AddMCP.net directory, published by cherl. Supported transport: stdio. Runtime: node. Source code is hosted on github.com. Related topics: database-server, mcp-server-db-ts, typescript.

MCP 数据库服务器 (TypeScript) config

No standard config provided

This server doesn't expose a parseable MCP config block in its README. See the repository for install instructions.

Repository

MCP 数据库服务器 (TypeScript) tools

Tool list not available yet

This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

Overview

What is MCP 数据库服务器 (TypeScript)?

MCP 数据库服务器 (TypeScript) 是一个基于 Model Context Protocol (MCP) 的数据库查询服务器,用 TypeScript 实现。它允许 AI 模型安全地查询关系型数据库,如 MySQL 和 PostgreSQL。该服务器专为需要让 AI 直接访问数据库结构并执行只读查询的开发者和应用设计。

How to use MCP 数据库服务器 (TypeScript)?

安装:克隆仓库后运行 cnpm install。配置:复制 .env.example 为 .env 并设置数据库连接信息(DB_TYPE、MySQL/PostgreSQL 参数)。构建:cnpm run build。运行:cnpm start。开发模式:cnpm run dev。通过 MCP 协议调用 list_resources、read_resource 和 db_query 工具与服务器交互。

Key features of MCP 数据库服务器 (TypeScript)

  • 支持 MySQL 和 PostgreSQL 数据库
  • 提供表结构信息作为 MCP 资源
  • 支持只读 SQL 查询执行
  • 使用事务确保查询安全性
  • 基于 Model Context Protocol 标准

Use cases of MCP 数据库服务器 (TypeScript)

  • AI 模型获取数据库中所有表的列表
  • AI 模型读取指定表的列结构与类型
  • AI 模型执行安全的只读 SQL 查询以获取数据
  • 将数据库查询能力注入到 MCP 兼容的客户端

Frequently asked questions

1 支持哪些数据库类型?

支持 MySQL 和 PostgreSQL。通过环境变量 DB_TYPE 配置为 mysql 或 postgres。

2 服务器是否允许写入操作?

不,服务器仅支持只读 SQL 查询。所有查询通过 db_query 工具执行,使用事务确保不会修改数据。

3 如何配置数据库连接?

复制 .env.example 为 .env,然后设置数据库类型、主机、端口、用户名、密码和数据库名。MySQL 和 PostgreSQL 的配置项独立。

4 服务器提供了哪些 MCP 功能?

提供了 list_resources(列出所有表)、read_resource(获取表结构)和 db_query(执行只读 SQL 查询)工具。

5 服务器有哪些依赖和运行要求?

需要 Node.js 环境、cnpm(或 npm)包管理器,以及可访问的 MySQL 或 PostgreSQL 数据库。源代码用 TypeScript 编写,需先构建为 JavaScript。

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬