Cover image
Try Now
2025-04-14

3 years

Works with Finder

2

Github Watches

0

Github Forks

2

Github Stars

MCP AZD Template npm version

Install with NPX in VS Code Install with NPX in VS Code Insiders

An MCP server that provides tools for working with Azure Developer CLI (azd) templates. This package helps with template validation, analysis, and creation while following best practices.

Installation

Global Installation

To use as a command-line tool:

npm install -g mcp-azd-template

Local Installation

For use in your project:

npm install mcp-azd-template

Usage

As a CLI Tool

After global installation, you can start the MCP server by running:

mcp-azd-template

This runs the server in stdio mode, which integrates with VS Code MCP extensions.

As an MCP Server in VS Code

Add to your VS Code settings.json:

"mcp": {
  "servers": {
    "azd-template-helper": {
      "command": "mcp-azd-template"
    }
  }
}

Using with npx (No Installation Required)

You can use the package directly with npx without installing it:

"mcp": {
  "servers": {
    "azd-template-helper": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-azd-template@latest"
      ]
    }
  }
}

Programmatic Usage

You can use the API programmatically in your JavaScript/TypeScript applications:

import { createServer, listTemplates, analyzeTemplate, validateTemplate } from 'mcp-azd-template';
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';

// Use individual functions directly
const templates = await listTemplates();
console.log(templates);

// Or create and use the MCP server
const server = createServer();
// Connect to your preferred transport...

// Or register tools on your existing MCP server
import { registerTools } from 'mcp-azd-template';
const myServer = new McpServer({ /* your config */ });
registerTools(myServer);

Example Prompts

When using this MCP server with AI assistants like GitHub Copilot, you can use the following example prompts:

Template Search

Search for Java Spring Boot templates in the Azure AI gallery

GitHub Actions Integration

You can integrate MCP AZD Template with GitHub Actions to automatically validate your Azure Developer CLI (azd) templates on pull requests or commits. This helps ensure your templates always comply with best practices before they're merged.

Setting up the GitHub Action

  1. Create a .github/workflows directory in your repository if it doesn't already exist
  2. Add a new file named validate-template.yml with the following content:
name: Validate Azure Developer CLI Template

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  workflow_dispatch:

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '18'
          cache: 'npm'

      - name: Install Azure Developer CLI
        run: |
          curl -fsSL https://aka.ms/install-azd.sh | bash

      - name: Install mcp-azd-template
        run: npm install -g mcp-azd-template

      - name: Validate AZD Template
        run: mcp-azd-template validate-action "${{ github.workspace }}"

Advanced Configuration

Creating Detailed Issues Automatically

The workflow includes automatic creation of GitHub issues with detailed validation results when validation fails. The created issue will contain:

  • Critical issues found in the template
  • Warnings and recommendations for improvement
  • The full validation output in a collapsible section
  • Links to the specific commit and workflow run

This feature makes it easy for teams to track and address template issues without needing to dig through workflow logs:

# This step captures the validation output
- name: Run Validation and Capture Output
  id: validate
  run: |
    # Run validation and capture output to a file
    mcp-azd-template validate-action "${{ github.workspace }}" > validation_output.txt 2>&1
    
    # Check if the validation failed and create a summary file for the issue
    if [ $? -ne 0 ]; then
      echo "::set-output name=status::failed"
      cat validation_output.txt
    else
      echo "::set-output name=status::success"
    fi
  continue-on-error: true

# This step creates the detailed issue with validation results
- name: Create Issue with Validation Results
  if: ${{ steps.validate.outputs.status == 'failed' && github.event_name == 'push' }}
  uses: actions/github-script@v6
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    script: |
      const fs = require('fs');
      
      // Read validation output file
      let validationOutput = fs.readFileSync('validation_output.txt', 'utf8');
      
      // Extract critical issues and warnings sections
      const criticalIssuesMatch = validationOutput.match(/### ❌ Critical Issues\\n([\\s\\S]*?)(?=\\n###|$)/);
      const warningsMatch = validationOutput.match(/### ⚠️ Warnings and Recommendations\\n([\\s\\S]*?)(?=\\n###|$)/);
      
      // Format the issue body with validation results
      await github.rest.issues.create({
        owner: context.repo.owner,
        repo: context.repo.repo,
        title: 'AZD Template Validation Failed',
        body: `# Template Validation Failed\\n\\nDetails of issues found in commit ${context.sha.substring(0, 7)}...`
      });

CLI Usage for CI/CD

You can also run template validation directly in any CI/CD environment:

# Install globally
npm install -g mcp-azd-template

# Run validation (exits with code 1 if validation fails)
mcp-azd-template validate-action /path/to/template

Sample Prompts

Find Next.js starter templates from both the AI gallery and azd CLI
Look for container-based microservices templates with Go support
Search for Azure Functions templates with Python and OpenAI integration
Find templates that use Azure Container Apps and Kubernetes
Search for templates with CI/CD pipeline examples

Template Analysis

Can you analyze my current Azure Developer CLI template and provide feedback?
Review this azd template in my current directory and tell me what needs improvement.

Template Validation

Validate this azd template against best practices.
Check if my azd template follows Microsoft's recommended structure and security practices.

Template Creation

Create a new Azure Function app template using TypeScript.
I need a starter template for a containerized web app using Python. Can you create one?
Help me scaffold an azd template for a .NET API with all the required files.

Template Listing

Show me available azd templates I can use as references.
What are the official Azure Developer CLI templates available?

Troubleshooting

My azd template is missing documentation. What specific sections should I add?
How do I fix the security warnings in my template's validation report?

Features

The package provides the following tools:

1. Search Templates

Search Azure Developer CLI (azd) templates and Azure AI gallery:

  • Search local azd CLI templates
  • Search Azure AI gallery templates
  • Filter by language, architecture, or keywords
  • Get detailed template information

2. List Templates

Lists all available Azure Developer CLI (azd) templates.

3. Analyze Template

Analyzes an Azure Developer CLI (azd) template directory and provides insights:

  • Structure validation
  • Configuration analysis
  • Best practice recommendations

4. Validate Template

Performs a comprehensive validation of an azd template with detailed checks for:

  • Documentation completeness
  • Infrastructure configuration
  • Security settings
  • Development environment setup
  • GitHub workflow configuration

5. Create Template

Creates a new Azure Developer CLI template with best practices built-in:

  • Supports multiple languages (TypeScript, Python, Java, .NET)
  • Various architectures (web, API, function app, container)
  • Includes necessary configuration files

Azure YAML Validation

Validates an azure.yaml file against the known schema:

  • Checks for required fields and correct structure
  • Validates service configurations
  • Provides best practice recommendations
  • Works with standalone files or within templates

Example usage:

// Validate a specific azure.yaml file
await validateAzureYaml('/path/to/azure.yaml');

// Validate azure.yaml in current directory
await validateAzureYaml();

Or use it through MCP server:

Can you validate my azure.yaml file?

Requirements

  • Node.js 18+
  • Azure Developer CLI (azd) installed

License

MIT

相关推荐

  • av
  • Ejecute sin esfuerzo LLM Backends, API, frontends y servicios con un solo comando.

  • 1Panel-dev
  • 🔥 1Panel proporciona una interfaz web intuitiva y un servidor MCP para administrar sitios web, archivos, contenedores, bases de datos y LLM en un servidor de Linux.

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llM 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Resumen de los mejores recursos del mundo.

  • rulego
  • ⛓️Rulego es un marco de motor de regla de orquestación de componentes de alta generación de alto rendimiento, de alto rendimiento y de alto rendimiento para GO.

  • Byaidu
  • Traducción de papel científico en PDF con formatos preservados - 基于 Ai 完整保留排版的 PDF 文档全文双语翻译 , 支持 支持 支持 支持 支持 支持 支持 支持 支持 支持 支持 支持 等服务 等服务 等服务 提供 提供 提供 提供 提供 提供 提供 提供 提供 提供 提供 提供 cli/mcp/docker/zotero

  • sigoden
  • Cree fácilmente herramientas y agentes de LLM utilizando funciones Plain Bash/JavaScript/Python.

  • hkr04
  • SDK liviano C ++ MCP (Protocolo de contexto del modelo)

  • RockChinQ
  • 😎简单易用、🧩丰富生态 - 大模型原生即时通信机器人平台 | 适配 Qq / 微信(企业微信、个人微信) / 飞书 / 钉钉 / Discord / Telegram / Slack 等平台 | 支持 Chatgpt 、 Deepseek 、 DiFy 、 Claude 、 Gemini 、 Xai 、 PPIO 、 Ollama 、 LM Studio 、阿里云百炼、火山方舟、 Siliconflow 、 Qwen 、 Moonshot 、 Chatglm 、 SillyTraven 、 MCP 等 LLM 的机器人 / Agente | Plataforma de bots de mensajería instantánea basada en LLM, admite Discord, Telegram, WeChat, Lark, Dingtalk, QQ, Slack

  • dmayboroda
  • Trapo conversacional local con contenedores configurables

  • modelscope
  • Iniciar aplicaciones de múltiples agentes empoderadas con Building LLM de manera más fácil.

    Reviews

    2.7 (9)
    Avatar
    user_OrqAPCHD
    2025-04-26

    I recently tried out the mcp-azd-template by spboyer and it exceeded my expectations. The template is incredibly user-friendly and streamlined for efficiency. It offers clear, concise instructions, making deployment a breeze even for those new to MCP applications. Highly recommend for anyone looking to optimize their project setup!

    Avatar
    user_YRaq1GK9
    2025-04-26

    The mcp-azd-template by spboyer is a fantastic tool for anyone looking to streamline their application development process. With its user-friendly interface and comprehensive features, it significantly simplifies complex tasks. The seamless integration and efficient performance make it a must-have for developers. Highly recommend!

    Avatar
    user_HuD9BKxK
    2025-04-26

    I'm a huge fan of the mcp-azd-template by spboyer! This template is incredibly well-structured and makes setting up new projects a breeze. The clear organization and ease of use have significantly improved my workflow. Highly recommended for anyone looking to streamline their development process!

    Avatar
    user_8KBKWcxA
    2025-04-26

    The mcp-azd-template by spboyer is a fantastic tool that streamlined my development process. Its seamless integration and user-friendly setup make it a must-have for any developer. The template's detailed guidelines and comprehensive structure significantly reduce setup time, allowing me to focus on building and scaling my projects efficiently. Highly recommended!

    Avatar
    user_sesueMDF
    2025-04-26

    The mcp-azd-template by spboyer is a fantastic resource for anyone working with Azure Development. It's incredibly user-friendly and offers a seamless start into your projects. The well-documented template saves a lot of time and ensures best practices. Highly recommend it to all developers!

    Avatar
    user_ui410He2
    2025-04-26

    I have been using the mcp-azd-template by spboyer and it's an outstanding resource for Azure development. It simplifies the setup process and provides a solid foundation which saves a lot of time. The integration is seamless and the template is well-structured. Highly recommend this for anyone working with Azure!

    Avatar
    user_GozQwjJj
    2025-04-26

    The mcp-azd-template by spboyer is an exceptional tool for initializing Azure development projects. It's user-friendly, well-documented, and saves a lot of setup time. Highly recommended for anyone looking to streamline their cloud application development process.

    Avatar
    user_O76BiPvP
    2025-04-26

    As an avid user of MCP applications, I am thoroughly impressed with the mcp-azd-template by spboyer. This template has streamlined my workflow significantly, and the ease of customization makes it perfect for various projects. The detailed welcome information and straightforward start URL show the author's commitment to user experience. Highly recommended for anyone looking for a reliable and efficient template!

    Avatar
    user_3m5I1Wef
    2025-04-26

    The mcp-azd-template by spboyer is a truly remarkable tool for developers. Its comprehensive and user-friendly design makes it a breeze to deploy and manage your Azure environments efficiently. I highly recommend it for anyone looking to streamline their cloud deployment process. The support and documentation provided are top-notch, further enhancing the overall experience. Five stars!