SQL Server MCP Server for Claude Code
@shakunvohradeltek
About SQL Server MCP Server for Claude Code
MS SQL Server - MCP for Claude-Code
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"SQLServer-MCP": {
"command": "python3",
"args": [
"run_mssql_mcp.py"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is SQL Server MCP Server for Claude Code?
SQL Server MCP Server for Claude Code is an MCP server that gives Claude Code the ability to directly query Microsoft SQL Server databases. It uses FreeTDS under the hood for cross-platform compatibility and is aimed at developers who work with SQL Server and want to query it interactively inside a Claude Code session.
How to use SQL Server MCP Server for Claude Code?
Install by cloning the repository and running the provided shell script (./install_mssql_mcp_clean.sh). Then run ./configure_mcp.sh to enter your server hostname/port, database name, username, and password. After setup, invoke SQL queries in Claude Code with mcp__mssql__execute_sql(query="SELECT ...").
Key features of SQL Server MCP Server for Claude Code
- Enables Claude Code to run SQL queries directly against Microsoft SQL Server
- Cross-platform support: Linux, macOS, and Windows (via WSL)
- Uses FreeTDS for broad SQL Server compatibility
- Database credentials stored only in the local
.mcp.jsonfile - Automatic temporary file management and cleanup per query
Use cases of SQL Server MCP Server for Claude Code
- List all tables in a database
- Count records in a table
- Query data with filtering conditions (e.g.,
WHERE City='London') - Explore database schema during a Claude Code session
FAQ from SQL Server MCP Server for Claude Code
What are the prerequisites?
Python 3.8 or higher, FreeTDS (installed by the setup script), a SQL Server instance accessible from your machine, and a Linux, macOS, or Windows (via WSL) operating system.
How does the query execution work?
Claude sends a CallToolRequest to the MCP server. The server creates a temporary SQL file, executes it with FreeTDS's tsql utility, parses the results into structured JSON, and cleans up the temporary files.
Where are database credentials stored?
Credentials are stored locally in the .mcp.json configuration file, which is created during the configure_mcp.sh setup. They are never sent as part of prompts.
What transport protocol does this server use?
The server uses the stdio transport protocol, as defined by the "type": "stdio" entry in the .mcp.json configuration.
How can I test the connection?
Run ./test_tsql.sh to verify that FreeTDS can connect to your SQL Server with the provided credentials. You can also run tsql -C to check the FreeTDS installation itself.
Frequently asked questions
What are the prerequisites?
Python 3.8 or higher, FreeTDS (installed by the setup script), a SQL Server instance accessible from your machine, and a Linux, macOS, or Windows (via WSL) operating system.
How does the query execution work?
Claude sends a `CallToolRequest` to the MCP server. The server creates a temporary SQL file, executes it with FreeTDS's `tsql` utility, parses the results into structured JSON, and cleans up the temporary files.
Where are database credentials stored?
Credentials are stored locally in the `.mcp.json` configuration file, which is created during the `configure_mcp.sh` setup. They are never sent as part of prompts.
What transport protocol does this server use?
The server uses the stdio transport protocol, as defined by the `"type": "stdio"` entry in the `.mcp.json` configuration.
How can I test the connection?
Run `./test_tsql.sh` to verify that FreeTDS can connect to your SQL Server with the provided credentials. You can also run `tsql -C` to check the FreeTDS installation itself.
Basic information
More Databases MCP servers
ClickHouse MCP Server
ClickHouseConnect ClickHouse to your AI assistants.
MotherDuck's DuckDB MCP Server
motherduckdbLocal MCP server for DuckDB and MotherDuck

Lawstronaut
Lawstronaut-FZCOAccess millions of official legal and regulatory source documents from 155+ jurisdictions via MCP. Lawstronaut supports AI agents with structured legal research, legal data, laws, regulations, cases, guidance, official s

Redis
modelcontextprotocolModel Context Protocol Servers
Meilisearch MCP Server
meilisearchA Model Context Protocol (MCP) server for interacting with Meilisearch through LLM interfaces.
Comments