Skip to main content

MSSQL MCP Server

English | 中文

Overview

MSSQL MCP Server, provides database interaction and business intelligence capabilities. This server enables running SQL queries, analyzing business data, and automatically generating business insight memos.
Refer to the official website's SQLite for modifications to adapt to MSSQL

Components

  • read_query
    • Execute SELECT queries to read data from the database
  • write_query
    • Execute INSERT, UPDATE, or DELETE queries
  • 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

Demo

The database table is as follows. The column names are not standardized, and AI will match them on its own. Errors during SQL execution will self correct.

Table

The following is the demo.

Demo

Operating environment

  • Python 3.x
  • Packages
    • pyodbc>=4.0.39
    • pydantic>=2.0.0
    • mcp>=0.1.0
  • ODBC Driver 17 for SQL Server

Usage

Install packages

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

config

#with server.py same folder create config.json,add:    
{
    "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"
    }
}

Claude Desktop 、 Windsurf

# add to claude_desktop_config.json. Note:use your path  
{
    "mcpServers": {
        "mssql": {
            "command": "python",
            "args": [
                # your path,e.g.:"C:\\mssql-mcp\\src\\server.py"
                "~/server.py"
            ]
        }
    }
}

Cursor

# Add according to the following diagram Cursor MCP. Note:use your path  

Cursor config

Note:The new version of cursor has also been changed to JSON configuration, please refer to the previous section

MCP Inspector

# Note:use your path  
npx -y @modelcontextprotocol/inspector python C:\\mssql-mcp\\src\\server.py

Project Structure

mssql-mcp
├── .git
├── .gitignore
├── LICENSE
├── README.md
├── README_en.md
├── README_zh.md
├── imgs
│   ├── cursor_config.png
│   ├── table.png
│   └── demo.gif
├── requirements.txt
└── src
    ├── __init__.py
    └── server.py

License

MIT License

Metadata

Release files for iflow-mcp_daobataotie-mssql-mcp 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_daobataotie-mssql-mcp 1.0.3
File Size Uploaded
iflow_mcp_daobataotie_mssql_mcp-1.0.3.tar.gz 10.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_daobataotie-mssql-mcp 1.0.3
File Interpreter ABI Platform
iflow_mcp_daobataotie_mssql_mcp-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 22.7 kB

Release files / iflow_mcp_daobataotie_mssql_mcp-1.0.3.tar.gz

Download URL iflow_mcp_daobataotie_mssql_mcp-1.0.3.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5743665abc13a6613b2ac58f43dd5e80d4e508ac462e934c7682430b49ad6e8c
BLAKE2b-256 checksum
How to use checksums
2d12c553f064ef775a4d5c072a02902dfc37f538caff3b0cf57650f5a81d718b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / iflow_mcp_daobataotie_mssql_mcp-1.0.3-py3-none-any.whl

Download URL iflow_mcp_daobataotie_mssql_mcp-1.0.3-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f0197d2c58b9bea14ba8857dba15cc8e1e2ab0da086e946af87fe8f44e47a08
BLAKE2b-256 checksum
How to use checksums
6c9fc4a2b90c3f1f0bd355e30a3f79a59d037dc69d465f6ae5e251d9b66c390c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page