MCP.so
登录

SQL Server MCP (MCP) Server

@MCPRUNNER

基本信息

分类

数据库

传输方式

stdio

作者

MCPRUNNER

关于 SQL Server MCP (MCP) Server

MCP Server for MSSQL (Microsoft SQL Server)

SQL Server MCP (MCP) Server 配置

暂无标准配置

该服务器的 README 中没有可解析的 MCP 配置块,请前往代码仓库查看安装说明。

代码仓库

SQL Server MCP (MCP) Server 工具

4

Initializes the SQL Server connection

Executes a SQL query and returns results as JSON

Retrieves metadata about database tables, columns, keys, etc. You can filter by schema or get all schemas.

Retrieves metadata about tables, views, stored procedures and functions, including schemas, columns, and relationships.

概览

What is SQL Server MCP Server?

This is a Model Context Protocol (MCP) server that connects to one or more SQL Server databases. It is designed to be used by Visual Studio Code as a Copilot Agent, enabling LLM‑driven SQL query execution and database metadata retrieval.

How to use SQL Server MCP Server?

The server requires .NET 9.0 SDK and a running SQL Server instance (local or remote). Set mandatory environment variables MSSQL_MCP_KEY and MSSQL_MCP_API_KEY before starting. Use the provided PowerShell script Start-MCP-Encrypted.ps1 or run the Docker image from mcprunner/mssqlmcp. Client applications authenticate via the API key in HTTP headers and interact using MCP tools such as connectionManager/list, GetTableMetadata, and GetDatabaseObjectsMetadata.

Key features of SQL Server MCP Server

  • SQL query execution through MCP tools
  • Comprehensive database metadata retrieval (tables, views, stored procedures, functions)
  • Detailed schema information including primary/foreign keys
  • Connection string encryption with AES‑256
  • Key rotation and security management support
  • Persistent connection storage via SQLite database
  • Robust logging with Serilog and clean architecture

Use cases of SQL Server MCP Server

  • Enable Visual Studio Code Copilot to query SQL Server databases
  • Retrieve database schema for code generation or documentation
  • Securely manage multiple database connections in one place
  • Automate database operations through MCP tool calls

常见问题

1

What runtime dependencies are required?

Requires .NET 9.0 SDK and a SQL Server instance (local or remote). Visual Studio Code with the Copilot extension is recommended for the intended use case.

2

How are connection strings secured?

Connection strings are encrypted using AES‑256 with a master key provided via the `MSSQL_MCP_KEY` environment variable. Key rotation is supported through dedicated PowerShell scripts.

3

Where are database connections stored?

Connections are stored persistently in a local SQLite database at `Data/connections.db`. The data directory location can be overridden with the `MSSQL_MCP_DATA` environment variable.

4

How do I authenticate to the server?

API key authentication is used via HTTP headers. The API key is set using the `MSSQL_MCP_API_KEY` environment variable or generated and configured with the `Set-Api-Key.ps1` script.

5

What database objects can the server retrieve metadata for?

Metadata can be retrieved for tables, views, stored procedures, and functions. Objects can be filtered by type (TABLE, VIEW, PROCEDURE, ALL) and by schema.

评论

数据库 分类下的更多 MCP 服务器