VOOZH about

URL: https://glama.ai/mcp/servers/executeautomation/mcp-database-server?locale=zh-CN

⇱ ExecuteAutomation数据库服务器 by executeautomation | Glama


MCP 数据库服务器

该MCP(模型上下文协议)服务器为Claude提供数据库访问能力,支持SQLite、SQL Server、PostgreSQL数据库。

安装

  1. 克隆存储库:

git clone https://github.com/executeautomation/database-server.git
cd database-server
  1. 安装依赖项:

npm install
  1. 构建项目:

npm run build

Related MCP server: MCP TapData Server

使用选项

有两种方法可以将此 MCP 服务器与 Claude 一起使用:

  1. 直接使用:全局安装包并直接使用

  2. 本地开发:从本地开发环境运行

直接使用 NPM 包

使用此 MCP 服务器的最简单方法是全局安装它:

npm install -g @executeautomation/database-server

这使得您可以直接使用服务器,而无需在本地构建它。

本地开发设置

如果您想修改代码或从本地环境运行:

  1. 按照安装部分所示克隆并构建存储库

  2. 使用下面使用部分中的命令运行服务器

用法

SQLite 数据库

要与 SQLite 数据库一起使用:

node dist/src/index.js /path/to/your/database.db

SQL Server 数据库

要与 SQL Server 数据库一起使用:

node dist/src/index.js --sqlserver --server <server-name> --database <database-name> [--user <username> --password <password>]

必需参数:

  • --server :SQL Server 主机名或 IP 地址

  • --database :数据库名称

可选参数:

  • --user :SQL Server 身份验证的用户名(如果未提供,则将使用 Windows 身份验证)

  • --password :SQL Server 身份验证的密码

  • --port :端口号(默认值:1433)

PostgreSQL 数据库

要与 PostgreSQL 数据库一起使用:

node dist/src/index.js --postgresql --host <host-name> --database <database-name> [--user <username> --password <password>]

必需参数:

  • --host :PostgreSQL 主机名或 IP 地址

  • --database :数据库名称

可选参数:

  • --user :PostgreSQL 身份验证的用户名

  • --password :PostgreSQL 身份验证的密码

  • --port :端口号(默认值:5432)

  • --ssl :启用 SSL 连接(true/false)

  • --connection-timeout :连接超时(以毫秒为单位)(默认值:30000)

配置 Claude 桌面

直接使用配置

如果您全局安装了该软件包,请使用以下命令配置 Claude Desktop:

{
 "mcpServers": {
 "sqlite": {
 "command": "npx",
 "args": [
 "-y",
 "@executeautomation/database-server",
 "/path/to/your/database.db"
 ]
 },
 "sqlserver": {
 "command": "npx",
 "args": [
 "-y",
 "@executeautomation/database-server",
 "--sqlserver",
 "--server", "your-server-name",
 "--database", "your-database-name",
 "--user", "your-username",
 "--password", "your-password"
 ]
 },
 "postgresql": {
 "command": "npx",
 "args": [
 "-y",
 "@executeautomation/database-server",
 "--postgresql",
 "--host", "your-host-name",
 "--database", "your-database-name",
 "--user", "your-username",
 "--password", "your-password"
 ]
 }
 }
}

本地开发配置

对于本地开发,配置 Claude Desktop 以使用本地构建的版本:

{
 "mcpServers": {
 "sqlite": {
 "command": "node",
 "args": [
 "/absolute/path/to/mcp-database-server/dist/src/index.js", 
 "/path/to/your/database.db"
 ]
 },
 "sqlserver": {
 "command": "node",
 "args": [
 "/absolute/path/to/mcp-database-server/dist/src/index.js",
 "--sqlserver",
 "--server", "your-server-name",
 "--database", "your-database-name",
 "--user", "your-username",
 "--password", "your-password"
 ]
 },
 "postgresql": {
 "command": "node",
 "args": [
 "/absolute/path/to/mcp-database-server/dist/src/index.js",
 "--postgresql",
 "--host", "your-host-name",
 "--database", "your-database-name",
 "--user", "your-username",
 "--password", "your-password"
 ]
 }
 }
}

Claude Desktop 配置文件通常位于:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

可用的数据库工具

MCP 数据库服务器提供了以下可供 Claude 使用的工具:

工具

描述

必需参数

read_query

执行 SELECT 查询来读取数据

query :SQL SELECT 语句

write_query

执行 INSERT、UPDATE 或 DELETE 查询

query :SQL修改语句

create_table

在数据库中创建新表

query :CREATE TABLE 语句

alter_table

修改现有表架构

query :ALTER TABLE 语句

drop_table

从数据库中删除表

table_name :表的名称confirm :安全标志(必须为真)

list_tables

获取所有表的列表

没有任何

describe_table

查看表的架构信息

table_name :表的名称

export_query

将查询结果导出为 CSV/JSON

query :SQL SELECT 语句format :“csv”或“json”

append_insight

将业务洞察添加到备忘录

insight :洞察力的文本

list_insights

列出所有业务见解

没有任何

有关如何与 Claude 一起使用这些工具的实际示例,请参阅使用示例

其他文档

发展

要在开发模式下运行服务器:

npm run dev

观察开发过程中的变化:

npm run watch

要求

  • Node.js 18+

  • 对于 SQL Server 连接:SQL Server 2012 或更高版本

  • 对于 PostgreSQL 连接:PostgreSQL 9.5 或更高版本

执照

麻省理工学院

A
license - permissive license
-
quality - not tested
F
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity
Issues opened vs closed

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/executeautomation/mcp-database-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server