Azure Management MCP Server

 


Azure Management MCP Server

Manage Azure Virtual Networks, DNS, and Functions through Claude Desktop using natural language.


๐Ÿ“ฆ What's Included

This package contains everything you need to set up an MCP (Model Context Protocol) server that extends Claude Desktop with Azure management capabilities.

Files in This Package:

  • BLOG_POST_COMPLETE_GUIDE.md - Complete tutorial (START HERE!)
  • azure_mcp_server.py - The MCP server script (template with placeholders)
  • requirements.txt - Python dependencies for easy installation
  • SETUP_CHECKLIST.md - Step-by-step checklist to track your progress
  • README.md - This file

๐Ÿš€ Quick Start

1. Read the Complete Guide

Open BLOG_POST_COMPLETE_GUIDE.md and follow along. It contains:

  • Prerequisites
  • Step-by-step installation instructions
  • Configuration guide
  • Usage examples
  • Troubleshooting

2. Use the Checklist

Open SETUP_CHECKLIST.md and check off each step as you complete it. This ensures you don't miss anything.

3. Install Dependencies

pip install -r requirements.txt

Or manually:

pip install mcp azure-identity azure-mgmt-network azure-mgmt-dns azure-mgmt-resource azure-mgmt-web azure-mgmt-storage requests

๐Ÿ“‹ Prerequisites

Before you begin, you need:

  • ✅ Python 3.10 or higher
  • ✅ Azure account (free tier works)
  • ✅ Claude Desktop installed
  • ✅ Azure CLI installed
  • ✅ 30-45 minutes

๐ŸŽฏ What This MCP Server Can Do

Virtual Networks

  • List all VNets
  • Create new VNets
  • List subnets
  • Create subnets

DNS Management

  • List DNS zones
  • Create DNS zones
  • Create DNS records (A, CNAME, TXT)

Azure Functions

  • List Function Apps
  • Create Function Apps (Python, Node.js, .NET, Java)
  • Start/Stop/Restart Function Apps
  • Deploy functions from ZIP files

General

  • Check Azure subscription status
  • List resource groups

๐Ÿ”ง Installation Overview

  1. Install Azure CLI - Manage Azure from command line
  2. Install Python - Required to run the MCP server
  3. Create Service Principal - Azure credentials for the server
  4. Install Python packages - Azure SDK and MCP framework
  5. Configure the script - Add your credentials
  6. Configure Claude Desktop - Connect the MCP server
  7. Test - Verify everything works

Full instructions in BLOG_POST_COMPLETE_GUIDE.md


⚙️ Configuration

Step 1: Edit the Script

Open azure_mcp_server.py and replace these placeholders:

TENANT_ID = "YOUR_TENANT_ID_HERE"        # Your Azure tenant ID
CLIENT_ID = "YOUR_CLIENT_ID_HERE"        # Service principal client ID
CLIENT_SECRET = "YOUR_CLIENT_SECRET_HERE"  # Service principal secret
SUBSCRIPTION_ID = "YOUR_SUBSCRIPTION_ID_HERE"  # Azure subscription ID

Step 2: Configure Claude Desktop

Edit Claude Desktop's config file:

Windows: %APPDATA%\Claude\claude_desktop_config.json
Mac: ~/Library/Application Support/Claude/claude_desktop_config.json

Add this configuration:

{
  "mcpServers": {
    "azure-management": {
      "command": "python",
      "args": [
        "/FULL/PATH/TO/azure_mcp_server.py"
      ]
    }
  }
}

Important: Use the full absolute path to the script!

Step 3: Restart Claude Desktop

Completely quit and restart Claude Desktop.


๐Ÿงช Testing

Once configured, test with these commands in Claude Desktop:

Check my Azure subscription status
List all my resource groups
List all my virtual networks

If these work, you're all set! ๐ŸŽ‰


๐Ÿ’ก Usage Examples

Create a Virtual Network

Create a virtual network named "prod-vnet" in resource group "network-rg" 
in East US with address space 10.0.0.0/16

Create a Function App

Create a Python Function App named "my-api" in resource group "app-rg" 
in East US with storage account "myapistorage123"

Manage DNS

Create a DNS zone for "example.com" in resource group "dns-rg"
Create an A record named "www" in zone "example.com" pointing to 1.2.3.4

๐Ÿ”’ Security Notes

Important Security Practices:

  1. Never commit credentials to Git

    # Add to .gitignore
    echo "azure_mcp_server.py" >> .gitignore
    
  2. Keep the script file secure

    • Don't share it with credentials in it
    • Don't upload to public repositories
    • Store in a secure location
  3. Rotate credentials regularly

    • Every 6-12 months
    • After any security incident
    • When team members leave
  4. Use least privilege

    • Only grant necessary permissions
    • Use resource-specific roles when possible
  5. Monitor Azure activity

    • Check activity logs regularly
    • Set up cost alerts
    • Enable Azure Security Center

๐Ÿ› Troubleshooting

MCP Server Not Showing

Check:

  • Path in config is absolute (full path)
  • JSON syntax is valid
  • Claude Desktop was completely restarted

Authentication Failed

Check:

  • Credentials in script are correct
  • Service principal has Contributor role
  • Subscription ID is correct

Module Not Found

Fix:

pip install -r requirements.txt

Python Command Not Found

Windows: Use python in config
Mac/Linux: Use python3 in config


๐Ÿ“š Additional Resources


๐Ÿ†˜ Getting Help

If You're Stuck:

  1. ✅ Review BLOG_POST_COMPLETE_GUIDE.md thoroughly
  2. ✅ Check SETUP_CHECKLIST.md - did you complete all steps?
  3. ✅ Look at the Troubleshooting sections
  4. ✅ Verify all prerequisites are installed
  5. ✅ Check Azure Portal for permission issues

๐Ÿ“ What's Next?

Once your MCP server is working:

Expand Functionality

  • Add more Azure services (Storage, VMs, Databases)
  • Create custom workflows
  • Add organization-specific features

Automate Tasks

  • Environment setup scripts
  • Resource cleanup routines
  • Deployment pipelines

Share with Team

  • Create team-specific MCP server
  • Enforce naming conventions
  • Add compliance checks

๐ŸŽ“ Learning Path

Beginner

  1. Follow the complete guide
  2. Create your first VNet
  3. Set up a DNS zone
  4. Deploy a simple Function App

Intermediate

  1. Automate environment creation
  2. Set up multi-region deployments
  3. Implement tagging strategies
  4. Create monitoring dashboards

Advanced

  1. Add custom Azure services
  2. Implement CI/CD with MCP
  3. Build team collaboration features
  4. Create compliance automation

⚖️ License

This project is provided as-is for educational and practical purposes.

Important: You are responsible for:

  • Securing your Azure credentials
  • Managing Azure costs
  • Compliance with your organization's policies
  • Following Azure's terms of service

๐Ÿ™ Credits


๐Ÿ“Š Quick Stats

  • Lines of Code: ~600
  • Supported Services: 3 (VNet, DNS, Functions)
  • Total Tools: 15+
  • Setup Time: 30-45 minutes
  • Skill Level: Beginner-friendly

๐Ÿšฆ Status Indicators

After setup, you should see:

All Systems Go:

  • MCP server shows in Claude Desktop
  • Subscription check returns authenticated
  • Can list resource groups
  • Can list virtual networks

⚠️ Check Setup:

  • MCP server not showing
  • Authentication errors
  • Module import errors

Needs Attention:

  • Python not installed
  • Azure CLI not installed
  • No service principal created
  • Config file incorrect

๐ŸŽฏ Success Criteria

You've successfully set up the MCP server when:

  1. ✅ Claude Desktop shows the MCP connection
  2. Check my Azure subscription status returns authenticated
  3. ✅ You can list Azure resources
  4. ✅ You can create new resources with natural language commands
  5. ✅ No error messages appear

๐Ÿ“ž Quick Reference

File Locations

Config File:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json

Script File:

  • Wherever you saved azure_mcp_server.py

Common Commands

Install dependencies:

pip install -r requirements.txt

Test Azure connection:

az login
az account show

Verify Python:

python --version

Check MCP installation:

pip show mcp

Ready to get started? Open BLOG_POST_COMPLETE_GUIDE.md and begin! ๐Ÿš€

Download Script MCP Script


Last updated: December 2024

Comments