SQL Server MCP server
io.github.hlgurgel/sqlserver·v0.1.8Servidor MCP para SQL Server com controle de permissões e modo somente-leitura
0 stars283 downloads/wk
Reviews
Write oneNobody has reviewed SQL Server yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
SQL Server tools (18, 1 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
alterar_procedureAltera uma stored procedure com backup previo do codigo original.
consultaExecuta uma consulta SELECT (somente leitura) no SQL Server.
criar_indiceExecuta um comando CREATE INDEX no SQL Server.
descrever_tabelaDescreve a estrutura de uma tabela: colunas, tipos,
estatisticas_tabelaExibe estatisticas de uma tabela: numero estimado de linhas,
executar_ddlExecuta um comando DDL (ALTER TABLE, ALTER VIEW, DROP, CREATE,
executar_procedureExecuta uma stored procedure.
executar_updatewrite actionExecuta um comando UPDATE no SQL Server.
ler_funcaoRetorna o codigo-fonte completo de uma funcao.
ler_procedureRetorna o codigo-fonte completo de uma stored procedure.
listar_bancosLista todos os bancos de dados acessiveis no servidor.
listar_constraintsLista todas as constraints de uma tabela (PK, FK, UNIQUE, CHECK, DEFAULT).
listar_funcoesLista todas as funcoes (scalar e table-valued) de um banco de dados.
listar_indicesLista todos os indices de uma tabela especifica.
listar_proceduresLista todas as stored procedures de um banco de dados.
listar_tabelasLista todas as tabelas e views de um banco de dados.
plano_execucaoExibe o plano de execucao estimado para uma query, sem executa-la.
status_jobsRetorna o status da ultima execucao de jobs do SQL Server Agent.
Public scan report
scanner v0.1.10 · 2026-10-14 · same rubric, same numbers if you re-run it
- Code scan6 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitystatic API keys via environment variables6/15
- Maintenancelast push 3 days ago15/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
How SQL Server compares
Against every graded Databases MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 83/100
- higher than 60% of 802 Databases servers
- Tools
- 18
- the typical Databases server has 8
- Tools that change things
- 6%
- typical: 10%. Fewer write tools means less an agent can break
- Downloads a week
- 283
- more than 75% of 328 Databases servers with a package
What its tools let an agent do: 15 read · 3 run or deploy
Release history: 2 versions in the registry since 2026-09-11, latest 2026-10-11, typically one every 30 days.
Install SQL Server in Claude Code, Cursor or VS Code
claude mcp add sqlserver -- uvx sqlserver-mcp-tools
What the publisher says
From the SQL Server repository's README, as published. We do not edit it. Read it on GitHub
mcp-sqlserver
<!-- mcp-name: io.github.hlgurgel/sqlserver -->
Servidor MCP (Model Context Protocol) para SQL Server, com controle de permissões e modo somente-leitura por padrão. Permite que agentes de IA (Claude, opencode e outros clientes MCP) consultem e administrem bancos SQL Server de forma segura.
Segurança
e nunca aparece nas respostas nem nos logs.
- Credenciais nunca expostas ao LLM — a string de conexão é lida do ambiente
(INSERT, UPDATE, DELETE, DROP, etc.).
- Somente leitura por padrão — a ferramenta consulta bloqueia DDL/DML
etc.) só são expostas quando o usuário da conexão possui permissão de escrita (roles sysadmin, dbowner, dbdatawriter ou db_ddladmin), e exigem confirmação explícita antes de cada execução.
- Escrita sob demanda — ferramentas de escrita (executarupdate, executarddl,
Pré-requisitos
- Python 3.10+
- Driver ODBC Driver 18 for SQL Server:
- macOS: brew install msodbcsql18
- Windows/Linux: instale o driver correspondente da Microsoft
Instalação
Via PyPI:
pip install sqlserver-mcp-toolsOu, sem instalar nada (executa direto do PyPI com cache):
uvx --from sqlserver-mcp-tools mcp-sqlserverConfiguração
O servidor lê a string de conexão das seguintes fontes, em ordem de prioridade:
- Variável de ambiente MSSQLCONNECTIONSTRING
- Variável de ambiente MSSQLENVFILE apontando para um arquivo .env
- Arquivo .env no diretório de trabalho (ou na raiz do projeto)
Exemplo de string de conexão:
DRIVER={ODBC Driver 18 for SQL Server};SERVER=localhost,1433;DATABASE=seu_banco;UID=seu_usuario;PWD=sua_senha;TrustServerCertificate=yesUso com clientes MCP
Claude Desktop
Adicione ao claudedesktopconfig.json:
{
"mcpServers": {
"mcp-sqlserver": {
"command": "uvx",
"args": ["--from", "sqlserver-mcp-tools", "mcp-sqlserver"],
"env": {
"MSSQL_CONNECTION_STRING": "DRIVER={ODBC Driver 18 for SQL Server};SERVER=...;DATABASE=...;UID=...;PWD=...;TrustServerCertificate=yes"
}
}
}
}Se instalou via pip install, pode usar o entry point diretamente:
{
"mcpServers": {
"mcp-sqlserver": {
"command": "mcp-sqlserver",
"env": {
"MSSQL_CONNECTION_STRING": "DRIVER={ODBC Driver 18 for SQL Server};SERVER=...;DATABASE=...;UID=...;PWD=...;TrustServerCertificate=yes"
}
}
}
}OpenCode
No opencode.json do projeto:
{
"mcp": {
"sqlserver": {
"type": "local",
"command": ["mcp-sqlserver"],
"environment": {
"MSSQL_CONNECTION_STRING": "DRIVER={ODBC Driver 18 for SQL Server};SERVER=...;DATABASE=...;UID=...;PWD=...;TrustServerCertificate=yes"
}
}
}
}Alternativa: apontar para um arquivo .env local, mantendo a senha fora do JSON:
{
"mcp": {
"sqlserver": {
"type": "local",
"command": ["mcp-sqlserver"],
"environment": {
"MSSQL_ENV_FILE": "/caminho/para/seu/.env"
}
}
}
}Servidor HTTP (Streamable HTTP)
Além do modo local (stdio), o servidor pode ser executado como um MCP remoto via Streamable HTTP, expondo o endpoint /mcp. Instale com o extra server:
pip install 'sqlserver-mcp-tools[server]'Inicie o servidor:
MSSQL_CONNECTION_STRING="DRIVER={ODBC Driver 18 for SQL Server};SERVER=...;DATABASE=...;UID=...;PWD=...;TrustServerCertificate=yes" \
mcp-sqlserver-httpShortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
SQL Server: common questions
- Is SQL Server MCP server safe?
- Mostly: it is graded B (83/100). Read the SQL Server safety report
- How do I install SQL Server?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does SQL Server need an API key?
- Yes. The registry entry asks for
MSSQL_CONNECTION_STRING. - Is SQL Server maintained?
- The last commit was 24 days ago (2026-10-11). The latest release is v0.1.8.
- What can I use instead of SQL Server?
- Servers from other publishers that do the same job: SqlServer Rules MCP server, DBHub MCP server and Motherduck MCP server.
- How does SQL Server compare with other Databases MCP servers?
- safety score 83/100 (higher than 60% of 802 Databases servers); tools 18 (the typical Databases server has 8); tools that change things 6% (typical: 10%. Fewer write tools means less an agent can break). Full comparison.
Alternatives to SQL Server
Same job from other publishers: the closest match first, then the best rated.
- SqlServer RulesAnalyze T-SQL scripts for design, naming, and performance issues and prevent bad practices.not reviewedGrowingA
- DBHubToken-efficient database MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLitenot reviewedWidely usedA
- MotherduckSQL analytics and data engineering for AI Assistants and IDEsnot reviewedEstablishedA
- KeboolaConnect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...not reviewedEstablishedA
- GeoLensRead-only access to a self-hosted GeoLens spatial catalog: datasets, features, maps, sandboxed SQL.not reviewedEstablishedB