MCP 数据库服务器 (TypeScript)
@cherl
About MCP 数据库服务器 (TypeScript)
No overview available yet
Basic information
Config
No standard config provided
This server doesn't expose a parseable MCP config block in its README. See the repository for install instructions.
RepositoryTools
No tools detected
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 兼容的客户端
FAQ from MCP 数据库服务器 (TypeScript)
支持哪些数据库类型?
支持 MySQL 和 PostgreSQL。通过环境变量 DB_TYPE 配置为 mysql 或 postgres。
服务器是否允许写入操作?
不,服务器仅支持只读 SQL 查询。所有查询通过 db_query 工具执行,使用事务确保不会修改数据。
如何配置数据库连接?
复制 .env.example 为 .env,然后设置数据库类型、主机、端口、用户名、密码和数据库名。MySQL 和 PostgreSQL 的配置项独立。
服务器提供了哪些 MCP 功能?
提供了 list_resources(列出所有表)、read_resource(获取表结构)和 db_query(执行只读 SQL 查询)工具。
服务器有哪些依赖和运行要求?
需要 Node.js 环境、cnpm(或 npm)包管理器,以及可访问的 MySQL 或 PostgreSQL 数据库。源代码用 TypeScript 编写,需先构建为 JavaScript。
More Databases MCP servers
MySQL MCP Server
designcomputerA Model Context Protocol (MCP) server that enables secure interaction with MySQL databases
mcp_mysql_server
wenb1n-devModel Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展
MCP Alchemy
runekaagaardA MCP (model context protocol) server that gives the LLM access to and knowledge about relational databases like SQLite, Postgresql, MySQL & MariaDB, Oracle, and MS-SQL.
Meilisearch MCP Server
meilisearchA Model Context Protocol (MCP) server for interacting with Meilisearch through LLM interfaces.
Postgres Mcp
crystaldbaPostgres MCP Pro provides configurable read/write access and performance analysis for you and your AI agents.
Comments