Agent skill

Mssql

by sanjay3290 in sanjay3290/ai-skills

Execute read-only SQL queries against multiple Microsoft SQL Server databases.

Apache-2.0Auto-check passedDatabases

Install Mssql

skills CLI
$ npx skills add sanjay3290/ai-skills --skill mssql -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install sanjay3290/ai-skills mssql --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/sanjay3290/ai-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mssql .claude/skills/mssql && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mssql
GitHub stars
431
Token cost
~1.1k tokens
SKILL.md length
349 words
Files
6 (incl. scripts)
Skills in repo
24
Repo updated
First seen
Licence
Apache-2.0

At a glance

Execute read-only SQL queries against multiple Microsoft SQL Server databases.

  • Works in 4 steps: Run --list to show available databases → Match user intent to database description → Run --tables or --schema to explore… → …
  • Querying MSSQL/SQL Server databases
  • SKILL.md covers Requirements, Setup, Usage and Database Selection, plus 4 more sections
  • Runs Python scripts from its folder; calls python3 and pip

What it does

Mssql is an agent skill from sanjay3290/ai-skills. Execute read-only SQL queries against multiple Microsoft SQL Server databases. Use when: (1) querying MSSQL/SQL Server databases, (2) exploring database schemas/tables, (3) running SELECT queries for data analysis, (4) checking database contents. Supports multiple database connections with descriptions for intelligent auto-selection. Blocks all write operations (INSERT, UPDATE, DELETE, DROP, etc.) for safety.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts (for example `README.md`, `connections.example.json` and `scripts/query.py`).

It sits in Databases, covering SQL, Database schema design and Data analysis. It works with Microsoft SQL Server and SQL. The repository describes itself as: 24 cross-platform agent skills for Claude Code, Cursor, Codex & Gemini CLI — databases, messaging, research, TTS, DevOps, and Google Workspace. The licence is Apache-2.0.

When your agent uses it

  • Querying MSSQL/SQL Server databases
  • Exploring database schemas/tables
  • Running SELECT queries for data analysis
  • Checking database contents

Example prompts

  • “/mssql”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Run --list to show available databases
  2. Match user intent to database description
  3. Run --tables or --schema to explore structure
  4. Execute query with appropriate --limit (auto-converts to TOP N)

What it can do on your machine

Read from SKILL.md and the folder at commit 281d88d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Mssql loads about 1.1k tokens when it runs. Until then it costs about 105 tokens; SKILL.md has 349 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~105
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from sanjay3290/ai-skills at commit 281d88d, republished under its Apache-2.0 licence (© sanjay3290). 349 words, ~1,069 tokens.

Download SKILL.mdSave it as .claude/skills/mssql/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
mssql
description
Execute read-only SQL queries against multiple Microsoft SQL Server databases. Use when: (1) querying MSSQL/SQL Server databases, (2) exploring database schemas/tables, (3) running SELECT queries for data analysis, (4) checking database contents. Supports multiple database connections with descriptions for intelligent auto-selection. Blocks all write operations (INSERT, UPDATE, DELETE, DROP, etc.) for safety.
license
Apache-2.0
metadata.author
sanjay3290
metadata.version
1.0

MSSQL Read-Only Query Skill

Execute safe, read-only queries against configured Microsoft SQL Server databases.

Requirements

  • Python 3.8+
  • pymssql: pip install -r requirements.txt

Setup

Create connections.json in the skill directory or ~/.config/claude/mssql-connections.json.

Security: Set file permissions to 600 since it contains credentials:

bash
chmod 600 connections.json
json
{
  "databases": [
    {
      "name": "production",
      "description": "Main app database - users, orders, transactions",
      "host": "db.example.com",
      "port": 1433,
      "database": "app_prod",
      "user": "readonly_user",
      "password": "your-password",
      "encrypt": true,
      "tds_version": "7.3"
    }
  ]
}
Config Fields
FieldRequiredDescription
nameYesIdentifier for the database (case-insensitive)
descriptionYesWhat data this database contains (used for auto-selection)
hostYesDatabase hostname
portNoPort number (default: 1433)
databaseYesDatabase name
userYesUsername
passwordYesPassword
encryptNoEnable TLS encryption (default: false)
tds_versionNoTDS protocol version: 7.0, 7.1, 7.2, 7.3, 7.4 (default: auto)

Usage

List configured databases
bash
python3 scripts/query.py --list
Query a database
bash
python3 scripts/query.py --db production --query "SELECT TOP 10 * FROM users"
List tables
bash
python3 scripts/query.py --db production --tables
Show schema
bash
python3 scripts/query.py --db production --schema
Limit results
bash
python3 scripts/query.py --db production --query "SELECT * FROM orders" --limit 100

Note: MSSQL uses TOP N instead of LIMIT. The --limit flag automatically inserts TOP N after SELECT.

Database Selection

Match user intent to database description:

User asks aboutLook for description containing
users, accountsusers, accounts, customers
orders, salesorders, transactions, sales
analytics, metricsanalytics, metrics, reports
logs, eventslogs, events, audit

If unclear, run --list and ask user which database.

Safety Features

  • Read-only enforcement: Query validation blocks write operations (use a db_datareader role user for server-side protection)
  • Query validation: Only SELECT, SHOW, EXPLAIN, WITH, SP_HELP queries allowed
  • Single statement: Multiple statements per query rejected
  • TLS support: Configurable encryption for secure connections
  • Query timeout: 30-second timeout enforced via pymssql
  • Connection timeout: 10-second login timeout
  • Memory protection: Max 10,000 rows per query to prevent OOM
  • Column width cap: 100 char max per column for readable output
  • Credential sanitization: Error messages don't leak passwords

Troubleshooting

ErrorSolution
Config not foundCreate connections.json in skill directory
Authentication failedCheck username/password in config
Connection timeoutVerify host/port, check firewall/VPN
TDS version errorTry "tds_version": "7.3" or "7.4"
Encryption errorSet "encrypt": true for Azure SQL
Permission warningRun chmod 600 connections.json

Exit Codes

  • 0: Success
  • 1: Error (config missing, auth failed, invalid query, database error)

Workflow

  1. Run --list to show available databases
  2. Match user intent to database description
  3. Run --tables or --schema to explore structure
  4. Execute query with appropriate --limit (auto-converts to TOP N)

© sanjay3290, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts) in skills/mssql of sanjay3290/ai-skills.

  • SKILL.md
  • .gitignore
  • README.md
  • connections.example.json
  • requirements.txt
  • scripts/query.py

Open the folder on GitHubat commit 281d88d

Compare with similar skills

Mssql next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Mssql compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mssql this skillsanjay3290/ai-skills431—~1.1kAutomated safety check: PassApache-2.0
SQL ProJeffallan/claude-skills12k—~1.3kAutomated safety check: PassMIT
SQL AnalystRightNow-AI/openfang18k—~655Automated safety check: PassApache-2.0
Agent SQL Proxiaoyuge886/aigc198—~315Automated safety check: PassMIT
SQL Expertaiskillstore/marketplace430—~3.4kAutomated safety check: PassNone
Tsh SQL And Database UnderstandingTheSoftwareHouse/copilot-collections284—~11kAutomated safety check: PassMIT

Similar skills

  • SQL Pro

    Jeffallan/claude-skills

    Optimizes SQL queries and designs schemas using CTEs, window functions, covering indexes and EXPLAIN ANALYZE, with notes on dialect differences between major databases.

    12k GitHub stars~1.3k tokensUpdated 5 days ago
    DatabasesAuto-check passed
  • SQL Analyst

    RightNow-AI/openfang

    SQL query expert for optimization, schema design, and data analysis

    18k GitHub stars~655 tokensUpdated 3 mo ago
    DatabasesAuto-check passed
  • Agent SQL Pro

    xiaoyuge886/aigc

    Expert SQL developer specializing in complex query optimization, database design, and performance tuning across PostgreSQL, MySQL, SQL Server, and Oracle.

    198 GitHub stars~315 tokensUpdated 2 mo ago
    DatabasesAuto-check passed
  • SQL Expert

    aiskillstore/marketplace

    Expert SQL query writing, optimization, and database schema design with support for PostgreSQL, MySQL, SQLite, and SQL Server.

    430 GitHub stars~3.4k tokensUpdated today
    DatabasesAuto-check passed
  • Tsh SQL And Database Understanding

    TheSoftwareHouse/copilot-collections

    SQL writing and database engineering patterns, standards, and procedures.

    284 GitHub stars~11k tokensUpdated 3 days ago
    DatabasesAuto-check passed
  • Analytics Engineer

    borghei/Claude-Skills

    Analytics engineering across data modeling, dbt, transformation, and semantic layers.

    886 GitHub stars~3.4k tokensUpdated yesterday
    Data & AnalyticsAuto-check passed

More from sanjay3290/ai-skills

All 24 skills in this repo
  • Deep Research

    sanjay3290/ai-skills

    Execute autonomous multi-step research using Google Gemini Deep Research Agent.

    431 GitHub starsUsed in 9 repos~683 tokens
    Auto-check: notes
  • Imagen

    sanjay3290/ai-skills

    Generate images using Google Gemini's image generation capabilities.

    431 GitHub starsUsed in 6 repos~657 tokens
    Auto-check passed
  • Notebooklm

    sanjay3290/ai-skills

    Query and manage Google NotebookLM notebooks with persistent profile auth, source sync, batch/multi queries, and structured exports.

    431 GitHub stars~655 tokensUpdated 28 days ago
    Auto-check passed
  • Whatsapp

    sanjay3290/ai-skills

    Send and receive WhatsApp messages via the unofficial linked-device client pywhats (pip install pywhats) — pair with QR, send text/images, group chat, read receipts, presence/typing, and a…

    431 GitHub stars~1.1k tokensUpdated 28 days ago
    Auto-check passed
  • Postgres

    sanjay3290/ai-skills

    Execute read-only SQL queries against multiple PostgreSQL databases.

    431 GitHub starsUsed in 1 repo~975 tokens
    Auto-check passed
  • Atlassian

    sanjay3290/ai-skills

    Manage Jira issues and Confluence wiki pages in Atlassian Cloud.

    431 GitHub stars~1.6k tokensUpdated 28 days ago
    Auto-check passed

Categories

Questions about Mssql

What does Mssql do?

Execute read-only SQL queries against multiple Microsoft SQL Server databases. Mssql is an agent skill from sanjay3290/ai-skills. Execute read-only SQL queries against multiple Microsoft SQL Server databases.

When should I use Mssql?

Mssql fits situations like: querying MSSQL/SQL Server databases; exploring database schemas/tables; running SELECT queries for data analysis; checking database contents.

How do I install Mssql in Claude Code?

Run `npx skills add sanjay3290/ai-skills --skill mssql -a claude-code`. Or copy the skill folder (skills/mssql in sanjay3290/ai-skills) into .claude/skills/mssql in your project. Claude Code loads it when a task matches its description.

How do I install Mssql in Codex?

Run `npx skills add sanjay3290/ai-skills --skill mssql -a codex`. Or copy the skill folder (skills/mssql in sanjay3290/ai-skills) into .agents/skills/mssql in your project. Codex loads it when a task matches its description.

Can I use Mssql in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sanjay3290/ai-skills --skill mssql -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mssql, .gemini/skills/mssql, .github/skills/mssql and .opencode/skills/mssql in your project.

What does Mssql need to run?

Going by SKILL.md and its folder, Mssql needs Python for the scripts in its folder and the command-line tools its instructions call (python3 and pip). Our summary lists: Python 3.

Does Mssql access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Mssql safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Mssql use?

Mssql is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Mssql use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Mssql?

Skills that share tags, products or a category with Mssql: SQL Pro (Jeffallan/claude-skills, 12k stars), SQL Analyst (RightNow-AI/openfang, 18k stars), Agent SQL Pro (xiaoyuge886/aigc, 198 stars) and SQL Expert (aiskillstore/marketplace, 430 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mssql?

sanjay3290 (a GitHub user) maintains it in sanjay3290/ai-skills, which has 431 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on September 10, 2026.

Source: sanjay3290/ai-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.