MSSQL

Exposes read-only SQL Server data via MCP with Windows Authentication.
  • python

0

GitHub Stars

python

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "jjones-wps-pyodbc-mcp-server": {
      "command": "pyodbc-mcp-server",
      "args": [],
      "env": {
        "ODBC_DRIVER": "ODBC Driver 17 for SQL Server",
        "MSSQL_SERVER": "your-sql-server",
        "MSSQL_DATABASE": "your-database"
      }
    }
  }
}

You use the pyodbc MCP Server to securely expose read-only access to Microsoft SQL Server databases using Windows Authentication. It lets you explore schemas and run safe SELECT queries without storing credentials, making it ideal for AI assistants and automated tooling that must respect strict security policies.

How to use

You connect with an MCP client to perform read-only queries against your SQL Server database. Start by configuring the MCP server in your environment, then add it to your MCP client (such as Claude Code or Claude Desktop). Use the client to explore tables, views, and relationships, and to run safe SELECT queries that respect row limits and keyword filtering.

Practical usage patterns you can perform:

  • Explore schema: list tables, list views, describe a table, and discover foreign key relationships.
  • Query data: fetch a subset of rows from a table with a limit to avoid large results.
  • Analyze relationships: inspect how tables reference one another to understand data flow.

How to install

Prerequisites you need before installing:

  • Python 3.10+
  • Windows with ODBC Driver 17+ for SQL Server
  • Network access to your SQL Server
  • Windows domain account with SELECT permissions on the target database.
pip install pyodbc-mcp-server
git clone https://github.com/jjones-wps/pyodbc-mcp-server.git
cd pyodbc-mcp-server
pip install -e .

Additional sections

Configuration and usage details are provided to help you run the MCP server safely and effectively.

Security is a core consideration in this setup. The server enforces read-only access by only allowing SELECT queries and blocking dangerous keywords. It uses Windows Authentication with Trusted_Connection so no passwords are stored or transmitted. A configurable row limit helps prevent large, unintended data transfers.

Here are practical configuration and runtime notes for your environment. You may need to set environment variables to point the server at your SQL Server instance and database. If you want to integrate with Claude Code or Claude Desktop, you will configure an MCP entry that launches the server process and passes the required environment variables.

If you run into issues during setup, the most common steps are verifying driver installation, confirming network access, and ensuring the Windows account has the correct database permissions.

Usage examples

Explore Schema

  • List all tables in the dbo schema
  • Describe the structure of the customers table
  • Find the foreign key relationships for the orders table Query Data
  • Show me the first 10 rows from the products table
  • Find all orders from the last 30 days
  • Show the top 5 customers by total order value Analyze Relationships
  • Find all tables that reference the customer table
  • Show me the relationship between orders and order_lines

Troubleshooting

ODBC Driver not found: Install the Microsoft ODBC Driver 17 for SQL Server.

Login failed or cannot connect:

  1. Verify your Windows account has access to the SQL Server
  2. Test connection with sqlcmd -S your-server -d your-database -E
  3. Check firewall settings allow connections on port 1433

Available tools

ListTables

List all tables in the database, optionally filtered by schema.

ListViews

List all views in the database, optionally filtered by schema.

DescribeTable

Get column definitions for a specific table.

GetTableRelationships

Find foreign key relationships for a table.

ReadData

Execute a SELECT query with security filtering.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
MSSQL MCP Server - jjones-wps/pyodbc-mcp-server | VeilStrat