MS SQL Server MCP Server logo

MS SQL Server MCP Server

by TerraCo89

This project provides an MCP server for interacting with MS SQL Server databases via AI assistants using the Model Context Protocol (MCP). It uses a secure profile management system leveraging the system's native credential store to avoid sending passwords over MCP.

View on GitHub

Last updated: N/A

What is MS SQL Server MCP Server?

This is an MCP server that enables AI assistants to interact with MS SQL Server databases. It prioritizes security by storing database passwords in the system's native credential store, preventing them from being transmitted over MCP.

How to use MS SQL Server MCP Server?

The server can be run directly with Python or within a Docker container. Configuration involves setting up connection profiles using the provided tools, which securely store database credentials. The server then exposes database operations through the MCP protocol, allowing AI assistants to execute queries and manage data.

Key features of MS SQL Server MCP Server

  • Secure password management using system keyring

  • Connection profile management for multiple databases

  • Support for direct Python execution and Docker deployment

  • Comprehensive database operations (read, create, update, delete, schema retrieval, table listing)

  • Integration with MCP-compatible AI assistants

Use cases of MS SQL Server MCP Server

  • Enabling AI-powered data analysis on MS SQL Server databases

  • Automating database administration tasks through AI assistants

  • Building AI-driven applications that require access to MS SQL Server data

  • Integrating MS SQL Server data into AI-powered workflows

FAQ from MS SQL Server MCP Server

How does the server handle password security?

The server uses the keyring library to store passwords securely in the operating system's credential manager, preventing them from being sent over MCP.

What are the prerequisites for running the server?

For direct Python execution, you need Python 3.10+, Pip, and the ODBC Driver for SQL Server. For Docker execution, you need Docker installed.

How do I configure connection profiles?

Use the add_connection_profile tool to add new profiles. Non-sensitive details are stored in profiles.json, while passwords are stored securely in the system keyring.

How do I run the server in Docker?

Build the Docker image using docker build -t mcp-mssql-server . and then run it with the appropriate environment variables and volume mounts for persistence.

What database operations are supported?

The server supports reading, creating, updating, and deleting table records, as well as retrieving table schemas and listing tables.