# mssql-mcp

> MCP Server

The MSSQL MCP Server enables database interaction and business intelligence by running SQL queries, analyzing data, and generating business insight memos, adapting SQLite modifications for MSSQL. The MSSQL MCP Server

## Overview

- **Category:** Database
- **Language:** Python
- **Stars:** 39
- **Forks:** 1
- **Owner:** daobataotie
- **GitHub:** https://github.com/daobataotie/mssql-mcp
- **Created:** 2025-03-13T03:48:56+00:00
- **Updated:** 2025-03-28T03:10:08+00:00
- **Source:** https://model-context-protocol.com/servers/mssql-server-database-interaction-business-intelligence

## Setup

## Setup

1.  **Install packages**:

   ```bash
   CD /d ~/mssql-mcp  
   pip install -r requirements.txt  
   ```

2.  **config**: Create `config.json` in the same folder as `server.py` and add the following:

   ```json
   {
       "database": {
           "driver": "ODBC Driver 17 for SQL Server",
           "server": "server ip",
           "database": "db name",
           "username": "username",
           "password": "password",
           "trusted_connection": false
       },
       "server": {
           "name": "mssql-manager",
           "version": "0.1.0",
           "host": "0.0.0.0",
           "port": 8080
       }
   }
   ```

3.  **Claude Desktop ã Windsurf**: Add the following to `claude_desktop_config.json`, using your path:

   ```json
   {
       "mcpServers": {
           "mssql": {
               "command": "python",
               "args": [
                   "~/server.py" # your path
               ]
           }
       }
   }
   ```

4.  **Cursor**: Add according to the diagram (see `imgs/cursor_config.png`) for Cursor MCP, using your path.

5.  **MCP Inspector**: Run the following command, using your path:

   ```bash
   npx -y @modelcontextprotocol/inspector python C:\mssql-mcp\src\server.py
   ```

## Tools

## Available Tools

		1. `read_query` (Execute SELECT queries to read data from the database)
		2. `write_query` (Execute INSERT, UPDATE, or DELETE queries)
		3. `create_table` (Create new tables in the database)
		4. `list_tables` (Get a list of all tables in the database)
		5. `describe-table` (View schema information for a specific table)
		6. `append_insight` (Add new business insights to the memo resource)
