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.0.tar.gz (10.1 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.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iflow_mcp_daobataotie_mssql_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 10.1 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.0.tar.gz
Algorithm Hash digest
SHA256 fd83dd7614965e80ab0e2d2bf4926b3f04c535bdd1b428f8729ca4721e99a123
MD5 9396cd054c0f99600947030cf01dce84
BLAKE2b-256 6f0f19cf4fa696aa2af2f565fe628c49795a09701b9614fd8d9ae88f8a17c3b1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iflow_mcp_daobataotie_mssql_mcp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f1c90e489ff9bd11e8f25b06676a408a61da15c9b552b214d20d8d635af7da3
MD5 b1d7d98e164e015a7a225fcaf4a7e952
BLAKE2b-256 7af3878d3ba3b72d9fadc30e674c3f56ef24f6b9ee96eb1174e07b25366fa711

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