Skip to main content
Glama

MSSQL MCP Server

by JexinSam

测试

MSSQL MCP 服务器

MSSQL MCP 服务器是一个模型上下文协议 (MCP) 服务器,支持与**Microsoft SQL Server (MSSQL)**数据库进行安全且结构化的交互。它允许 AI 助手:

  • 列出可用的表
  • 读取表内容
  • 使用受控访问权限执行 SQL 查询

这确保了更安全的数据库探索、严格的权限执行以及数据库交互的记录。

特征

  • 通过环境变量保护 MSSQL 数据库访问
  • 具有错误处理的受控查询执行
  • 表格列表和数据检索
  • 用于监控查询和操作的综合日志记录

安装

pip install mssql-mcp-server

配置

设置以下环境变量来配置数据库访问:

MSSQL_DRIVER=mssql_driver MSSQL_HOST=localhost MSSQL_USER=your_username MSSQL_PASSWORD=your_password MSSQL_DATABASE=your_database #optional TrustServerCertificate=yes Trusted_Connection=no

用法

使用 Claude Desktop

要与Claude Desktop集成,请将此配置添加到claude_desktop_config.json

{ "mcpServers": { "mssql": { "command": "uv", "args": [ "--directory", "path/to/mssql_mcp_server", "run", "mssql_mcp_server" ], "env": { "MSSQL_DRIVER": "mssql_driver", "MSSQL_HOST": "localhost", "MSSQL_USER": "your_username", "MSSQL_PASSWORD": "your_password", "MSSQL_DATABASE": "your_database" } } } }

作为独立服务器运行

# Install dependencies pip install -r requirements.txt # Run the server python -m mssql_mcp_server

发展

# Clone the repository git clone https://github.com/yourusername/mssql_mcp_server.git cd mssql_mcp_server # Set up a virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install development dependencies pip install -r requirements-dev.txt # Run tests pytest

安全注意事项

  • 使用具有最小权限的专用 MSSQL 用户
  • 切勿使用根凭据或完整管理帐户。
  • 将数据库访问限制为仅进行必要的操作。
  • 启用日志记录和审计以进行安全监控。
  • 定期审查权限以确保最低权限访问。

安全最佳实践

为了安全设置:

  1. 创建具有受限权限的专用 MSSQL 用户
  2. 避免对凭证进行硬编码——而是使用环境变量。
  3. 限制对必要的表和操作的访问
  4. 启用 SQL Server 日志记录和监控以进行审计。
  5. 定期检查数据库访问权限,以防止未经授权的访问。

有关详细说明,请参阅**MSSQL 安全配置指南**

⚠️重要提示:配置数据库访问时始终遵循最小特权原则

执照

本项目遵循MIT 许可证。详情请参阅LICENSE文件。

贡献

欢迎投稿!投稿方式:

  1. 分叉存储库。
  2. 创建功能分支: git checkout -b feature/amazing-feature
  3. 提交您的更改: git commit -m 'Add amazing feature'
  4. 推送到分支: git push origin feature/amazing-feature
  5. 打开拉取请求

需要幫忙?

如有任何疑问或问题,请随时打开 GitHub **Issue**或联系维护人员。

-
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.

模型上下文协议服务器可实现与 Microsoft SQL Server 数据库的安全和结构化交互,允许 AI 助手列出表格、读取数据并以受控访问执行 SQL 查询。

  1. 特征
    1. 安装
      1. 配置
        1. 用法
          1. 使用 Claude Desktop
          2. 作为独立服务器运行
        2. 发展
          1. 安全注意事项
            1. 安全最佳实践
              1. 执照
                1. 贡献
                  1. 需要幫忙?

                Related MCP Servers

                • A
                  security
                  A
                  license
                  A
                  quality
                  A Model Context Protocol server that enables secure interaction with Microsoft SQL Server databases, allowing AI assistants to list tables, read data, and execute SQL queries through a controlled interface.
                  Last updated -
                  1
                  108
                  Python
                  MIT License
                  • Linux
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  A Model Context Protocol server implementation that enables AI assistants to securely interact with GreptimeDB, allowing them to explore database schema, read data, and execute SQL queries through a controlled interface.
                  Last updated -
                  17
                  Python
                  MIT License
                  • Apple
                • -
                  security
                  -
                  license
                  -
                  quality
                  A Model Context Protocol server that enables AI assistants to securely interact with ClickHouse databases, supporting table exploration and SQL query execution through a controlled interface.
                  Last updated -
                  6
                  Python
                  Apache 2.0
                • -
                  security
                  A
                  license
                  -
                  quality
                  A Model Context Protocol server implementation that enables AI assistants to execute SQL queries and interact with SQLite databases through a structured interface.
                  Last updated -
                  6
                  TypeScript
                  MIT License

                View all related MCP servers

                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/JexinSam/mssql_mcp_server'

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