MCP.Market

SQL Server MCP server

by hlgurgel·io.github.hlgurgel/sqlserver·v0.1.8

Servidor MCP para SQL Server com controle de permissões e modo somente-leitura

B83/100grade B
What users say
No reviews yet
Be the first
Safety scan
B83/100

full report

Adoption
Growing

0 stars283 downloads/wk

Reviews

Write one

Nobody 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 posts

Read from the package source without running it. The installed server may list more.

  • alterar_procedure

    Altera uma stored procedure com backup previo do codigo original.

  • consulta

    Executa uma consulta SELECT (somente leitura) no SQL Server.

  • criar_indice

    Executa um comando CREATE INDEX no SQL Server.

  • descrever_tabela

    Descreve a estrutura de uma tabela: colunas, tipos,

  • estatisticas_tabela

    Exibe estatisticas de uma tabela: numero estimado de linhas,

  • executar_ddl

    Executa um comando DDL (ALTER TABLE, ALTER VIEW, DROP, CREATE,

  • executar_procedure

    Executa uma stored procedure.

  • executar_updatewrite action

    Executa um comando UPDATE no SQL Server.

  • ler_funcao

    Retorna o codigo-fonte completo de uma funcao.

  • ler_procedure

    Retorna o codigo-fonte completo de uma stored procedure.

  • listar_bancos

    Lista todos os bancos de dados acessiveis no servidor.

  • listar_constraints

    Lista todas as constraints de uma tabela (PK, FK, UNIQUE, CHECK, DEFAULT).

  • listar_funcoes

    Lista todas as funcoes (scalar e table-valued) de um banco de dados.

  • listar_indices

    Lista todos os indices de uma tabela especifica.

  • listar_procedures

    Lista todas as stored procedures de um banco de dados.

  • listar_tabelas

    Lista todas as tabelas e views de um banco de dados.

  • plano_execucao

    Exibe o plano de execucao estimado para uma query, sem executa-la.

  • status_jobs

    Retorna 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

no findings
  • 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
Overall 83/100. Components that don't apply are left out of the denominator. Any critical finding is an F.RubricAppeal a findingJSON

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
Add to Cursor

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-tools

Ou, sem instalar nada (executa direto do PyPI com cache):

uvx --from sqlserver-mcp-tools mcp-sqlserver

Configuração

O servidor lê a string de conexão das seguintes fontes, em ordem de prioridade:

  1. Variável de ambiente MSSQLCONNECTIONSTRING
  2. Variável de ambiente MSSQLENVFILE apontando para um arquivo .env
  3. 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=yes

Uso 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-http

Shortened. 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 Rules
    Analyze T-SQL scripts for design, naming, and performance issues and prevent bad practices.
    A
  • DBHub
    Token-efficient database MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite
    A
  • Motherduck
    SQL analytics and data engineering for AI Assistants and IDEs
    A
  • Keboola
    Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...
    A
  • GeoLens
    Read-only access to a self-hosted GeoLens spatial catalog: datasets, features, maps, sandboxed SQL.
    B