mssql_skill

This skill executes safe read-only MSSQL queries across multiple databases to explore schemas, analyze data, and check contents without risking writes.
  • Python

109

GitHub Stars

5

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill sanjay3290/ai-skills --skill mssql

  • .gitignore282 B
  • connections.example.json950 B
  • README.md2.0 KB
  • requirements.txt18 B
  • SKILL.md4.2 KB

Overview

This skill executes safe, read-only SQL queries against one or more Microsoft SQL Server databases. It auto-selects the best connection based on human-friendly database descriptions and enforces strict safeguards to prevent writes, timeouts, and large-memory results. Use it to explore schemas, list tables, and run SELECT queries for analysis.

How this skill works

The skill reads a connections.json file that lists named database connections with descriptions for intelligent auto-selection. It validates incoming queries to allow only read-only statements (SELECT, WITH, SHOW, EXPLAIN, SP_HELP), blocks multi-statement and write operations, and applies limits (TOP N) and row/column caps for safety. It uses pymssql with TLS and connection/query timeouts and returns trimmed, readable query results.

When to use it

  • Query Microsoft SQL Server (MSSQL) databases in read-only mode
  • Explore schema, list tables, or inspect column definitions
  • Run SELECT queries for reporting, troubleshooting, or ad-hoc analysis
  • Check database contents without risking writes or schema changes
  • Work across multiple named database connections with intelligent selection

Best practices

  • Store connections.json securely and set file permissions to 600 to protect credentials
  • Provide clear, concise description fields for each connection to enable accurate auto-selection
  • Use the --tables and --schema commands first to inspect structure before querying
  • Apply the --limit flag or rely on automatic TOP N insertion for large tables
  • Use a db_datareader or similarly limited user account on the server for defense-in-depth

Example use cases

  • List configured databases and choose one by description when intent is ambiguous
  • Show tables or full schema for a database to discover column names before building queries
  • Run SELECT TOP N queries to sample recent orders, users, or transactions for debugging
  • Extract metrics or ad-hoc reports with safe limits and column width truncation for readable output
  • Verify specific records or counts without risking any INSERT/UPDATE/DELETE activity

FAQ

Place connections.json in the skill directory or ~/.config/claude/mssql-connections.json and set permissions to 600.

How does the skill prevent write operations?

It validates queries to allow only read-only statements, rejects multi-statement payloads, and recommends using a db_datareader account on the server for extra protection.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
mssql skill by sanjay3290/ai-skills | VeilStrat