home / mcp / sql server express mcp server
MCP server for interacting with SQLExpress
Configuration
View docs{
"mcpServers": {
"hanweg-mcp-sqlexpress": {
"command": "uv",
"args": [
"venv",
"run",
"mcp-server-sqlexpress",
"--server",
"server\\\\instance",
"--auth",
"windows",
"--trusted-connection",
"yes",
"--trust-server-certificate",
"yes",
"--allowed-databases",
"database1,database2"
]
}
}
}This MCP server lets you interact with a Microsoft SQL Server Express instance by exposing a programmable interface for common database actions. It supports both Windows and SQL Server authentication, making it flexible for local development and secure enterprise use.
You run the server locally and connect to it from an MCP client. The server accepts standard database operations such as reading data, writing data, and managing tables. Use an MCP client to execute queries, list databases, and describe table schemas through the provided endpoints. When you configure a client, point it to the local server started by the MCP tooling and use the authentication method that matches your SQL Server setup. Ensure your client’s database permissions align with the operations you plan to perform.
Prerequisites before installing the MCP server:
Install steps you will follow exactly as shown here to set up the MCP server locally.
cd mcp-sqlexpress
# Create and activate virtual environment
uv venv
.venv\Scripts\activate
# Install dependencies
uv pip install --editable .You can configure the Claude Desktop integration to run the MCP server as a local process. Use the following configuration snippet in your Claude Desktop settings to load the server, pointing to the local project and the server instance.
{
"mcpServers": {
"sqlexpress": {
"command": "uv",
"args": [
"--directory",
"PATH\\TO\\PROJECT\\mcp-sqlexpress",
"run",
"mcp-server-sqlexpress",
"--server",
"server\\instance",
"--auth",
"windows",
"--trusted-connection",
"yes",
"--trust-server-certificate",
"yes",
"--allowed-databases",
"database1,database2"
]
}
}
}Choose the authentication mode that matches your SQL Server configuration.
For Windows Authentication:
- Set --auth windows
- Set --trusted-connection yes
For SQL Server Authentication:
- Set --auth sql
- Add --username and --password
Retrieves the list of databases that the MCP server is allowed to access.
Executes SELECT queries against the connected SQL Server database.
Executes INSERT, UPDATE, and DELETE queries against the connected database.
Creates new tables in the connected database.
Lists all tables in the connected database.
Shows the schema for a specified table.