Azure MCP Agent (Custom)
This repository contains a custom MCP server (server.py) exposing tools to:
- List active Azure role assignments for the signed-in user.
- List Azure resources (subscription-wide or specific resource group).
- Deploy resources via Bicep-backed PowerShell scripts (storage account, key vault, Azure OpenAI, AI Search, AI Foundry).
Prerequisites
- Windows + PowerShell (
pwsh) recommended. - Python 3.10+ installed.
- Azure CLI installed: https://learn.microsoft.com/cli/azure/install-azure-cli
- Logged in to Azure:
az login --use-device-code(or normalaz login). - Appropriate RBAC permissions to list and deploy resources.
Python Setup
cd "c:\Users\v-siddjha\OneDrive - MAQ Software\Desktop\agent"
python -m venv .venv
. .venv\Scripts\Activate.ps1
pip install -r requirements.txt
Run MCP Server Directly
python server.py
This starts the MCP process that tools (e.g., GitHub Copilot Agent) can attach to.
Configure GitHub Copilot to Use This MCP Server
In VS Code settings (JSON view), add an MCP server entry. Example:
"github.copilot.mcpServers": {
"azure-agent": {
"command": "python",
"args": [
"c:/Users/v-siddjha/OneDrive - MAQ Software/Desktop/agent/server.py"
],
"env": {
"PYTHONUNBUFFERED": "1"
}
}
}
Restart VS Code or Copilot Agent session. Copilot should list available tools (azure_login, list_permissions, list_resources, get_resource_parameters, deploy_resource).
Tool Usage (Within Copilot Chat)
- List permissions:
- Prompt:
Call tool list_permissions(optionally passuser_principal_nameorout_file).
- Prompt:
- List resources (all):
- Prompt:
Call tool list_resources.
- Prompt:
- List resources for RG:
- Prompt:
Call tool list_resources {"resource_group_name":"my-rg"}.
- Prompt:
- Discover required params for deployment:
- Prompt:
Call tool get_resource_parameters {"resource_type":"storage-account"}.
- Prompt:
- Deploy a resource (must supply required params):
- Prompt:
Call tool deploy_resource {"resource_type":"storage-account","parameters":{"ResourceGroupName":"my-rg","StorageAccountName":"mystorage123","Location":"eastus","AccessTier":"Hot"}}.
- Prompt:
Local Test Harness (Without Copilot)
Run the included script:
python test_agent.py
Uncomment the deployment section and fill real parameter values before testing resource creation.
Adding New Deployment Scripts
- Place new
deploy-*.ps1inscripts/. - Add a Bicep template in
templates/. - Extend
DEPLOYMENT_SCRIPTSinserver.pywith logical key -> script filename. - Use
get_resource_parametersto see inferred required params.
Notes on Parameter Validation
deploy_resource infers required parameters by detecting if (-not $Param) prompts in the script. Ensure each truly required input has that pattern for stricter enforcement.
Common Issues
Azure CLI not found: Install CLI and restart shell.Not logged in: Runaz login.- Missing permissions: Confirm role assignments (e.g., Reader, Contributor) with
list_permissionstool output. - Deployment failures: Check Bicep template, naming constraints, region availability.
Security Considerations
- Do not hardcode secrets; use Key Vault deployment then store secrets securely.
- Validate user-supplied parameters before passing to scripts if exposing externally.
Cleanup
To remove test resources, use Azure Portal or az group delete -n <RGName> --no-wait --yes.
Happy building! Use the Copilot Agent chat to invoke tools interactively.
Metadata
Release files for azure-sfi-agent-test 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| azure_sfi_agent_test-1.0.1.tar.gz | 26.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| azure_sfi_agent_test-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 60.4 kB
Release files / azure_sfi_agent_test-1.0.1.tar.gz
| Download URL | azure_sfi_agent_test-1.0.1.tar.gz |
|---|---|
| Size | 26.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bf2df9aaeb305c0fd7d78f2381ad2bc23d7417e7ec5812c04156c8e0d9f4b0d6
|
|
BLAKE2b-256 checksum How to use checksums |
51f3985bec46fd34d2c0a85d55e4b11b774a2f1e6e6ad025c8faef460a5fb34f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Release files / azure_sfi_agent_test-1.0.1-py3-none-any.whl
| Download URL | azure_sfi_agent_test-1.0.1-py3-none-any.whl |
|---|---|
| Size | 34.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
219d569447b99144b2983ef6986f03c611deaaead333683cf5650758ece38ec0
|
|
BLAKE2b-256 checksum How to use checksums |
c2ead932010814712420fbb024d5200f13a863638e4615d7d0f55f550d0c28ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Security for azure-sfi-agent-test 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.