Azure Functions ⚡️❤️ MCP Servers

by 0GiS0

7 stars
369 downloads
Not rated
GitHub Website

About

Azure Functions ⚡️❤️ MCP Servers is a sample repository that demonstrates how to create Model Context Protocol (MCP) servers using Azure Functions and the preview NuGet package Microsoft.Azure.Functions.Worker.Extensions.Mcp. It is designed for developers who want to integrate…

Details

Author
0GiS0
GitHub stars
7
Downloads
369
Categories
Cloud Service

- Sample MCP server built with Azure Functions and .NET.
- Uses the preview NuGet extension Microsoft.Azure.Functions.Worker.Extensions.Mcp.
- Supports local development and testing with func start.
- Integrates directly with GitHub Copilot Chat via SSE transport.
- Provides configuration templates for local and remote servers.
- Includes Terraform infrastructure for deploying to Azure.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Azure Functions ⚡️❤️ MCP Servers
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install the NuGet package (dotnet add package Microsoft.Azure.Functions.Worker.Extensions.Mcp --version 1.0.0-preview.2). Run the project locally with func start. Test it using MCP Inspector (npx @modelcontextprotocol/inspector http://localhost:7071/runtime/webhooks/mcp/sse). Configure GitHub Copilot Chat by adding an MCP server entry in .vscode/mcp.json or .vscode/settings.json, using either a local endpoint or a remote Azure Functions URL with the function key. Optionally deploy the function to Azure using the Terraform scripts in the infra directory after creating a terraform.tfvars file with your subscription ID and YouTube API key.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "azure functions \u26a1\ufe0f\u2764\ufe0f mcp servers": {
            "mcp-server-azure-function": {
                "command": "npx",
                "args": [
                    "@modelcontextprotocol/inspector",
                    "http://localhost:7071/runtime/webhooks/mcp/sse"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-server-azure-function": {
        "command": "npx",
        "args": [
            "@modelcontextprotocol/inspector",
            "http://localhost:7071/runtime/webhooks/mcp/sse"
        ]
    }
}

Azure Functions ⚡️❤️ MCP Servers

> Idiomas / Languages: 🇪🇸 Español | 🇺🇸 English

¡Hola developer 👋🏻! Este repo forma parte de un vídeo de mi canal de YouTube que muestra cómo podemos crear MCP (Model Context Protocol) servers apoyádonos en Azure Functions y usarlos con el modo agente de GitHub Copilot Chat.

Ver el video en YouTube

Paquete de NuGet para poder crear servidores MCP 📦

Para crear servidores MCP apoyandonos en Azure Functions podemos utilizar esta librería:

dotnet add package Microsoft.Azure.Functions.Worker.Extensions.Mcp --version 1.0.0-preview.2

Aquí tienes toda la información sobre este paquete de Nuget: https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Mcp

Para probar este código de ejemplo, necesitas ejecutar el proyecto en local:

func start

Y puedes usar MCP inspector:

npx @modelcontextprotocol/inspector http://localhost:7071/runtime/webhooks/mcp/sse

También puedes usar GitHub Copilot Chat para interactuar con este MCP server. Para ello solo tienes que crear el archivo .vscode/mcp.json o puedes incluir esta sección dentro del archivo .vscode/settings.json:

{
    "inputs": [
        {
            "type": "promptString",
            "id": "mcp-azure-function-key",
            "description": "Azure Function Key to access the MCP server on Azure",
            "password": true
        },
        {
            "type": "promptString",
            "id": "mcp-azure-function-name",
            "description": "Azure Function name to access the MCP server on Azure"
        }
    ],
    "servers": {
        "local-mcp-azure-function": {
            "type": "sse",
            "url": "http://localhost:7071/runtime/webhooks/mcp/sse",
        },
        // "remote-mcp-azure-function": {
        //     "type": "sse",
        //     "url": "https://${input:mcp-azure-function-name}.azurewebsites.net/runtime/webhooks/mcp/sse",
        //     "headers": {
        //         "x-functions-key": "${input:mcp-azure-function-key}"
        //     }
        // }
    }
}

También puedes añadir el mcp a través de la línea de comandos:

code --add-mcp '{"name": "local-mcp", "type":  "sse", "url": "http://localhost:7071/runtime/webhooks/mcp/sse"}'

Configuración de GitHub Copilot Chat para usar el MCP server 🛠️

Este configuración se compone de dos partes principales:

- inputs: que nos van a permitir no tener que harcodear cierto contenido sensible
- servers: que van a ser todos aquellos servidores, locales y remotos, que vamos a poder habilitar para GitHub Copilot Chat.

En este ejemplo tengo la configuración para dos servidores, la Azure Function que estoy ejecutando en entorno de desarrollo y la Azure Function que ya tengo desplegada en Microsoft Azure. Como puedes ver en esta segunda configuración, utilizo los inputs definidos en el primer apartado para utilizar el nombre de la Azure Function creada y la key asociada a la misma para poder acceder.

Crear una Azure Function en Azure ⚡️

Para crear una Azure Function en Azure, puedes usar el código en Terraform alojado en el directorio infra, pero antes necesitas crear un archivo terraform.tfvars con la siguiente información:

```hcl

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.