ExecuteAutomation Database Server

MIT License
198
10
  • Linux
  • Apple

Integrations

  • Enables connection to PostgreSQL databases with support for authentication, SSL connections, and execution of SQL queries against PostgreSQL 9.5 or later.

  • Provides direct access to SQLite database files, allowing for executing queries, schema modifications, and data operations against local SQLite databases.

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

使用选项

有两种方法可以将此 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/JSONquery :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 或更高版本

执照

麻省理工学院

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

模型上下文协议服务器使 Claude 等 LLM 能够与 SQLite 和 SQL Server 数据库交互,从而允许模式检查和 SQL 查询执行。

  1. 安装
    1. 使用选项
      1. 直接使用 NPM 包
      2. 本地开发设置
    2. 用法
      1. SQLite 数据库
      2. SQL Server 数据库
      3. PostgreSQL 数据库
    3. 配置 Claude 桌面
      1. 直接使用配置
      2. 本地开发配置
    4. 可用的数据库工具
      1. 其他文档
        1. 发展
          1. 要求
            1. 执照

              Related MCP Servers

              • A
                security
                A
                license
                A
                quality
                A Model Context Protocol server that enables LLMs to interact with Salesforce data through SOQL queries, SOSL searches, and various API operations including record management.
                Last updated -
                10
                53
                Python
                MIT License
              • A
                security
                A
                license
                A
                quality
                A Model Context Protocol server that provides database interaction capabilities through SQLite, enabling users to run SQL queries, analyze business data, and automatically generate business insight memos.
                Last updated -
                6
                9
                TypeScript
                MIT License
                • Apple
              • -
                security
                F
                license
                -
                quality
                A Model Context Protocol server that enables Claude and other LLMs to interact with Notion workspaces, providing capabilities like searching, retrieving, creating and updating pages, as well as managing databases.
                Last updated -
                275
                2
                TypeScript
              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that enables LLMs to interact with databases (currently MongoDB) through natural language, supporting operations like querying, inserting, deleting documents, and running aggregation pipelines.
                Last updated -
                TypeScript
                MIT License
                • Apple

              View all related MCP servers

              ID: e2goor55gw