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.2.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.2-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iflow_mcp_daobataotie_mssql_mcp-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 6323ed5de5f8e2811c8a11f4b5f79dc21a8ea2d1398a53feecfba5234633033a
MD5 54375ced5025eb5f676debdbc975c1f9
BLAKE2b-256 7ab6bda07a935bcdda0c1bbf5528475a8d4a50cfbae84a595198509e955d9c04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iflow_mcp_daobataotie_mssql_mcp-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 12.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c6e37f2449ac02dd62ea59f5b7f6270500da075347c2450171862884bcf9d797
MD5 25f60af23c39fbaf1e5fba7ee923262b
BLAKE2b-256 508ac2db10bdc2d4174343c448104f616905b0f5c083beab580ab3e808df818d

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