query
Run a SQL query; the connection (connectionString, or host, port, database, username, password, encrypt, trustServerCertificate) is passed with each call.
Query Microsoft SQL Server from an assistant, passing the connection with each query.
LABSCO SUMMARY
No connection details go in the client config: every call carries a connection string, or a host, username and password, so one server can reach more than one SQL Server. It is a single tool. The database, table and schema tools in the project's docs are not available, and the statement you send runs as written, with no filtering, so connect as a login whose permissions you are comfortable with.
A SQL Server client over MCP. It runs SQL against a connection passed with each call — a connection string, or a host, username and password. The project's docs also describe tools for listing databases and tables and for describing a table, but the server only provides query.
Node.js and a clone of the repository, built with npm run build; the client runs build/src/index.js with node. The npm package called mssql-mcp-server is a different project. Connection details do not go in the client config: each query carries a connection string, or a host, username and password, with encrypt and trustServerCertificate for TLS.
Build from source — git clone https://github.com/c0h1b4/mssql-mcp-server.git
USE CASES
Query sys.databases, then INFORMATION_SCHEMA.TABLES in the database you want.
Query INFORMATION_SCHEMA.COLUMNS for the table first, then write SQL that uses what came back.
Connect as a login with only the permissions the query needs, since the statement runs exactly as sent.
Query sys.triggers and sys.foreign_keys for the table so the write does not surprise you.
Listed in project code.
queryRun a SQL query; the connection (connectionString, or host, port, database, username, password, encrypt, trustServerCertificate) is passed with each call.
BEFORE YOU INSTALL
1 tool registered in the project's code. The project's docs also describe list_databases, list_tables and describe_table, but the server only provides query. To list databases or describe a table, send the SQL through query instead: sys.databases, INFORMATION_SCHEMA.TABLES or INFORMATION_SCHEMA.COLUMNS.
The documented client runs the server on your machine.
INSTALLATION
You clone and build this one yourself.
Clone the repository and install its dependencies.
git clone https://github.com/c0h1b4/mssql-mcp-server.git
cd mssql-mcp-server
npm installBuild it:
npm run buildThe build writes the server to build/src/index.js. In the Claude Desktop configuration, <YOUR_PATH_TO_MSSQL_MCP_SERVER> is the folder of your clone.
Connection details are not read from the environment. Give the assistant a connection string, or a host, username and password, and it passes them with each query.
{
"mcpServers": {
"mssql": {
"command": "node",
"args": [
"<YOUR_PATH_TO_MSSQL_MCP_SERVER>/build/src/index.js"
]
}
}
}