An MCP (Model Context Protocol) server that helps define and enforce least-privilege access for Azure RBAC. Runs as a containerized Streamable HTTP service — fully compatible with Microsoft Copilot Studio, Claude Desktop, and any MCP client.
| Tool | Description |
|---|---|
analyze_role_assignment |
Detects over-permissioning, privilege escalation paths, and compliance flags |
recommend_roles |
Recommends least-privilege built-in roles for a job function or use case |
generate_custom_role |
Generates custom role ARM JSON + Bicep with a least-privilege score |
explain_permission |
Plain-language breakdown of any Azure permission string |
list_builtin_roles |
Browse the role reference DB, filterable by category or risk level |
list_job_profiles |
Lists job function profiles (vm-operator, devops-engineer, etc.) |
az login
az extension add --name containerapp
# Docker optional — the script uses ACR Tasks (cloud build, no local Docker needed)# Edit the variables at the top of the script first (resource group, ACR name, region)
chmod +x deploy/deploy.sh
./deploy/deploy.shThe script will:
- Create a resource group
- Create an Azure Container Registry and build the image via ACR Tasks
- Deploy the Bicep template (Log Analytics + Container Apps Environment + Container App)
- Output your MCP endpoint URL
# 1. Set your variables
RG="rg-azure-rbac-mcp"
ACR="rbacmcpacr" # globally unique
LOCATION="westus"
# 2. Create RG + ACR
az group create -n $RG -l $LOCATION
az acr create -g $RG -n $ACR --sku Basic --admin-enabled true
# 3. Build and push image (no local Docker needed)
az acr build --registry $ACR --image azure-rbac-mcp:latest --file Dockerfile .
# 4. Update deploy/main.bicepparam with your image, then deploy
az deployment group create \
-g $RG \
-f deploy/main.bicep \
-p @deploy/main.bicepparam \
-p containerImage=$ACR.azurecr.io/azure-rbac-mcp:latestAfter deploying, your MCP URL will look like:
https://azure-rbac-mcp.<hash>.<region>.azurecontainerapps.io/mcp
- Open your agent in Copilot Studio
- Go to Tools → Add a tool → New tool → Model Context Protocol
- Fill in:
- Server name:
Azure RBAC Least Privilege - Server description:
Analyzes Azure RBAC roles for least-privilege access, recommends built-in roles, and generates custom role definitions with CMMC/HIPAA/NIST compliance guidance - Server URL: your MCP URL from above
- Authentication: None (or API Key if you add auth middleware)
- Server name:
- Click Create → all 6 tools appear automatically
- Enable Generative Orchestration in your agent's Settings
- Go to Power Platform portal → Custom Connectors → New custom connector → Import an OpenAPI file
- Upload
deploy/copilot-studio-connector.yaml - Update the
hostfield with your actual Container Apps FQDN - Save and publish the connector
- In Copilot Studio, add the connector as a tool
npm install
npm run dev # ts-node, hot reload
# or
npm run build && npm start
# Test the MCP endpoint
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
# Health check
curl http://localhost:3000/healthsrc/
index.ts ← Express + Streamable HTTP transport
types.ts ← Shared interfaces
tools/
analyzeRole.ts ← Over-permissioning analysis
recommendRoles.ts ← Use-case → role matching
generateCustomRole.ts ← ARM JSON + Bicep generation
explainPermission.ts ← Permission string decoder
data/
builtinRoles.ts ← 25+ built-in roles with risk levels
jobProfiles.ts ← 9 job function → permission profiles
permissionMetadata.ts ← Risk scores for 20+ dangerous permissions
deploy/
main.bicep ← ACA + Log Analytics Bicep template
main.bicepparam ← Parameter values
deploy.sh ← End-to-end build + deploy script
copilot-studio-connector.yaml ← OpenAPI spec for Power Platform connector
| Client | Transport | Config |
|---|---|---|
| Copilot Studio | Streamable HTTP | POST to /mcp |
| Claude Desktop | stdio | See note below |
| curl / test | Streamable HTTP | POST to /mcp |
Claude Desktop stdio mode: If you also want to run this locally with Claude Desktop, you can add a stdio wrapper. The HTTP server is the primary deployment target.
Analysis and recommendations include guidance for:
- CMMC Level 2 (AC.1.001, AC.2.005, AC.2.006, AC.3.017)
- HIPAA (164.312(a)(1), 164.312(a)(2)(i))
- NIST 800-171 (3.1.5, 3.1.6)
- FedRAMP (AC-6)