Skip to main content
Glama

MSSQL MCP Server

by knight0zh

MSSQL MCP 服务器

用于连接 Microsoft SQL Server 数据库的模型上下文协议 (MCP) 服务器。此服务器提供用于执行 SQL 查询和管理数据库连接的工具。

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 MSSQL 数据库连接器:

npx -y @smithery/cli install @knight0zh/mssql-mcp-server --client claude

手动安装

npm install mssql-mcp-server

用法

将服务器添加到您的 MCP 设置配置文件:

{ "mcpServers": { "mssql": { "command": "mssql-mcp-server", "env": { "MSSQL_CONNECTION_STRING": "Server=localhost;Database=master;User Id=sa;Password=yourpassword;", // Or individual connection parameters: "MSSQL_HOST": "localhost", "MSSQL_PORT": "1433", "MSSQL_DATABASE": "master", "MSSQL_USER": "sa", "MSSQL_PASSWORD": "yourpassword", "MSSQL_ENCRYPT": "false", "MSSQL_TRUST_SERVER_CERTIFICATE": "true" } } } }

工具

询问

在 MSSQL 数据库上执行 SQL 查询。

参数
  • connectionString (字符串,可选):完整的连接字符串(可替代单独的参数)
  • host (字符串,可选):数据库服务器主机名
  • port (数字,可选):数据库服务器端口(默认值:1433)
  • database (字符串,可选):数据库名称(默认值:master)
  • username (字符串,可选):数据库用户名
  • password (字符串,可选):数据库密码
  • query (字符串,必需):要执行的 SQL 查询
  • encrypt (布尔值,可选):启用加密(默认值:false)
  • trustServerCertificate (布尔值,可选):信任服务器证书(默认值:true)

必须提供connectionString或( host + username + password )。

例子
const result = await use_mcp_tool({ server_name: 'mssql', tool_name: 'query', arguments: { host: 'localhost', username: 'sa', password: 'yourpassword', query: 'SELECT * FROM Users', }, });

发展

# Install dependencies npm install # Run in development mode npm run dev # Build npm run build # Run tests npm test # Run linter npm run lint # Format code npm run format

执照

麻省理工学院

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

模型上下文协议服务器,可执行 SQL 查询并管理与 Microsoft SQL Server 数据库的连接。

  1. 安装
    1. 通过 Smithery 安装
    2. 手动安装
  2. 用法
    1. 工具
      1. 询问
    2. 发展
      1. 执照

        Related MCP Servers

        • -
          security
          A
          license
          -
          quality
          Enables execution of SQL queries and management of Microsoft SQL Server database connections through the Model Context Protocol.
          Last updated -
          13
          TypeScript
          MIT License
          • Apple
          • Linux
        • -
          security
          A
          license
          -
          quality
          A Model Context Protocol server that enables secure and structured interaction with Microsoft SQL Server databases, allowing AI assistants to list tables, read data, and execute SQL queries with controlled access.
          Last updated -
          20
          Python
          MIT License
          • Linux
          • Apple
        • -
          security
          F
          license
          -
          quality
          A Model Context Protocol server that enables SQL query execution, database management, and business intelligence capabilities through MySQL connections.
          Last updated -
          JavaScript
        • 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

        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/knight0zh/mssql-mcp-server'

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