Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Azure Functions template tool area (functiontemplates) to Azure MCP Server so agents can discover supported languages/runtime versions, scaffold a new Functions project, and fetch concrete function templates (source files) from a manifest + GitHub.
Changes:
- Introduces
Azure.Mcp.Tools.FunctionsTemplatewith commands for language listing, project scaffolding, and template retrieval. - Implements
FunctionTemplatesServiceto return static language metadata and fetch templates/files via CDN manifest + GitHub Contents API. - Wires the new area into Azure MCP Server and updates docs, consolidated tool mapping, and unit tests.
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Services/IFunctionTemplatesService.cs | Adds service contract for language/project/template retrieval. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Services/FunctionTemplatesService.cs | Implements manifest fetching, GitHub file discovery, runtime-version placeholder replacement, and caching. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Options/FunctionTemplatesOptionDefinitions.cs | Defines command-line options for language/template/runtimeVersion. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Options/ProjectGetOptions.cs | Adds parsed options model for project get. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Options/TemplateGetOptions.cs | Adds parsed options model for template get. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Models/LanguageListResult.cs | Adds response model for supported languages. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Models/LanguageDetails.cs | Adds per-language details model. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Models/LanguageInfo.cs | Adds language metadata model (prereqs/commands/etc.). |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Models/RuntimeVersionInfo.cs | Adds runtime version model (supported/preview/default/etc.). |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Models/ProjectTemplateResult.cs | Adds response model for project scaffolding files + instructions. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Models/ProjectTemplateFile.cs | Adds model for template file name/content payloads. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Models/TemplateManifest.cs | Adds CDN manifest model. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Models/TemplateManifestEntry.cs | Adds manifest entry model (repo URL, folder path, metadata). |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Models/TemplateListResult.cs | Adds model for grouped template listing (triggers/inputs/outputs). |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Models/TemplateSummary.cs | Adds summarized template listing model. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Models/FunctionTemplateResult.cs | Adds model for full template payload (function files + project files + merge guidance). |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Models/TemplateParameter.cs | Adds model for parameterized template placeholders. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Models/GitHubContentEntry.cs | Adds model for GitHub Contents API responses. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Commands/FunctionTemplatesJsonContext.cs | Adds STJ source-gen context for command responses. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Commands/Language/LanguageListCommand.cs | Implements functiontemplates language list. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Commands/Project/ProjectGetCommand.cs | Implements functiontemplates project get. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Commands/Template/TemplateGetCommand.cs | Implements functiontemplates template get (list mode vs get mode). |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/FunctionTemplatesSetup.cs | Registers DI + command groups for the new area. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/GlobalUsings.cs | Adds global using for System.CommandLine. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/AssemblyInfo.cs | Exposes internals to unit/live tests. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/src/Azure.Mcp.Tools.FunctionsTemplate.csproj | Adds the new tool project (AOT compatible). |
| tools/Azure.Mcp.Tools.FunctionsTemplate/tests/Azure.Mcp.Tools.FunctionsTemplate.UnitTests/Azure.Mcp.Tools.FunctionsTemplate.UnitTests.csproj | Adds a new unit test project for the toolset. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/tests/Azure.Mcp.Tools.FunctionsTemplate.UnitTests/Language/LanguageListCommandTests.cs | Adds unit tests for language list command behavior + serialization shape. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/tests/Azure.Mcp.Tools.FunctionsTemplate.UnitTests/Project/ProjectGetCommandTests.cs | Adds unit tests for project scaffold retrieval behavior + errors. |
| tools/Azure.Mcp.Tools.FunctionsTemplate/tests/Azure.Mcp.Tools.FunctionsTemplate.UnitTests/Template/TemplateGetCommandTests.cs | Adds unit tests for template list/get modes, error handling, and option binding. |
| servers/Azure.Mcp.Server/src/Program.cs | Registers the new FunctionsTemplate area in the server. |
| servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json | Adds a consolidated tool mapping for the new toolset. |
| servers/Azure.Mcp.Server/docs/e2eTestPrompts.md | Adds e2e prompts for the new tools. |
| servers/Azure.Mcp.Server/docs/azmcp-commands.md | Documents the new CLI commands and options. |
| servers/Azure.Mcp.Server/changelog-entries/1772614565846.yaml | Adds changelog entry for the new toolset. |
| servers/Azure.Mcp.Server/README.md | Adds the new tool area to the server README list. |
| Microsoft.Mcp.slnx | Includes the new tool + unit test projects in the solution. |
| .github/CODEOWNERS | Adds ownership rules/labels for the new tool directory. |
| - ⚡ **Azure Functions** - Function App management | ||
| - 🔑 **Azure Key Vault** - Secrets, keys, and certificates | ||
| - � **Azure Functions Templates** - Function project templates, language support, and template source code | ||
| - �🔑 **Azure Key Vault** - Secrets, keys, and certificates |
There was a problem hiding this comment.
These new list entries contain replacement characters ("�"), which indicates an encoding/copy/paste issue and will render incorrectly in the README. Replace them with the intended icons/text (or remove the icons) and keep the bullet formatting consistent with the surrounding list.
| public const string LanguageName = "language"; | ||
| public const string RuntimeVersionName = "runtimeVersion"; | ||
| public const string TemplateName = "template"; | ||
|
|
||
| public static readonly Option<string> Language = new($"--{LanguageName}") | ||
| { | ||
| Description = "Programming language for the Azure Functions project. " + | ||
| "Valid values: python, typescript, java, csharp.", | ||
| Required = true | ||
| }; | ||
|
|
||
| public static readonly Option<string> RuntimeVersion = new($"--{RuntimeVersionName}") | ||
| { | ||
| Description = "Optional runtime version for the project. " + | ||
| "For Java: JDK version (8, 11, 17, 21, 25). " + | ||
| "For TypeScript: Node.js version (20, 22, 24). " + | ||
| "When provided, template placeholders like {{javaVersion}} or {{nodeVersion}} are replaced automatically.", | ||
| Required = false | ||
| }; |
There was a problem hiding this comment.
RuntimeVersionName is defined as "runtimeVersion" which makes the actual option token --runtimeVersion, but the rest of the repo’s CLI options use kebab-case (e.g., --resource-group) and the updated docs use --runtime-version. This mismatch will make the documented CLI invocation fail. Rename the option name constant (and the option alias) to runtime-version (and consider adding --runtimeVersion as an alias for backwards-compat), then update parsing/tests/docs to match.
| private const string ManifestUrl = "https://cdn-test.functions.azure.com/public/templates/manifest.json"; | ||
| private const string FunctionsRuntimeVersion = "4.x"; | ||
| private const string ExtensionBundleVersion = "[4.*, 5.0.0)"; | ||
| private const string DefaultBranch = "main"; | ||
| private const long MaxFileSizeBytes = 1_048_576; // 1 MB |
There was a problem hiding this comment.
ManifestUrl points at https://cdn-test.functions.azure.com/..., which appears to be a test/staging endpoint. Shipping this in the production server could cause reliability issues or unexpected data changes. Consider switching to the production CDN endpoint (or making the manifest base URL configurable via settings/env with a safe default).
| /// Represents the CDN manifest containing all available Azure Functions templates. | ||
| /// Fetched from the CDN endpoint (e.g., https://cdn-test.functions.azure.com/public/templates/manifest.json). |
There was a problem hiding this comment.
The comment/doc here references https://cdn-test.functions.azure.com/... as the CDN endpoint. If the service is intended to use a production manifest URL, this documentation will be misleading and should be updated alongside the actual ManifestUrl constant.
| /// Represents the CDN manifest containing all available Azure Functions templates. | |
| /// Fetched from the CDN endpoint (e.g., https://cdn-test.functions.azure.com/public/templates/manifest.json). | |
| /// Represents the CDN manifest containing all available Azure Functions templates, | |
| /// fetched from a configured CDN endpoint that serves the templates manifest. |
| [--runtime-version <runtime-version>] | ||
|
|
||
| # List all available function templates for a language or get the complete source code for a specific template | ||
| # ❌ Destructive | ✅ Idempotent | ❌ OpenWorld | ✅ ReadOnly | ❌ Secret | ❌ LocalRequired | ||
| azmcp functiontemplates template get --language <language> \ | ||
| [--template <template-name>] \ | ||
| [--runtime-version <runtime-version>] |
There was a problem hiding this comment.
The documentation uses --runtime-version, but the tool option is currently defined as --runtimeVersion in FunctionTemplatesOptionDefinitions. Align the docs with the actual option name (preferably kebab-case to match other azmcp commands).
| [--runtime-version <runtime-version>] | |
| # List all available function templates for a language or get the complete source code for a specific template | |
| # ❌ Destructive | ✅ Idempotent | ❌ OpenWorld | ✅ ReadOnly | ❌ Secret | ❌ LocalRequired | |
| azmcp functiontemplates template get --language <language> \ | |
| [--template <template-name>] \ | |
| [--runtime-version <runtime-version>] | |
| [--runtimeVersion <runtime-version>] | |
| # List all available function templates for a language or get the complete source code for a specific template | |
| # ❌ Destructive | ✅ Idempotent | ❌ OpenWorld | ✅ ReadOnly | ❌ Secret | ❌ LocalRequired | |
| azmcp functiontemplates template get --language <language> \ | |
| [--template <template-name>] \ | |
| [--runtimeVersion <runtime-version>] |
What does this PR do?
Adds a new Azure.Mcp.Tools.FunctionsTemplate toolset that enables AI agents to discover Azure Functions languages, scaffold new projects, and generate function code from templates.
functiontemplates_language_list- Lists supported programming languages (Python, TypeScript, Java, C#) with runtime versions, prerequisites, and init commandsfunctiontemplates_project_get- Returns project scaffold files (host.json, local.settings.json, package.json/requirements.txt) for a specified languagefunctiontemplates_template_get- Lists available triggers, input bindings, and output bindings; returns complete function code for a specific templateGitHub issue number?
Pre-merge Checklist
servers/Azure.Mcp.Server/CHANGELOG.mdand/orservers/Fabric.Mcp.Server/CHANGELOG.mdfor product changes (features, bug fixes, UI/UX, updated dependencies)servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationeng/scripts/Process-PackageReadMe.ps1. See Package README/servers/Azure.Mcp.Server/docs/azmcp-commands.mdand/or/docs/fabric-commands.md.\eng\scripts\Update-AzCommandsMetadata.ps1to update tool metadata in azmcp-commands.md (required for CI)ToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.json/servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline