Skip to main content

MSSQL MCP Server for database interaction and business intelligence

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_daobataotie_mssql_mcp-1.0.3.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iflow_mcp_daobataotie_mssql_mcp-1.0.3-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file iflow_mcp_daobataotie_mssql_mcp-1.0.3.tar.gz.

File metadata

  • Download URL: iflow_mcp_daobataotie_mssql_mcp-1.0.3.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for iflow_mcp_daobataotie_mssql_mcp-1.0.3.tar.gz
Algorithm Hash digest
SHA256 5743665abc13a6613b2ac58f43dd5e80d4e508ac462e934c7682430b49ad6e8c
MD5 e6db1f6070278a03340806debe581276
BLAKE2b-256 2d12c553f064ef775a4d5c072a02902dfc37f538caff3b0cf57650f5a81d718b

See more details on using hashes here.

File details

Details for the file iflow_mcp_daobataotie_mssql_mcp-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_daobataotie_mssql_mcp-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for iflow_mcp_daobataotie_mssql_mcp-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4f0197d2c58b9bea14ba8857dba15cc8e1e2ab0da086e946af87fe8f44e47a08
MD5 ebf22d2cade68e7e0426efc625efa05d
BLAKE2b-256 6c9fc4a2b90c3f1f0bd355e30a3f79a59d037dc69d465f6ae5e251d9b66c390c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page