
py-az-MCP
Un serveur MCP Azure
3 years
Works with Finder
0
Github Watches
0
Github Forks
0
Github Stars
Azure MCP Server
A Model Context Protocol (MCP) server implementation that provides programmatic access to Azure Cloud resources through Azure CLI commands. This server enables seamless integration with Azure services and supports a wide range of Azure operations.
Features
Authentication
- Service Principal authentication support
- Automatic token management
- Environment variable configuration
Supported Azure Operations
Compute
- Virtual Machines (list, show, start, stop, delete, restart)
- Virtual Machine Scale Sets (list, scale, update)
- Azure Kubernetes Service (list clusters)
Storage
- Storage Accounts (list, show, create, delete)
- Storage Containers (list, create, delete)
App Services
- Web Apps (list, show, create, delete, start, stop, restart)
- Function Apps (list, show, delete, start, stop, restart)
- Deployment management
Networking
- Virtual Networks (list)
- Network Security Groups (list)
- Public IP Addresses (list)
Database
- SQL Servers (list)
- Cosmos DB Accounts (list)
Security
- Key Vaults (list, create, delete)
- Secrets Management (list, set, delete)
- Managed Identities (list)
Container Registry
- Registry Management (list, create, delete, update)
- Repository Management (list)
Resource Management
- Resource Groups (list, show, create, delete)
- Role Assignments (list, create, delete)
- Role Definitions (list)
- Subscription Management (list, show)
Prerequisites
- Python 3.13 or higher
- Azure CLI installed and configured
- Azure subscription and appropriate permissions
- Service Principal with required access
Installation
- Clone the repository:
git clone <repository-url>
cd py-az-mcp
- Install dependencies using
uv
:
uv pip install -r requirements.txt
Configuration
- Create a Service Principal and configure environment variables by running the utility script:
python create_service_principal.py
This script will:
- Authenticate you with Azure interactively
- Create a new Service Principal with Contributor role
- Automatically generate a
.env
file with the required credentials:- AZURE_CLIENT_ID
- AZURE_CLIENT_SECRET
- AZURE_TENANT_ID
- AZURE_SUBSCRIPTION_ID
Note: The .env
file is automatically excluded from git tracking for security purposes.
Claude Desktop Configuration
To use this MCP server with Claude Desktop, configure the following:
- Create or update the Claude Desktop configuration file:
{
"mcpServers": {
"Azure": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"/your-path-to/py-az-mcp/server-azure.py"
]
}
}
}
The configuration file is located at:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Linux:
~/.config/Claude/claude_desktop_config.json
-
Replace
YOUR_USERNAME
with your actual system username in both paths. -
Ensure your virtual environment is properly set up:
cd /Users/YOUR_USERNAME/Source/Code/py-az-mcp
python -m venv .venv
source .venv/bin/activate
pip install mcp[cli]
- Verify the configuration:
- Open Claude Desktop
- Click on the settings icon (⚙️)
- Navigate to the "MCP Servers" section
- The Azure server should be listed and enabled
Note: The server will start automatically when needed by Claude Desktop. Ensure all environment variables from the .env
file are properly configured before using Azure commands through Claude.
Usage
- Start the MCP server:
uv run --with mcp[cli] mcp run server-azure.py
- The server will be available at
http://127.0.0.1:6274
Example API Calls
List all subscriptions:
curl -X POST http://127.0.0.1:6274/tool/azure-cli -H "Content-Type: application/json" -d '{"command": "account list --output json"}'
List all resource groups:
curl -X POST http://127.0.0.1:6274/tool/azure-cli -H "Content-Type: application/json" -d '{"command": "group list --output json"}'
Project Structure
-
server-azure.py
: Main MCP server implementation with Azure CLI integration -
create_service_principal.py
: Utility script for creating Azure Service Principal -
pyproject.toml
: Project dependencies and configuration -
.env
: Environment variables configuration (not tracked in git)
Error Handling
The server includes comprehensive error handling:
- JSON validation for all responses
- Azure CLI error capture and formatting
- Authentication error handling
- Parameter validation
Security Considerations
- Uses Service Principal authentication
- Supports environment variable configuration for sensitive data
- Implements proper error handling to prevent information disclosure
- Validates all input parameters
Contributing
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
License
MIT License
Copyright (c) 2025
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
相关推荐
🔥 1Panel fournit une interface Web intuitive et un serveur MCP pour gérer des sites Web, des fichiers, des conteneurs, des bases de données et des LLM sur un serveur Linux.
🧑🚀 全世界最好的 LLM 资料总结 (数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Résumé des meilleures ressources LLM du monde.
⛓️RULEGO est un cadre de moteur de règle d'orchestration des composants de nouvelle génération légère, intégrée, intégrée et de nouvelle génération pour GO.
Créez facilement des outils et des agents LLM à l'aide de fonctions Plain Bash / JavaScript / Python.
😎简单易用、🧩丰富生态 - 大模型原生即时通信机器人平台 | 适配 QQ / 微信 (企业微信、个人微信) / 飞书 / 钉钉 / Discord / Telegram / Slack 等平台 | 支持 Chatgpt 、 Deepseek 、 Dify 、 Claude 、 GEMINI 、 XAI 、 PPIO 、 OLLAMA 、 LM Studio 、阿里云百炼、火山方舟、 Siliconflow 、 Qwen 、 Moonshot 、 ChatGlm 、 Sillytraven 、 MCP 等 LLM 的机器人 / Agent | Plateforme de bots de messagerie instantanée basés sur LLM, prend en charge Discord, Telegram, WeChat, Lark, Dingtalk, QQ, Slack
Reviews

user_KpHXexCa
As an avid user of the py-az-mcp application by JCallico, I must say it's an outstanding tool. The user experience is seamless, and the functionalities offered are top-notch. The application is well-structured, making it easy to navigate and use. I highly recommend it to anyone looking for a reliable and efficient solution.

user_c5yIMpiw
As a dedicated user of the py-az-mcp by JCallico, I must say this tool has greatly enhanced my workflows. Its intuitive design and seamless integration have streamlined my processes remarkably. Highly recommend it to anyone seeking efficient and reliable productivity solutions!

user_LNG7WjMG
As a dedicated user of the py-az-mcp application by JCallico, I am thoroughly impressed by its seamless integration and user-friendly interface. This application not only simplifies my workflow but also enhances productivity by providing efficient solutions within the Azure environment. Highly recommended for anyone looking to streamline their processes!

user_lUxWUwU3
As a dedicated user of the py-az-mcp application by JCallico, I must say it has revolutionized my workflow. The intuitive design and robust functionality make it an essential tool in my toolkit. Whether I'm debugging or streamlining processes, this app never disappoints. Highly recommend it to anyone seeking efficiency and reliability!

user_Tn291Sgq
As a devoted user of the py-az-mcp application, I must say it has significantly streamlined my development workflow. JCallico has done a fantastic job creating a user-friendly and efficient tool. The ease of use and seamless integration with my existing projects make it a go-to application for my Python Azure management coding practices. Highly recommend this for anyone looking for a reliable MCP application!

user_vkNkY2jR
I've been using py-az-mcp by JCallico for a while now, and it has positively transformed my workflow. Its seamless integration and intuitive interface make complex processes straightforward. The support documentation is thorough, which significantly reduces the learning curve. Highly recommend it for anyone looking to optimize their MCP applications!

user_xRMJILJK
I've been using py-az-mcp for a while now, and I must say it has significantly improved my workflow. JCallico did a fantastic job with this product, making it both user-friendly and powerful. The seamless integration and efficient performance are particularly impressive. Highly recommend it to anyone in need of a reliable MCP application!

user_AZGUzQJL
The py-az-mcp by JCallico is an outstanding tool that has greatly simplified my workflow. Its user-friendly interface and seamless integration make it a must-have for anyone working in this field. The detailed documentation provided ensures a smooth onboarding process. Highly recommended!

user_tSs70IIi
As a dedicated user of the py-az-mcp application by JCallico, I must say it has greatly simplified my workflow. The seamless integration and user-friendly interface make it incredibly efficient for managing multiple processes. The Welcome message sets a positive tone right from the start, and the comprehensive documentation is a huge plus. Highly recommended for anyone needing a reliable MCP solution!

user_gSPpAv5J
As a dedicated user of the py-az-mcp application by JCallico, I've found it to be an exceptional tool. The user interface is intuitive, and the performance is consistently reliable. This product has substantially streamlined my workflow, and the comprehensive documentation available makes it effortless to get started. Highly recommended for anyone looking to enhance their productivity with a robust and efficient application.

user_zawFpZg2
I've been using py-az-mcp by JCallico and it's been a game-changer for my projects. The ease of use and robust features have significantly streamlined my workflow. Though it lacks a detailed product description and the initial setup can be a bit daunting, once you're up and running, it performs flawlessly. Highly recommended for anyone looking to enhance their application efficiency!

user_xB8Bhm8V
I've been using the py-az-mcp application by JCallico and I'm thoroughly impressed. The user-friendly interface and seamless functionality make it a standout product. Its integration capabilities and customizable options perfectly meet my needs. Highly recommend this to anyone looking for a reliable MCP solution.

user_Rxb7lQSd
As a dedicated user of the py-az-mcp application, I must say it has completely transformed my workflow. JCallico has done an excellent job creating this tool, making it highly reliable and user-friendly. The integration and performance are seamless, and I appreciate the attention to detail in every aspect. Highly recommended for anyone looking for an efficient MCP solution!