Get the FREE Ultimate OpenClaw Setup Guide →

mssql

mssql mcp server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio daobataotie-mssql-mcp python src/server.py

How to use

This MSSQL MCP Server provides an interface for interacting with a SQL Server database and generating business insights. It exposes tools for executing read queries (SELECT), write queries (INSERT/UPDATE/DELETE), creating tables, listing tables, describing table schemas, and appending insights to a memo resource. To use it, first ensure you have a working Python environment and the required ODBC driver for SQL Server installed. The server reads its database connection details from a config file (for example a config.json) that specifies the ODBC driver, server, database, and credentials. You can run the server by invoking the Python script (src/server.py) in the repository, and then interact with the MCP interfaces via your preferred MCP client or the MCP Inspector tool. The README also demonstrates how to configure the server for Claude Desktop and for Cursor via the mcpServers section, which maps an MCP name (like mssql) to a Python-based server process. The MCP Inspector can be launched with a command like: npx -y @modelcontextprotocol/inspector python C:\path\to\server.py, which helps you explore and test the server’s capabilities.

How to install

Prerequisites:

  • Python 3.x installed
  • An instance of Microsoft SQL Server (or SQL Server-compatible database) accessible from the machine running the server
  • ODBC Driver 17 for SQL Server installed and configured
  • network access and credentials for the target database

Installation steps:

  1. Clone or download the MSSQL MCP Server repository.
  2. Create and activate a Python environment (optional but recommended):
    • python -m venv venv
    • source venv/bin/activate (Linux/macOS) or venv\Scripts\activate (Windows)
  3. Install Python dependencies:
    • pip install -r requirements.txt
  4. Configure the database connection in a config.json (or as required by your setup) with the following structure: { "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" } }
  5. Run the MCP server:
    • python src/server.py
  6. Optional: configure MCP clients or tools (e.g., Claude Desktop or Cursor) to point to this server using an mcpServers entry such as: { "mcpServers": { "mssql": { "command": "python", "args": ["src/server.py"] } } }

Note: If you are using Windows paths, you may specify an absolute path to server.py, e.g. C:\path\to\src\server.py.

Additional notes

Tips and notes:

  • Ensure the ODBC Driver 17 for SQL Server matches the driver name in your config to avoid connection errors.
  • The server exposes several actions (read_query, write_query, create_table, list_tables, describe-table, append_insight); use them via your MCP client or Inspector for testing.
  • If you encounter connection failures, verify firewall rules, network access, and that the database credentials in config.json are correct.
  • Environment variables are optional here unless your deployment requires them; you can pass them in the mcp_config under env.
  • The npm_package field is null for this Python-based server, so you do not need an npm setup to run it.

Related MCP Servers

Sponsor this space

Reach thousands of developers