
SQL Server
io.github.hlgurgelPublished by GitHub account hlgurgelv0.1.8Updated Oct 24, 2026
Servidor MCP para SQL Server com controle de permissões e modo somente-leitura
Overview
Local MCP server for SQL Server that lets an assistant explore schemas and run read-only queries, with write tools gated by permissions and confirmation.
- What you can do
- Run read-only SELECT queries and list accessible databases
- Inspect tables and views: structure, columns, types, primary keys, indexes, constraints and table statistics
- Browse stored procedures and functions, including their source code
- Review estimated execution plans and the last run status of SQL Agent jobs
- When the connection user has write roles: execute procedures, run UPDATE with a WHERE clause, create indexes, alter procedures and run DDL with rollback scripts
- When to use it
- Useful when an assistant needs to explore or query a SQL Server database, understand its schema, procedures and functions, or diagnose query plans and job status. Write tools are only exposed for connections whose user has write permissions.
- Requirements
- Runs locally as a Python package (Python 3.10+) with the Microsoft ODBC Driver 18 for SQL Server installed. Needs a connection string supplied via the MSSQL_CONNECTION_STRING environment variable, or a .env file pointed to by MSSQL_ENV_FILE. An optional HTTP mode requires the server extra and MCP_HOST/MCP_PORT settings.
Installation
In SourceWeft
- Open SQL Server in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
mcp-sqlserver
[PyPI version] [License: MIT] [Python versions]
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
- Credenciais nunca expostas ao LLM — a string de conexão é lida do ambiente e nunca aparece nas respostas nem nos logs.
- Somente leitura por padrão — a ferramenta
consultabloqueia DDL/DML (INSERT, UPDATE, DELETE, DROP, etc.). - Escrita sob demanda — ferramentas de escrita (
executar_update,executar_ddl, etc.) só são expostas quando o usuário da conexão possui permissão de escrita (rolessysadmin,db_owner,db_datawriteroudb_ddladmin), e exigem confirmação explícita antes de cada execução.
Pré-requisitos
- Python 3.10+
- Driver ODBC Driver 18 for SQL Server:
- macOS:
brew install msodbcsql18 - Windows/Linux: instale o driver correspondente da Microsoft
- macOS:
Instalação
Via PyPI:
Ou, sem instalar nada (executa direto do PyPI com cache):
Configuração
O servidor lê a string de conexão das seguintes fontes, em ordem de prioridade:
- Variável de ambiente
MSSQL_CONNECTION_STRING - Variável de ambiente
MSSQL_ENV_FILEapontando para um arquivo.env - Arquivo
.envno diretório de trabalho (ou na raiz do projeto)
Exemplo de string de conexão:
Uso com clientes MCP
Claude Desktop
Adicione ao claude_desktop_config.json:
Se instalou via pip install, pode usar o entry point diretamente:
OpenCode
No opencode.json do projeto:
Alternativa: apontar para um arquivo .env local, mantendo a senha fora do JSON:
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:
Inicie o servidor:
Opcionalmente, ajuste host/porta com MCP_HOST (padrão 0.0.0.0) e MCP_PORT
(padrão 8090). O endpoint MCP fica em http://<host>:<porta>/mcp.
Para consumir remotamente no opencode:
Ferramentas disponíveis
Somente leitura (sempre disponíveis):
Escrita (só com permissão de escrita na conexão):
Licença
MIT
Source: README.md at commit 5bea8a3
Tools
0Version history
3- v0.1.8LatestOct 11, 2026
- v0.1.7Oct 10, 2026
- v0.1.6Sep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts