A Model Context Protocol (MCP) server that provides ready-to-use Azure Functions templates across 4 programming languages with 71 templates covering all major Azure service bindings and trigger types. Templates include complete project structures, configuration files, and follow modern programming patterns for rapid development and deployment.
- Features
- Prerequisites
- Installation
- Quick Start
- Use with VS Code
- What it provides
- Usage examples
- Template Structure
- Project scripts
- Directory structure
- Troubleshooting
- Contributing
- License
Multi-Language Support: C# (.NET Isolated), Java (Maven), Python (v2 Model), TypeScript (Node.js v4)
Complete Templates: Full project structure with dependencies, configuration, and best practices
Modern Patterns: Latest programming models and Azure Functions runtime features
Rich Categories: Web APIs, Storage, Database, Streaming, Messaging, AI/ML, Analytics
Tool Integration: Built-in support for VS Code Copilot, MCP Inspector, and AI assistants
Packaged Distribution: Templates embedded with server for easy deployment and offline usage
- Node.js 18+ (LTS recommended): Required for running the MCP server
- npm: Package manager (included with Node.js)
- MCP Client: Such as VS Code with Copilot, or MCP Inspector
- Git: For cloning the repository (if building from source)
Install the published package globally:
npm install -g manvir-templates-mcp-serverOr install locally in your project:
npm install manvir-templates-mcp-serverVerify installation:
npm list -g manvir-templates-mcp-servernpm list manvir-templates-mcp-serverwhich manvir-templates-mcp-servernpm run smokenpm run probe# Clone and build from source
git clone https://github.com/manvkaur/azure-functions-templates-mcp-server.git
cd azure-functions-templates-mcp-server
npm install
npm run buildIf installed globally:
manvir-templates-mcp-serverIf installed locally:
npx manvir-templates-mcp-serverFrom source build:
node dist/src/server.jsThis starts a stdio MCP server waiting for an MCP client connection. The server uses stdio transport and never logs to stdout (reserved for MCP protocol messages). Errors go to stderr.
npm run smokeRuns a simple test that calls the MCP server tools with sample requests.
The MCP Inspector is a debugging and testing tool for MCP servers. To test this server with MCP Inspector:
# If installed globally
npx @modelcontextprotocol/inspector manvir-templates-mcp-server
# If installed locally
npx @modelcontextprotocol/inspector npx manvir-templates-mcp-server# Start the inspector with your built server
npx @modelcontextprotocol/inspector node dist/src/server.js# Install MCP Inspector globally
npm install -g @modelcontextprotocol/inspector
# Run with npm package
mcp-inspector manvir-templates-mcp-server
# Or run with source build
mcp-inspector node dist/src/server.jsThe inspector will:
- Start your MCP server as a subprocess
- Open a web interface (usually at http://localhost:5173)
- Allow you to interactively test all available tools
You can use this MCP server with VS Code through GitHub Copilot or other MCP-compatible extensions. Here are several approaches:
-
Install the package globally:
npm install -g manvir-templates-mcp-server
-
Configure in VS Code mcp.json settings:
{ "servers": { "azure-functions-create-triggers-bindings": { "type": "stdio", "command": "manvir-templates-mcp-server" } } }
-
Install the package locally in your project:
npm install manvir-templates-mcp-server
-
Configure in VS Code mcp.json settings:
{ "servers": { "azure-functions-create-triggers-bindings": { "type": "stdio", "command": "npx", "args": ["manvir-templates-mcp-server"] } } }
-
Build the project from source (see Installation section)
-
Configure in VS Code mcp.json settings:
{ "servers": { "azure-functions-create-triggers-bindings": { "type": "stdio", "command": "node", "args": ["D:\\path\\to\\azure-functions-templates-mcp-server\\dist\\src\\server.js"] } } }Replace
D:\\path\\to\\azure-functions-templates-mcp-serverwith the actual path to your cloned repository.
By default, Copilot may not automatically use MCP server tools. To ensure Copilot uses this server when working with Azure Functions, add a prompt instruction file:
Create .github/copilot-instructions.md in your project:
When creating, modifying, or adding Azure Functions code, triggers, or bindings:
1. ALWAYS use the `azure-functions-create-triggers-bindings` MCP server tools
2. Start with `get_languages_list` to see supported languages
3. Call `get_project_template` to get project scaffolding files
4. Call `get_azure_functions_templates_list` to browse available triggers and bindings
5. Call `get_azure_functions_template` to get ready-to-use function code
6. Do NOT write Azure Function code from scratchCreate a prompt file in VS Code's user settings directory:
- Windows:
%APPDATA%\Code\User\prompts\azure-functions.md - macOS:
~/Library/Application Support/Code/User/prompts/azure-functions.md - Linux:
~/.config/Code/User/prompts/azure-functions.md
---
applyTo: '**/*.{cs,java,py,ts}'
---
When working with Azure Functions code, use the azure-functions-create-triggers-bindings MCP server.
Start with get_languages_list, then get_project_template, then get_azure_functions_templates_list.
Always fetch templates using get_azure_functions_template instead of writing function code manually.Four composable tools for Azure Functions template management:
get_languages_list: Get the list of supported languages with runtime versions and capabilitiesget_project_template: Get project initialization files (host.json, package.json, pom.xml, etc.) with configurable runtime parametersget_azure_functions_templates_list: Get all available function templates for a specific language with descriptions and categoriesget_azure_functions_template: Get the complete source code for a specific function template, plus required app settings and packages
Supported languages and templates:
- C# (.NET Isolated Worker): 26 templates including HTTP, Blob, Timer, Service Bus, Cosmos DB, Durable Functions, MySQL/SQL bindings, MCP tool and resource triggers
- Java (Maven-based): 15 templates covering core triggers, bindings, Durable Functions, and MCP tool trigger with annotation-based configuration
- Python (v2 Programming Model): 16 templates using modern decorator-based patterns including blob processing, database triggers, streaming, AI/ML integrations, and generic trigger support
- TypeScript (Node.js v4): 14 templates with full type safety covering storage, database, streaming, MCP integration, and real-time communication scenarios
Each template includes:
- Complete function code with proper bindings and error handling
- Configuration files (host.json, local.settings.json, etc.)
- Project files (requirements.txt, package.json, .csproj, pom.xml, etc.)
- Language-specific patterns (decorators for Python, annotations for Java, isolated worker for C#)
- Best practices for each runtime and programming model
Template Categories:
- Web APIs: HTTP triggers for REST endpoints and webhooks
- Storage: Blob triggers/bindings, Queue processing
- Database: Cosmos DB, SQL Server, MySQL triggers and bindings
- Streaming: Event Hubs for real-time data processing
- Messaging: Service Bus, Event Grid, RabbitMQ integration
- Scheduling: Timer triggers with CRON expressions
- Durable Functions: Orchestrators, activities, entities for workflows
- AI/ML: Model Context Protocol (MCP) tool and resources integration for AI assistants
- Real-time: SignalR for live updates and notifications
Perfect for bootstrapping new Azure Functions projects, learning cross-language patterns, and rapid prototyping.
Runtime Version Parameters: Added optional runtimeVersion parameter to get_project_template and get_azure_functions_template tools for Java and TypeScript. Automatically replaces version placeholders in templates.
Java 8 Support: Correctly converts Java 8 to Maven-compatible 1.8 format
Template Inventory Updated: Synchronized template lists with actual available templates
Language-Agnostic Descriptions: Removed language-specific implementation details from descriptions
Consistent Categories: Unified template categorization across all languages
Accurate Counts: Updated template counts (C#: 26, Java: 15, Python: 16, TypeScript: 14)
Clean Documentation: Improved descriptions for better tool compatibility (VS Code Copilot, MCP Inspector)
Modern Patterns: Reflects current Azure Functions programming models and best practices
This MCP server provides access to Azure Functions templates across multiple programming languages. Each language follows modern programming models and best practices:
HttpTrigger/
├── function_app.py # Main function code with @app decorators
├── host.json # Function host configuration
├── local.settings.json # Local development settings
└── requirements.txt # Python dependencies
HttpTrigger/
├── src/ # Source code directory
├── package.json # Node.js dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── host.json # Function host configuration
└── local.settings.json # Local development settings
HttpTrigger/
├── pom.xml # Maven configuration and dependencies
├── host.json # Function host configuration
├── local.settings.json # Local development settings
└── src/ # Java source code with annotations
└── main/
└── java/
HttpTrigger/
├── HttpTriggerCSharp.cs # Main function code (isolated worker)
└── .template.config/ # Template metadata for tooling
├── template.json # Template definition
└── vs-2017.3.host.json # Visual Studio configuration
npm run build: Compile TypeScript todist/npm start: Run compiled server (dist/src/server.js)npm run smoke: Test server with sample template requestnpm run dev: Run with ts-node (for quick iteration)npm run probe: Simple health check for the server
src/server.ts— MCP server implementationtemplates/— Azure Functions templates (packaged with server)dist/— Compiled JavaScript outputtools/smoke.mjs— Simple test client
The tools are designed to be used in sequence:
- Discover languages →
get_languages_list - Initialize project →
get_project_template(with runtime parameters) - Browse templates →
get_azure_functions_templates_list - Add functions →
get_azure_functions_template(with required settings)
Get supported languages:
Tool: get_languages_list
Returns all supported languages with runtime details, programming models, and template counts.
Get project files for Python:
Tool: get_project_template
Language: python
Get project files for TypeScript with specific Node.js version:
Tool: get_project_template
Language: typescript
runtimeVersion: "20"
Get project files for Java with specific Java version:
Tool: get_project_template
Language: java
runtimeVersion: "21"
Returns all project initialization files (host.json, requirements.txt, package.json, pom.xml, etc.) with the specified runtime parameters applied.
Get templates for a specific language:
Tool: get_azure_functions_templates_list
Language: python
Returns all Python templates with descriptions, categories, and use cases.
Get a complete function template:
Tool: get_azure_functions_template
Language: python
Template: HttpTrigger
Returns the function source code, plus any required app settings and additional packages.
Get a Java Cosmos DB trigger with specific JDK version:
Tool: get_azure_functions_template
Language: java
Template: CosmosDBTrigger
runtimeVersion: "17"
Get a C# Durable Functions orchestration:
Tool: get_azure_functions_template
Language: csharp
Template: DurableFunctionsOrchestration
Get a TypeScript Blob trigger with specific Node.js version:
Tool: get_azure_functions_template
Language: typescript
Template: BlobTrigger
runtimeVersion: "22"
- Problem: Command not found or server won't start
- Solution:
- Verify installation:
npm list -g manvir-templates-mcp-server - Reinstall if needed:
npm install -g manvir-templates-mcp-server - Check Node.js version:
node --version(requires 18+)
- Verify installation:
- Problem: MCP client doesn't show the Azure Functions tools
- Solution:
- Verify server configuration in your MCP client settings
- Check that paths in client config are absolute
- Ensure
npm run buildsucceeded if building from source - Test with MCP Inspector first:
npx @modelcontextprotocol/inspector manvir-templates-mcp-server
- Problem: Error when requesting templates
- Solution:
- Verify language parameter is one of:
csharp,java,python,typescript - Check template name matches exactly (case-sensitive)
- Use
get_azure_functions_templates_listto see valid template names
- Verify language parameter is one of:
- Problem: Slow response times
- Solution:
- Templates are packaged with the server for fast access
- Use
get_azure_functions_templateto get just the function code you need - Project files are fetched separately via
get_project_template
Run the smoke test to verify functionality:
npm run smokeUse MCP Inspector for interactive debugging:
npx @modelcontextprotocol/inspector manvir-templates-mcp-server- Issues: Report bugs at GitHub Issues
- Discussions: Ask questions in GitHub Discussions
- Documentation: Full documentation available in the repository
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
git clone https://github.com/manvkaur/azure-functions-templates-mcp-server.git
cd azure-functions-templates-mcp-server
npm install
npm run build
npm test- Stdout Reserved: Never add
console.logstatements; stdout is reserved for MCP protocol messages - Error Handling: All errors go to stderr, tool errors use
isError: trueflag - Template Packaging: Templates are embedded in the package for offline usage
- Protocol Compliance: Server implements MCP specification correctly
This project is licensed under the MIT License - see the LICENSE file for details.