mssql
Installation
SKILL.md
Microsoft SQL Server
Interact with Microsoft SQL Server databases using the mssql CLI. All commands output JSON by default for reliable parsing.
IMPORTANT — Agent safety rules:
- Never run
mssql sql-dangerouswithout explicit user approval. Always present the full SQL query to the user and explain what it does before executing. This command can modify or destroy data (INSERT, UPDATE, DELETE, DROP, etc.).- Prefer
mssql sqlfor reads. Use the read-onlymssql sqlcommand for SELECT queries. It blocks dangerous statements automatically.- Prefer
mssql schemaover raw queries when you need table structure information.- If you are unsure of the schema, use
mssql schemato check first — do not guess column or table names.
Setup
Add a server connection
mssql server add --name mydb --server localhost --database MyDatabase --user sa --password "secret" --format json
mssql server add --name mydb --server db.example.com --database MyDatabase --windows-auth --trust-cert --format json