mcp-db-connector

mcp-db-connector is a library designed for connecting to databases using JavaScript. This tool allows developers to easily perform data retrieval, insertion, updates, and deletions, facilitating efficient database operations. It is particularly designed to support asynchronous processing, making it beneficial for building scalable applications.

GitHub Stars

0

User Rating

Not Rated

Favorites

0

Views

18

Forks

0

Issues

0

README
DB Connector - MCP 数据库连接插件

Node.js Version
TypeScript

一个 Model Context Protocol (MCP) 插件,提供数据库连接功能,支持 MySQL、PostgreSQL 和 SQLite。

功能特性
  • 支持多种数据库类型
  • 通过 MCP 协议提供标准化接口
  • TypeScript 开发,提供完整类型定义
安装
npm install
使用说明
连接到数据库

通过 MCP 服务器使用 connect 工具:

{
  "connectionName": "my-db",
  "type": "mysql",
  "host": "localhost",
  "port": 3306,
  "user": "root",
  "password": "password",
  "database": "test_db"
}
执行查询

使用 query 工具执行 SQL 查询:

{
  "connectionName": "my-db",
  "sql": "SELECT * FROM users"
}
支持的数据库
  • MySQL
  • PostgreSQL
  • SQLite
开发
安装依赖
npm install
开发模式
npm run dev
构建生产版本
npm run build
运行生产版本
npm run start:prod
贡献

欢迎提交 Pull Request。请确保:

  1. 代码符合现有风格
  2. 包含适当的测试
  3. 更新相关文档
许可证

MIT