Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

microsoft Plugin

Official Microsoft MCP servers: Microsoft Learn documentation, Azure resource management, NuGet package discovery, Azure DevOps, and SQL Server database access.

Prerequisites

  • microsoft-learn: No prerequisites (HTTP-based)
  • azure: Node.js (npx), Azure CLI, az login for authenticated access
  • nuget: .NET 10 SDK (dnx command)
  • azure-devops: Node.js (npx), Azure DevOps organization + PAT or az login
  • mssql-node: Node.js 18-24 via fnm (pre-built; Node 25+ has breaking changes)
  • mssql-dotnet: .NET 8 SDK (ships with plugin, pre-built exe)

Each MCP server operates independently. If prerequisites for one server are not met, that server fails gracefully while others continue to work.

Installation

/plugin install microsoft@claude-code-plugins

The plugin ships with pre-built MssqlMcp servers - no additional setup required for basic LocalDB usage.

MCP Servers

Server Type Capabilities
microsoft-learn HTTP Search official Microsoft/Azure documentation, fetch full article content
azure stdio Azure resource management (Cosmos DB, Storage, App Service, etc.)
nuget stdio Package version discovery, security updates, dependency conflict resolution via NuGetSolver
azure-devops stdio Work items, repositories, pipelines, and project management
mssql-node stdio Natural language SQL queries, CRUD operations (experimental)
mssql-dotnet stdio Structured database tools, schema operations (experimental)

microsoft-learn

The official Microsoft Learn MCP server provides:

  • microsoft_docs_search: Search documentation and return concise content chunks with titles and URLs
  • microsoft_code_sample_search: Search for code snippets and examples by language
  • microsoft_docs_fetch: Fetch complete documentation pages as markdown

azure

The Azure MCP Server (@azure/mcp) provides resource management capabilities:

  • List and manage Azure subscriptions
  • Manage resource groups, storage accounts, Cosmos DB, App Service, and more
  • Requires Azure CLI authentication (az login)

nuget

The NuGet MCP Server (NuGet.Mcp.Server) provides:

  • Package version discovery and metadata
  • Security vulnerability detection
  • Dependency conflict resolution via NuGetSolver

Requires .NET 10 SDK which provides the dnx command.

Note: Uses your NuGet.config for package sources. Defaults to nuget.org if no config exists.

azure-devops

The Azure DevOps MCP Server (@azure-devops/mcp) provides:

  • core: Project and team management
  • work-items: Work items, queries, and boards
  • repositories: Git repositories and pull requests
  • pipelines: Build and release pipelines
  • test-plans: Test plans and test runs

Requires Azure DevOps organization access. Authenticates via:

  1. PAT (Personal Access Token): Set AZURE_DEVOPS_ORG and AZURE_DEVOPS_PAT environment variables
  2. Azure CLI: Run az login if no PAT is provided (still requires AZURE_DEVOPS_ORG)

Configure which domains to enable via AZURE_DEVOPS_DOMAINS (comma-separated).

mssql-node

The Node.js MssqlMcp server from Azure-Samples provides:

  • Natural language to SQL query conversion
  • CRUD operations on tables
  • Schema exploration

Status: Experimental, pre-built and ready to use

Authentication: Supports multiple authentication types via MSSQL_AUTH_TYPE:

AUTH_TYPE Use Case Requirements
azure-default Azure SQL with az login (default) Azure CLI logged in
sql Username/password authentication MSSQL_USER, MSSQL_PASSWORD
azure-interactive Azure AD with browser popup Interactive browser access

Note: For LocalDB with Windows Authentication, use mssql-dotnet instead (Node.js mssql package doesn't support Windows Integrated Auth without native drivers).

mssql-dotnet

The .NET MssqlMcp server from Azure-Samples provides structured tools:

  • ListTables: List all tables in database
  • DescribeTable: Get table schema details
  • CreateTable: Create new tables
  • DropTable: Remove tables
  • InsertData: Insert records
  • ReadData: Query records
  • UpdateData: Update records

Status: Experimental, pre-built and ready to use

Default Configuration: Connects to LocalDB via connection string

Commands

Command Description
/microsoft:setup-mssql Rebuild MssqlMcp servers (optional, pre-built ships with plugin)
/microsoft:setup-dab Install and configure Data API Builder
/microsoft:update-mssql Pull latest changes and rebuild MssqlMcp servers
/microsoft:test-mssql Test SQL Server MCP connectivity

Environment Variables

General

Variable Default Description
MICROSOFT_LEARN_PARAMS (none) Query params (e.g., ?maxTokenBudget=2000)
AZURE_MCP_MODE namespace Server mode: namespace (default), all, consolidated, single
AZURE_SUBSCRIPTION_ID (from az login) Azure subscription ID
AZURE_TENANT_ID (from az login) Azure tenant ID
NUGET_MCP_PRERELEASE --prerelease Set to empty to disable prerelease
AZURE_DEVOPS_ORG (required) Azure DevOps organization name
AZURE_DEVOPS_PAT (uses az login) Personal Access Token for authentication
AZURE_DEVOPS_DOMAINS core,work-items,repositories,pipelines Comma-separated domains to enable

SQL Server (Node.js)

Variable Default Description
MSSQL_AUTH_TYPE azure-default Auth type: sql, azure-default, azure-interactive
MSSQL_SERVER_NAME localhost SQL Server hostname (e.g., server.database.windows.net)
MSSQL_DATABASE_NAME master Target database name
MSSQL_USER (none) SQL username (required for AUTH_TYPE=sql)
MSSQL_PASSWORD (none) SQL password (required for AUTH_TYPE=sql)
MSSQL_ENCRYPT true "true" to encrypt connections (required for Azure)
MSSQL_READONLY true "true" for read-only mode
MSSQL_CONNECTION_TIMEOUT 30 Timeout in seconds
MSSQL_TRUST_CERT true "true" to trust self-signed certificates

SQL Server (.NET)

Variable Default Description
MSSQL_CONNECTION_STRING LocalDB string Full SQL Server connection string

Default connection string: Server=(localdb)\MSSQLLocalDB;Database=master;Integrated Security=true;TrustServerCertificate=true

SQL Server Quick Start

Windows LocalDB (Zero Configuration)

On Windows with Visual Studio or SQL Server Express installed, the MssqlMcp servers work out-of-box with LocalDB:

# Just restart Claude Code - mssql-node and mssql-dotnet connect automatically
# Default: localhost, master database, read-only mode

Verify LocalDB is available:

sqllocaldb info MSSQLLocalDB

Azure SQL Database (Default)

Uses az login credentials via DefaultAzureCredential:

# Login to Azure first
az login

# Configure in .claude/settings.json
{
  "env": {
    "MSSQL_SERVER_NAME": "myserver.database.windows.net",
    "MSSQL_DATABASE_NAME": "mydb"
  }
}

SQL Server with Username/Password

For SQL authentication (works with Azure SQL, local SQL Server, or Docker):

{
  "env": {
    "MSSQL_AUTH_TYPE": "sql",
    "MSSQL_SERVER_NAME": "localhost",
    "MSSQL_DATABASE_NAME": "MyDb",
    "MSSQL_USER": "sa",
    "MSSQL_PASSWORD": "YourPassword",
    "MSSQL_ENCRYPT": "false",
    "MSSQL_TRUST_CERT": "true"
  }
}

Custom SQL Server (.NET only)

For LocalDB or Windows Authentication, use mssql-dotnet with a connection string:

{
  "env": {
    "MSSQL_CONNECTION_STRING": "Server=localhost;Database=MyDb;Trusted_Connection=True;TrustServerCertificate=True"
  }
}

Connection String Examples

# LocalDB (Windows default)
Server=(localdb)\MSSQLLocalDB;Database=master;Integrated Security=true;TrustServerCertificate=true

# Local SQL Server with Windows Authentication
Server=localhost;Database=MyDb;Trusted_Connection=True;TrustServerCertificate=True

# Azure SQL with Azure AD Interactive
Server=tcp:server.database.windows.net,1433;Database=MyDb;Authentication=Active Directory Interactive

# SQL Server with username/password
Server=localhost;Database=MyDb;User Id=sa;Password=YourPassword;TrustServerCertificate=True

Choosing an SQL Server MCP

Use Case Recommended Server
LocalDB / Windows SQL Server mssql-dotnet
Azure SQL Database (AAD auth) mssql-node
Learning/experimentation mssql-dotnet

Note: mssql-node requires Azure SQL Database with Azure AD authentication. For LocalDB or on-premises SQL Server with Windows Authentication, use mssql-dotnet.

For production apps requiring RBAC and caching, see Data API Builder (Advanced) below.

Initial Startup

Both dnx and npx download packages on first use, so initial startup may be slower. Subsequent invocations use cached packages.

The mssql-node and mssql-dotnet servers ship pre-built and start immediately.

Troubleshooting

mssql-node fails to connect

Check your authentication type and configuration:

For Azure SQL (default, azure-default):

  1. Run az login to authenticate
  2. Verify your account has access to the database
  3. Check server name format: server.database.windows.net

For SQL auth (MSSQL_AUTH_TYPE=sql):

  1. Verify MSSQL_USER and MSSQL_PASSWORD are set
  2. For local servers, set MSSQL_ENCRYPT=false and MSSQL_TRUST_CERT=true
  3. Check SQL Server allows SQL authentication (mixed mode)

For LocalDB/Windows Authentication:

mssql-node does NOT support Windows Integrated Auth. Use mssql-dotnet instead.

General debugging:

  1. Check Node.js version: node --version (must be 18-24, not 25+)
  2. Check MCP logs for detailed errors
  3. Try connecting with sqlcmd to verify credentials work

mssql-node crashes with "Cannot read properties of undefined (reading 'prototype')"

This error occurs on Node.js 25+ due to the removal of the deprecated SlowBuffer API.

Fix: Use fnm with Node 22 as default:

fnm install 22
fnm default 22

Then restart Claude Code. If using nvm-windows, uninstall it and switch to fnm (see project README).

mssql-dotnet fails to start

The plugin ships with a pre-built exe. If it fails to start:

  1. Verify the exe exists: ls vendor/MssqlMcp/dotnet/MssqlMcp/bin/Debug/net8.0/MssqlMcp.exe
  2. Rebuild if missing: /microsoft:setup-mssql --dotnet
  3. Check MCP logs for detailed error messages

To rebuild from scratch:

  1. Verify .NET 8 SDK: dotnet --version
  2. Clear NuGet cache: dotnet nuget locals all --clear
  3. Rebuild: dotnet build vendor/MssqlMcp/dotnet/MssqlMcp

azure-devops shows missing AZURE_DEVOPS_ORG

Set the required environment variable:

{
  "env": {
    "AZURE_DEVOPS_ORG": "your-organization-name"
  }
}

Data API Builder (Advanced)

For production applications requiring RBAC and caching, use Microsoft Data API Builder (DAB). DAB is not enabled by default because it requires manual setup and runs as a separate HTTP server.

Features

  • RBAC: Role-based access control at entity level
  • Caching: Automatic result caching
  • Deterministic queries: NL2DAB instead of fragile NL2SQL
  • Telemetry: Built-in observability

Setup

  1. Run /microsoft:setup-dab to install and configure DAB
  2. Add entities: dab add Products --source dbo.Products --permissions "anonymous:read"
  3. Start DAB server (separate terminal): dab start
  4. Add mssql-dab to your project's .claude/settings.json:
{
  "mcpServers": {
    "mssql-dab": {
      "type": "http",
      "url": "http://localhost:5000/mcp"
    }
  }
}

Environment Variables

Variable Required Description
DAB_MCP_URL No MCP endpoint (default: http://localhost:5000/mcp)
DAB_CONNECTION_STRING Yes SQL Server connection string (used by dab start)
DAB_CONFIG_PATH No Path to dab-config.json (default: ./dab-config.json)

Documentation

Related Plugins

  • dotnet: .NET build automation (uses microsoft-learn MCP for error resolution)
  • claude-ecosystem: Core Claude Code functionality

Related Documentation

License

MIT