SQL Server Express MCP服务器
用于与Microsoft SQL server Express交互的MCP服务器。支持Windows和SQL Server身份验证。
先决条件
- Python 3.10或更高版本
- 用于SQL Server的Microsoft ODBC驱动程序18
- 具有适当权限的SQL Server实例
安装
克隆此仓库
cd mcp-sqlexpress
# Create and activate virtual environment
uv venv
.venv\Scripts\activate
# Install dependencies
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:显示表架构
