
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
azure-policy-mcp
Advanced tools
MCP server for generating policy-compliant Azure Bicep infrastructure from natural language descriptions
A Model Context Protocol (MCP) server that provides Azure policy analysis and Bicep template generation capabilities for Claude Code. Generate policy-compliant Azure infrastructure using natural language descriptions and GitHub Search API for fast, real-time results.
The Azure Policy MCP Server integrates Azure policy intelligence with Bicep template generation, enabling developers to:
Built with GitHub Search API for fast responses and real-time data access.
Add the following to your Claude Code .mcp.json configuration file:
{
"azure-policy-mcp": {
"command": "npx",
"args": ["-y", "azure-policy-mcp"],
"transport": {"type": "stdio"},
"env": {
"NODE_ENV": "production",
"GITHUB_TOKEN": "your_github_token_here"
},
"disabled": false,
"autoApprove": [],
"description": "Azure Policy MCP Server - Generate policy-compliant Bicep templates from natural language"
}
}
npm install -g azure-policy-mcp
Then add to your .mcp.json configuration:
{
"azure-policy-mcp": {
"command": "azure-policy-mcp",
"transport": {"type": "stdio"},
"env": {
"GITHUB_TOKEN": "your_github_token_here"
}
}
}
For best performance, add a GitHub personal access token:
public_repo accessWithout a token, you'll be limited to 60 API requests per hour.
Once installed, the Azure Policy MCP integrates seamlessly with Claude Code. Use natural language commands:
"Create a secure storage account for healthcare data"
"What policies apply to virtual machines in my subscription?"
"Validate this Bicep template against Azure policies"
"Fix policy violations in my infrastructure template"
"Get overview of Azure Key Vault documentation"
"Show me only the properties for Azure App Service"
"Get Bicep examples and API versions for Storage Accounts"
analyze_policy_requirementsAnalyze Azure policies applicable to specific resource types and provide compliance guidance.
Parameters:
resource_types (required): Array of Azure resource types (e.g., ["Microsoft.Storage/storageAccounts"])policy_categories (optional): Filter by policy categories (e.g., ["Security", "Compliance"])include_deprecated (optional): Include deprecated policies (default: false)validate_bicep_against_policiesValidate Bicep template against Azure policies and identify compliance issues.
Parameters:
bicep_content (required): Bicep template content to validatepolicy_categories (optional): Policy categories to validate againstsearch_bicep_templatesSearch Azure Bicep templates by resource types, categories, and keywords.
Parameters:
resource_types (optional): Resource types to search forcategories (optional): Template categories (Compute, Storage, Network, etc.)keywords (optional): Keywords to search in template namesmax_complexity (optional): Maximum template complexity (simple, moderate, complex)limit (optional): Maximum number of results (default: 10)recommend_bicep_templatesGet template recommendations based on requirements and generate policy-compliant Bicep code.
Parameters:
requirements (required): Natural language description of infrastructure needsresource_types (optional): Specific Azure resource types neededinclude_monitoring (optional): Include monitoring and diagnostics (default: true)include_security (optional): Include security best practices (default: true)fetch_azure_documentation_overviewGet a lightweight overview of Azure resource documentation for quick assessment without information overload.
Parameters:
resource_type (required): Azure resource type (e.g., "Microsoft.Storage/storageAccounts")cache_duration (optional): Cache duration in minutes (default: 60, max: 1440)Returns:
fetch_azure_documentation_detailsGet detailed Azure resource documentation with selective section retrieval to avoid overwhelming users.
Parameters:
resource_type (required): Azure resource type (e.g., "Microsoft.Storage/storageAccounts")sections (optional): Array of sections to retrieve - ["properties", "code_examples", "api_versions", "quick_summary"] (default: all)language (optional): Documentation language preference - "bicep", "arm", or "terraform" (default: "bicep")include_examples (optional): Include code examples in response (default: true)cache_duration (optional): Cache duration in minutes (default: 60, max: 1440)Example Usage:
"Get overview of Azure Storage Account documentation"
"Show me just the API versions for Virtual Machines"
"Get properties and code examples for Azure Key Vault"
"Fetch only Bicep examples for App Service"
refresh_data_sourcesRefresh cached data from GitHub repositories.
Parameters:
data_source (optional): Specific data source to refreshThe MCP server uses GitHub Search API to access real-time data from:
Azure/azure-policy): Official Azure policy definitionsAzure/azure-quickstart-templates): Community-driven Bicep templateslearn.microsoft.com): Live Azure resource documentation scrapingGITHUB_TOKEN: GitHub API token for higher rate limits (recommended)PUPPETEER_EXECUTABLE_PATH: Custom path to Chrome executable for documentation scraping (optional)CACHE_SIZE_MB: Maximum cache size in megabytes (default: 256)LOG_LEVEL: Logging level - error, warn, info, debug (default: info)NODE_ENV: Node environment (default: production)git clone https://github.com/andrewlwn77/azure-policy-mcp.git
cd azure-policy-mcp
npm install
npm run build
npm test # Run all tests
npm run test:unit # Run unit tests
npm run test:integration # Run integration tests
npm run test:coverage # Run with coverage
npm run build # Compile TypeScript
npm run dev # Watch mode for development
The Azure Policy MCP follows a lightweight, API-first architecture:
src/
├── server/ # MCP server and tool implementations
├── services/ # GitHub API integration and parsing
├── infrastructure/ # Caching, session management, error handling
└── types/ # TypeScript definitions
MIT License - see LICENSE file for details
To publish to npm:
npm version patch # or minor, major
npm publish
Note: Publishing requires OTP (One-Time Password) authentication.
For issues and questions:
Built with the BMAD Method for comprehensive, production-ready software development.
FAQs
MCP server for generating policy-compliant Azure Bicep infrastructure from natural language descriptions
The npm package azure-policy-mcp receives a total of 1 weekly downloads. As such, azure-policy-mcp popularity was classified as not popular.
We found that azure-policy-mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.