Update vendored MssqlMcp from upstream SQL-AI-samples and rebuild
Updates vendored MssqlMcp from upstream and rebuilds Node.js and .NET servers.
/plugin marketplace add melodic-software/claude-code-plugins/plugin install microsoft@melodic-software[--check] [--node-only] [--dotnet-only]Update the vendored MssqlMcp files from the upstream Azure-Samples/SQL-AI-samples repository.
The MssqlMcp code is vendored (copied) from upstream, not a git submodule. This command:
WARNING: Local Patches Will Be Overwritten
This plugin includes local patches to the upstream code (documented in
vendor/MssqlMcp/PATCHES.md). After updating, you MUST re-apply these patches:
- Multi-auth support in
Node/src/index.ts(AUTH_TYPE env var)See
PATCHES.mdfor detailed re-application instructions.
| Flag | Description |
|---|---|
--check | Show what would change without applying |
--node-only | Only rebuild Node.js server |
--dotnet-only | Only rebuild .NET server |
# Create temp directory
TEMP_DIR=$(mktemp -d)
cd "$TEMP_DIR"
# Shallow clone just the MssqlMcp directory
git clone --depth 1 --filter=blob:none --sparse \
https://github.com/Azure-Samples/SQL-AI-samples.git
cd SQL-AI-samples
git sparse-checkout set MssqlMcp
# Get latest commit info
LATEST_COMMIT=$(git rev-parse --short HEAD)
LATEST_MESSAGE=$(git log -1 --format=%s)
# Read current version from vendor
cd "${CLAUDE_PLUGIN_ROOT}"
CURRENT_COMMIT=$(cat plugins/microsoft/vendor/MssqlMcp/VERSION 2>/dev/null || echo "unknown")
Report:
MssqlMcp Update Check
Current: ${CURRENT_COMMIT}
Upstream: ${LATEST_COMMIT} - ${LATEST_MESSAGE}
If --check, exit here with diff summary.
# Backup current
mv plugins/microsoft/vendor/MssqlMcp plugins/microsoft/vendor/MssqlMcp.bak
# Copy new files (preserving dist/ from backup)
cp -r "$TEMP_DIR/SQL-AI-samples/MssqlMcp" plugins/microsoft/vendor/
cp -r plugins/microsoft/vendor/MssqlMcp.bak/Node/dist plugins/microsoft/vendor/MssqlMcp/Node/ 2>/dev/null || true
cp -r plugins/microsoft/vendor/MssqlMcp.bak/Node/node_modules plugins/microsoft/vendor/MssqlMcp/Node/ 2>/dev/null || true
# Write version file
echo "${LATEST_COMMIT}" > plugins/microsoft/vendor/MssqlMcp/VERSION
# Cleanup
rm -rf plugins/microsoft/vendor/MssqlMcp.bak
rm -rf "$TEMP_DIR"
Unless --dotnet-only:
cd plugins/microsoft/vendor/MssqlMcp/Node
npm install
npm run build
Unless --node-only:
cd plugins/microsoft/vendor/MssqlMcp/dotnet
dotnet build
IMPORTANT: Read and re-apply patches from PATCHES.md:
cat plugins/microsoft/vendor/MssqlMcp/PATCHES.md
Current patches to re-apply:
Node/src/index.ts:
AuthType typecreateSqlConfig() with multi-auth factoryensureSqlConnection() for SQL authAfter re-applying, rebuild:
cd plugins/microsoft/vendor/MssqlMcp/Node
npm run build
cd "${CLAUDE_PLUGIN_ROOT}"
git status --short plugins/microsoft/vendor/MssqlMcp/
Update Available:
MssqlMcp Update
Upstream: abc1234 - Add new query tool
Updating files...
Copied: MssqlMcp/Node/src/
Copied: MssqlMcp/dotnet/
Rebuilding Node.js server...
npm install: 180 packages
npm build: Success
WARNING: Local patches were overwritten!
Re-apply patches from PATCHES.md:
1. Multi-auth support (Node/src/index.ts)
After re-applying patches:
cd plugins/microsoft/vendor/MssqlMcp/Node && npm run build
Changes ready to commit:
M plugins/microsoft/vendor/MssqlMcp/Node/src/index.ts
M plugins/microsoft/vendor/MssqlMcp/Node/dist/index.js
A plugins/microsoft/vendor/MssqlMcp/Node/src/tools/NewTool.ts
Run: git add -A plugins/microsoft/vendor/MssqlMcp && git commit -m "chore(microsoft): update MssqlMcp to abc1234"
Already Up to Date:
MssqlMcp Update Check
Current: abc1234
Upstream: abc1234
Already up to date.
# Check for updates
/microsoft:update-mssql --check
# Update and rebuild everything
/microsoft:update-mssql
# Update and rebuild only Node.js
/microsoft:update-mssql --node-only
/microsoft:setup-mssql - Initial environment setup/microsoft:test-mssql - Test database connectivity