A
amornpan/py-mcp-mssql
py-mcp-mssql
View on GitHub ↗Link checked 2026-11-12 · HTTP 200 · opens the vendor's own site
We have neither an install command nor a public remote endpoint from this repository, so we do not print a config. A made-up one is worse than none. How each client wires MCP up →
- Source
- collected from the abordage/awesome-mcp list · type: MCP server
- Harvest history
- first seen 2026-11-05 · last seen 2026-11-14 · seen 10× · listed by 10 sources
- Score
- score 1,003 · 10 sources · mcp
FAQ (answers come from our records)
Who is it for?
We filed it under these tags: MCP 服务. The tags come from the entry itself, not a taxonomy we imposed.
Who maintains it?
first catalogued 2026-11-05;last seen 2026-11-14。There is no official certification or quality rating here — we record sources and dates only.
# Python MSSQL MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
A Model Context Protocol server implementation in Python that provides access to Microsoft SQL Server databases. This server enables Language Models to inspect table schemas and execute SQL queries through a standardized interface.
## Features
### Core Functionality
Asynchronous operation using Python's asyncio
Environment-based configuration using python-dotenv
Comprehensive logging system
Connection pooling and management via pyodbc
Error handling and recovery
FastAPI integration for API endpoints
Pydantic models for data validation
MSSQL connection handling with ODBC Driver
## Prerequisites
Python 3.x
Required Python packages:
pyodbc
pydantic
python-dotenv
mcp-server
ODBC Driver 17 for SQL Server
## Installation
bash
git clone https://github.com/amornpan/py-mcp-mssql.git
cd py-mcp-mssql
pip install -r requirements.txt
## Screenshots
The screenshot above demonstrates the server being used with Claude to analyze and visualize SQL data.
## Project Structure
PY-MCP-MSSQL/
├── src/
│ └── mssql/
│ ├── init.py
│ └── server.py
├── tests/
│ ├── init.py
│ ├── testmssql.py
│ └── testpackages.py
├── .env
├── .env.example
├── .gitignore
├── README.md
└── requirements.txt
### Directory Structure Explanation
src/mssql/ - Main source code directory
init.py - Package initialization
server.py - Main server implementation
tests/ - Test files directory
init.py - Test package initialization
testmssql.py - MSSQL functionality tests
testpackages.py - Package dependency tests
.env - Environment configuration file (not in git)
.env.example - Example environment configuration
.gitignore - Git ignore rules
README.md - Project documentation
requirements.txt - Project dependencies
## Configuration
Create a .env file in the project root:
env
MSSQLSERVER=yourserver
MSSQLDATABASE=yourdatabase
MSSQLUSER=yourusername
MSSQLPASSWORD=yourpassword
MSSQLDRIVER={ODBC Driver 17 for SQL Server}
## API Implementation Details
### Resource Listing
python
@app.listresources()
async def listresources() -> list[Resource]
Lists all available tables in the database
Returns table names with URIs in the format mssql:// /data
Includes table descriptions and MIME types
### Resource Reading
python
@app.readresource()
async def readresource(uri: AnyUrl) -> str
Reads data from specified table
Accepts URIs in the format mssql:// /data
Returns first 100 rows in CSV format
Includes column headers
### SQL Execution
python
@app.calltool()
async def calltool(name: str, arguments: dict) -> list[TextContent]
Executes SQL queries
Supports both SELECT and modification queries
Returns results in CSV format for SELECT queries
Returns affected row count for modification queries
## Usage with Claude Desktop
Add to your Claude Desktop configuration:
On MacOS: ~/Library/Application Support/Claude/claudedesktopconfig.json
On Windows: %APPDATA%/Claude/claudedesktopconfig.json
json
"mcpServers": {
"mssql": {
"command": "python",
"args": [
"server.py"
],
"env": {
"MSSQLSERVER": "yourserver",
"MSSQLDATABASE": "yourdatabase",
"MSSQLUSER": "yourusername",
"MSSQLPASSWORD": "yourpassword",
## Features
### Core Functionality
Asynchronous operation using Python's asyncio
Environment-based configuration using python-dotenv
Comprehensive logging system
Connection pooling and management via pyodbc
Error handling and recovery
FastAPI integration for API endpoints
Pydantic models for data validation
MSSQL connection handling with ODBC Driver
## Prerequisites
Python 3.x
Required Python packages:
pyodbc
pydantic
python-dotenv
mcp-server
ODBC Driver 17 for SQL Server
## Installation
bash
git clone https://github.com/amornpan/py-mcp-mssql.git
cd py-mcp-mssql
pip install -r requirements.txt
## Screenshots
The screenshot above demonstrates the server being used with Claude to analyze and visualize SQL data.
## Project Structure
PY-MCP-MSSQL/
├── src/
│ └── mssql/
│ ├── init.py
│ └── server.py
├── tests/
│ ├── init.py
│ ├── testmssql.py
│ └── testpackages.py
├── .env
├── .env.example
├── .gitignore
├── README.md
└── requirements.txt
### Directory Structure Explanation
src/mssql/ - Main source code directory
init.py - Package initialization
server.py - Main server implementation
tests/ - Test files directory
init.py - Test package initialization
testmssql.py - MSSQL functionality tests
testpackages.py - Package dependency tests
.env - Environment configuration file (not in git)
.env.example - Example environment configuration
.gitignore - Git ignore rules
README.md - Project documentation
requirements.txt - Project dependencies
## Configuration
Create a .env file in the project root:
env
MSSQLSERVER=yourserver
MSSQLDATABASE=yourdatabase
MSSQLUSER=yourusername
MSSQLPASSWORD=yourpassword
MSSQLDRIVER={ODBC Driver 17 for SQL Server}
## API Implementation Details
### Resource Listing
python
@app.listresources()
async def listresources() -> list[Resource]
Lists all available tables in the database
Returns table names with URIs in the format mssql:// /data
Includes table descriptions and MIME types
### Resource Reading
python
@app.readresource()
async def readresource(uri: AnyUrl) -> str
Reads data from specified table
Accepts URIs in the format mssql:// /data
Returns first 100 rows in CSV format
Includes column headers
### SQL Execution
python
@app.calltool()
async def calltool(name: str, arguments: dict) -> list[TextContent]
Executes SQL queries
Supports both SELECT and modification queries
Returns results in CSV format for SELECT queries
Returns affected row count for modification queries
## Usage with Claude Desktop
Add to your Claude Desktop configuration:
On MacOS: ~/Library/Application Support/Claude/claudedesktopconfig.json
On Windows: %APPDATA%/Claude/claudedesktopconfig.json
json
"mcpServers": {
"mssql": {
"command": "python",
"args": [
"server.py"
],
"env": {
"MSSQLSERVER": "yourserver",
"MSSQLDATABASE": "yourdatabase",
"MSSQLUSER": "yourusername",
"MSSQLPASSWORD": "yourpassword",
Listed badge (optional)
Copy this line into the README if you want the listing mark. Optional, and it does not affect being listed.
[](https://anclum.com/en/s/amornpan-py-mcp-mssql/)
- Source
- awesome · https://github.com/amornpan/py-mcp-mssql
- Browse by field
- MCP servers
- Listed by
- 10 independent sources
- added
- today
More like this
Filed under
Every tag opens the full list for that filter. Counts are the live catalogue figures.