Back to MCP directory
publicPublicdnsLocal runtime

mcp-sqlexpress

一个用于与Microsoft SQL Server Express交互的MCP服务器,支持Windows和SQL Server认证。

article

README

🚀 Microsoft SQL Server Express MCP 服务器

这是一个用于与 Microsoft SQL Server Express 交互的 MCP 服务器,支持 Windows 和 SQL Server 身份验证,可高效实现与数据库的交互操作。

🚀 快速开始

先决条件

  • Python 3.10 或更高版本
  • Microsoft ODBC 驱动程序 18 for SQL Server
  • 带有适当权限的 SQL Server 实例

安装步骤

克隆此仓库:

cd mcp-sqlexpress

# 创建并激活虚拟环境
uv venv
.venv\Scripts\activate

# 安装依赖项
uv pip install --editable .

与 Claude Desktop 配合使用

将以下内容添加到 claude_desktop_config.json

{
    "mcpServers": {
        "sqlexpress": {
            "command": "uv",
            "args": [
                "--directory",
                "PATH\\TO\\PROJECT\\mcp-sqlexpress",
                "run",
                "mcp-server-sqlexpress",
                "--server",
                "server\\instance",
                "--auth",
                "windows",
                "--trusted-connection",
                "yes",
                "--trust-server-certificate",
                "yes",
                "--allowed-databases",
                "database1,database2"
            ]
        }
    }
}

身份验证选项

  • Windows 身份验证
    • 设置 --auth windows
    • 设置 --trusted-connection yes
  • SQL Server 身份验证
    • 设置 --auth sql
    • 添加 --username--password

✨ 主要特性

工具

  • get_allowed_databases:获取允许访问的数据库列表
  • read_query:执行 SELECT 查询
  • write_query:执行 INSERT/UPDATE/DELETE 查询
  • create_table:创建新表
  • list_tables:列出数据库中的所有表
  • describe_table:显示表结构
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client