From mcp-sql-server
Set up the mcp-sql-server MCP server for SQL Server database connectivity. Creates an isolated Python environment, installs the server, configures database credentials, and registers the MCP server with Claude Code. Use when the user wants to connect to a SQL Server database, set up MCP SQL Server, or says "setup sql server".
npx claudepluginhub odeciojunior/claude-play --plugin mcp-sql-serverThis skill uses the workspace's default tool permissions.
Automated setup wizard for the [mcp-sql-server](https://github.com/odeciojunior/mcp-sql-server) MCP server.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Executes pre-written implementation plans: critically reviews, follows bite-sized steps exactly, runs verifications, tracks progress with checkpoints, uses git worktrees, stops on blockers.
Guides idea refinement into designs: explores context, asks questions one-by-one, proposes approaches, presents sections for approval, writes/review specs before coding.
Automated setup wizard for the mcp-sql-server MCP server.
Follow these steps in order. Stop and report to the user if any step fails.
Run the setup script to check Python availability:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/setup.sh" check-python
sudo apt-get install python3 python3-venv (Ubuntu/Debian) or sudo dnf install python3 (RHEL/Fedora)bash "${CLAUDE_PLUGIN_ROOT}/scripts/setup.sh" check-odbc
odbcad32.exe) → Drivers tabodbcinst -q -d or dpkg -l | grep msodbcsqlbash "${CLAUDE_PLUGIN_ROOT}/scripts/setup.sh" install-venv
apt-get install git / winget install git) and retry.~/.claude/mcp-servers/mcp-sql-server/.venv/bin/pip install git+https://github.com/odeciojunior/mcp-sql-server.git~/.claude/mcp-servers/mcp-sql-server/.venv/Scripts/pip install git+https://github.com/odeciojunior/mcp-sql-server.gitrm -rf ~/.claude/mcp-servers/mcp-sql-server/.venv then re-run install-venv.bash "${CLAUDE_PLUGIN_ROOT}/scripts/setup.sh" verify-install
install-venv command from Step 3 (one retry — do not re-enter the Step 3 diagnostic tree). If Step 4 fails again:
~/.claude/mcp-servers/mcp-sql-server/.venv/bin/pip list~/.claude/mcp-servers/mcp-sql-server/.venv/Scripts/pip listFirst, try to detect an existing .env file:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/setup.sh" detect-env .
If .env found (exit 0):
If .env not found (exit 1) or user declined:
Validate before continuing:
yes, no, true, false (case-insensitive) — re-prompt if unrecognizedFirst determine the correct Python interpreter path for the platform:
~/.claude/mcp-servers/mcp-sql-server/.venv/bin/python~/.claude/mcp-servers/mcp-sql-server/.venv/Scripts/python.exeDetect which applies by checking whether uname -s output starts with MINGW, MSYS, or CYGWIN.
Ask the user: "Where should I register the MCP server?"
Present these 3 options:
| Option | Description | Where credentials are stored |
|---|---|---|
| project-private (default) | This project only, credentials gitignored | .mcp.json + .gitignore |
| project-shared | This project only, credentials visible to team | .mcp.json (not gitignored) |
| user-global | All projects on this machine | ~/.claude.json |
Recommend project-private unless the user has a reason to choose otherwise. Explain: "project-private keeps credentials in .mcp.json (which gets added to .gitignore so they never leak to git). Each project gets its own database config."
.mcp.json is gitignored:bash "${CLAUDE_PLUGIN_ROOT}/scripts/setup.sh" ensure-gitignore "$CLAUDE_PROJECT_DIR" ".mcp.json"
.mcp.json:bash "${CLAUDE_PLUGIN_ROOT}/scripts/setup.sh" register-mcp-json \
"$CLAUDE_PROJECT_DIR/.mcp.json" \
"<python-path>" \
"<DB_HOST>" "<DB_PORT>" "<DB_USER>" "<DB_PASSWORD>" "<DB_NAME>" \
"<DB_DRIVER>" "<DB_ENCRYPT>" "<DB_TRUST_CERT>"
Substitute <DB_DRIVER> with the driver name from Step 2, or ODBC Driver 18 for SQL Server if the user accepted the default.
If the project .mcp.json already exists, the script merges the mcp-sql-server entry into the existing mcpServers object — other servers (e.g., docker) are preserved.
Same as Option A Step 2 (write to .mcp.json), but skip the ensure-gitignore step. Warn the user: "Credentials will be visible in git. Make sure this is a non-sensitive dev database."
Always attempt claude mcp add first. If it exits non-zero (for any reason — shell expansion, conflicts, permissions), automatically fall through to the .mcp.json direct-edit fallback in Option A.
claude mcp add --transport stdio --scope user \
-e DB_HOST=<host> \
-e DB_USER=<user> \
-e DB_PASSWORD=<password> \
-e DB_NAME=<database> \
[-e DB_PORT=<port>] \
[-e DB_DRIVER=<driver>] \
[-e DB_ENCRYPT=<true/false>] \
[-e DB_TRUST_CERT=<true/false>] \
mcp-sql-server -- \
<python-path> -m mcp_sql_server.server
Only include optional -e flags if the user provided non-default values.
Tip: If <password> contains special shell characters (e.g. !, $, backslashes, quotes), export it first and reference the variable: export DB_PASSWORD='your_password', then use -e DB_PASSWORD=$DB_PASSWORD instead.
Fallback if claude mcp add --scope user fails: Re-run using the export DB_PASSWORD approach above. If it still fails, fall back to Option A (project-private) and inform the user. Note: this fallback registers the server at project scope, not user-global — inform the user that the registration will be project-private for this project only.
claude mcp list
mcp-sql-server appears: proceed to Step 8.--scope user: run claude mcp list --scope user — user-scoped servers may not appear in the default list.mcp-sql-server entry. If so, run claude mcp remove mcp-sql-server first, then retry Step 6.Print a summary:
MCP SQL Server setup complete!
Server: mcp-sql-server
Database: <DB_DATABASE> on <DB_HOST>
Scope: project-private | project-shared | user-global
Available tools (10):
- execute_query Run read-only SELECT queries
- execute_statement Execute INSERT/UPDATE/DELETE
- execute_query_file Run SQL from .sql files
- list_tables List all tables
- describe_table Get column details
- get_view_definition View SQL source
- get_function_definition UDF SQL source
- list_procedures List stored procedures
- execute_procedure Run stored procedure
- list_databases List configured connections
Tip: For specialized SQL Server agents, also install:
claude plugin install sql-server-tools@claude-play
This skill can be re-run to:
Switching scopes: If changing from user-global to project-private, run claude mcp remove mcp-sql-server --scope user first to remove the global entry, then re-run setup and choose project-private.
If setup fails:
pip install git+https://github.com/odeciojunior/mcp-sql-server.git manuallyclaude mcp list to check for conflicts, then claude mcp remove mcp-sql-server and re-run setup