Back to MCP Catalog

MSSQL Manager MCP Server

DatabasesPython
SQL Server database interaction and business intelligence tool
Available Tools

read_query

Execute SELECT queries to read data from the database

write_query

Execute INSERT, UPDATE, or DELETE queries to modify data in the database

create_table

Create new tables in the database

list_tables

Get a list of all tables in the database

describe-table

View schema information for a specific table

append_insight

Add new business insights to the memo resource

MSSQL Manager provides a powerful interface for interacting with Microsoft SQL Server databases through natural language. It enables running SQL queries, analyzing business data, and automatically generating business insights. The tool bridges the gap between complex database operations and intuitive AI-driven interactions, making database management and analysis more accessible.

Overview

MSSQL Manager is a Model Context Protocol (MCP) server that enables AI assistants to interact with Microsoft SQL Server databases. It provides capabilities for executing queries, managing database structures, and generating business insights from your data.

Installation

Prerequisites

Before installing MSSQL Manager, ensure you have:

  1. Python 3.x installed
  2. ODBC Driver 17 for SQL Server installed
  3. Access to a Microsoft SQL Server database

Step 1: Clone the repository

git clone https://github.com/daobataotie/mssql-mcp.git
cd mssql-mcp

Step 2: Install dependencies

pip install -r requirements.txt

Step 3: Configure database connection

Create a config.json file in the same directory as the server.py file with the following structure:

{
    "database": {
        "driver": "ODBC Driver 17 for SQL Server",
        "server": "your_server_ip",
        "database": "your_database_name",
        "username": "your_username",
        "password": "your_password",
        "trusted_connection": false
    },
    "server": {
        "name": "mssql-manager",
        "version": "0.1.0"
    }
}

Replace the placeholder values with your actual SQL Server connection details.

Integration with AI Assistants

Claude Desktop / Windsurf

Add the following to your claude_desktop_config.json file:

{
    "mcpServers": {
        "mssql": {
            "command": "python",
            "args": [
                "/path/to/mssql-mcp/src/server.py"
            ]
        }
    }
}

Replace /path/to/mssql-mcp/src/server.py with the actual path to the server.py file on your system.

Cursor

For the new version of Cursor, add the configuration to your JSON configuration file:

{
    "mcpServers": {
        "mssql": {
            "command": "python",
            "args": [
                "/path/to/mssql-mcp/src/server.py"
            ]
        }
    }
}

Replace /path/to/mssql-mcp/src/server.py with the actual path to the server.py file on your system.

Testing with MCP Inspector

You can test the MCP server using the MCP Inspector tool:

npx -y @modelcontextprotocol/inspector python /path/to/mssql-mcp/src/server.py

Usage

Once integrated with your AI assistant, you can use natural language to:

  1. Query data from your SQL Server database
  2. Create, update, or delete data
  3. Create new tables
  4. List available tables
  5. Get schema information for specific tables
  6. Generate business insights from your data

The AI will handle translating your natural language requests into the appropriate SQL queries and commands, even with non-standardized column names.

Example Interactions

  • "Show me all customers who made purchases in the last month"
  • "Create a new table to track employee attendance"
  • "What are the top-selling products this quarter?"
  • "Update the price of product X to $99.99"
  • "Generate insights about our sales trends"

The AI will execute the appropriate database operations and return the results in a readable format.

Related MCPs

Milvus Vector Database
DatabasesPython

Connect to Milvus vector database for semantic search and vector operations

MotherDuck DuckDB
DatabasesPython

SQL analytics with DuckDB and MotherDuck for AI assistants

Alibaba Cloud Tablestore
DatabasesJava, Python

Connect to Alibaba Cloud Tablestore for vector search and RAG applications

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.