claude-database-tools
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@claude-database-toolsshow me the schema for the dbo.Users table"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
claude-database-tools
SQL Server CLI and MCP server for Claude Code.
Why This Tool?
This project is an alternative to Microsoft's official mssql MCP server with some key advantages:
SQL Server Authentication: Supports SQL Server authentication (username/password), not just Windows/Entra authentication. Ideal for development environments, Docker containers, or scenarios where integrated auth isn't available.
CLI-First Design: The CLI tools can be used directly from a Claude Code skill, giving you database access without requiring MCP server setup. This is useful when you want simpler configuration or need to work in environments where MCP servers are problematic.
MCP Server Included: Also provides an MCP server if you prefer that integration approach.
Related MCP server: SQL Server MCP
Features
CLI Tool: Command-line interface for SQL Server operations
MCP Server: Model Context Protocol server for Claude integration (experimental)
Security: Built-in SQL injection prevention and query validation
Operations: List tables, describe schemas, query data, insert/update/delete records, DDL generation
Installation
git clone https://github.com/cyronius/claude-database-tools.git
cd claude-database-tools
npm install
npm run buildConfiguration
Copy .env.example to .env and configure your database connection:
cp .env.example .envEdit .env with your SQL Server credentials:
SQL_SERVER=localhost
SQL_DATABASE=your_database
SQL_USER=your_username
SQL_PASSWORD=your_password
SQL_PORT=1433
SQL_ENCRYPT=false
SQL_TRUST_SERVER_CERTIFICATE=trueCLI Usage
After building, run commands with:
node dist/cli/index.js <command> [options]Or install globally:
npm install -g .
sql-cli <command> [options]Commands
Command | Description |
| List tables, optionally filtered by schema |
| Get table schema (columns, indexes, foreign keys) |
| Execute a SELECT query |
| Insert records |
| Update records |
| Delete records |
| Execute stored procedure |
| Create a new table |
| Drop a table |
| Create an index |
| Generate CREATE TABLE DDL |
| Generate ALTER TABLE DDL |
Examples
# List all tables
sql-cli list-tables
# List tables in specific schemas
sql-cli list-tables dbo sales
# Describe a table
sql-cli describe-table dbo.Users
# Query data
sql-cli read-data "SELECT TOP 10 * FROM dbo.Users"
# Insert data
sql-cli insert-data dbo.Users '{"name": "John", "email": "john@example.com"}'
# Update data
sql-cli update-data dbo.Users '{"name": "Jane"}' "id = 1"
# Delete data (requires --confirm flag)
sql-cli delete-data dbo.Users "id = 1" --confirm
# Get table DDL
sql-cli get-ddl dbo.UsersMCP Server (Experimental)
Note: The MCP server integration has not been fully tested. Use at your own risk.
The MCP server allows Claude Code to interact with your SQL Server database directly.
Setup
Add to your ~/.claude/mcp.json:
{
"mcpServers": {
"mssql": {
"command": "node",
"args": ["/path/to/claude-database-tools/dist/index.js"],
"env": {
"SQL_SERVER": "your-server",
"SQL_DATABASE": "your-database",
"SQL_USER": "your-username",
"SQL_PASSWORD": "your-password",
"SQL_ENCRYPT": "true",
"READONLY": "true"
}
}
}
}Restart Claude Code to load the MCP server.
Available MCP Tools
Read-Only (available when READONLY=true):
list_tables- List tablesdescribe_table- Get table schemaread_data- Execute SELECT queriesget_table_ddl- Generate CREATE TABLE DDLget_table_alter_ddl- Generate ALTER TABLE DDL
Write (requires READONLY=false):
insert_data- Insert recordsupdate_data- Update recordsdelete_data- Delete recordscreate_table- Create tablescreate_index- Create indexesdrop_table- Drop tablesexecute_stored_proc- Execute stored procedures
Security
SQL Injection Prevention: SELECT queries are validated against dangerous keywords and patterns
Parameterized Queries: All INSERT/UPDATE/DELETE operations use parameterized queries
WHERE Clause Required: UPDATE and DELETE operations require WHERE clauses
Query Limits: Maximum query length of 10,000 characters, result sets limited to 10,000 records
Read-Only Mode: Set
READONLY=trueto disable write operations
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityFmaintenanceAn MCP server for Microsoft SQL Server integration that enables users to query, monitor, and analyze databases directly through Claude. It supports schema exploration, performance analysis, and optional write operations via natural language commands.Last updated491MIT
- AlicenseAqualityDmaintenanceA read-only MCP server for SQL Server database introspection that enables Claude to explore and query databases via tools like listing objects and executing SELECT queries.Last updated201MIT
- Alicense-qualityDmaintenanceEnables Claude Code and other MCP clients to interact with Microsoft SQL Server databases through standardized tools for query execution, schema exploration, table management, and stored procedure execution.Last updated2311MIT
- Alicense-qualityCmaintenanceA Model Context Protocol (MCP) server for SQL Server / Azure SQL that enables querying, monitoring, and analyzing databases directly from Claude.Last updated27MIT
Related MCP Connectors
MCP server for interacting with the Supabase platform
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Official Microsoft MCP Server to query Microsoft Entra data using natural language
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Cyronius/claude-database-tools'
If you have feedback or need assistance with the MCP directory API, please join our Discord server