MCP ExplorerExplorer

Azure Container Apps Mcp Sample

@anthonychuon a year ago
14 MIT
FreeCommunity
AI Systems
A sample Azure Container Apps MCP server using SSE and API key authentication.

Overview

What is Azure Container Apps Mcp Sample

azure-container-apps-mcp-sample is a sample server for Azure Container Apps that demonstrates the use of Server-Sent Events (SSE) and API key authentication.

Use cases

Use cases include building a weather monitoring application that streams updates, integrating real-time data into dashboards, and developing applications that require live notifications.

How to use

To use azure-container-apps-mcp-sample, ensure you have Python 3.11 or later and the ‘uv’ package installed. Run the server locally by setting your API key and executing the provided commands. For deployment, use the Azure CLI to deploy the app to Azure Container Apps.

Key features

Key features include SSE transport for real-time data streaming and API key authentication for secure access.

Where to use

This MCP server can be used in applications requiring real-time data updates, such as weather applications, stock tickers, or any service that benefits from live data feeds.

Content

Azure Container Apps remote MCP server example

This MCP server uses SSE transport and is authenticated with an API key.

Running locally

Prerequisites:

  • Python 3.11 or later
  • uv

Run the server locally:

uv venv
uv sync

# linux/macOS
export API_KEYS=<AN_API_KEY>
# windows
set API_KEYS=<AN_API_KEY>

uv run fastapi dev main.py

VS Code MCP configuration (mcp.json):

{
  "inputs": [
    {
      "type": "promptString",
      "id": "weather-api-key",
      "description": "Weather API Key",
      "password": true
    }
  ],
  "servers": {
    "weather-sse": {
      "type": "sse",
      "url": "http://localhost:8000/sse",
      "headers": {
        "x-api-key": "${input:weather-api-key}"
      }
    }
  }
}

Deploy to Azure Container Apps

az containerapp up -g <RESOURCE_GROUP_NAME> -n weather-mcp --environment mcp -l westus --env-vars API_KEYS=<AN_API_KEY> --source .

If the deployment is successful, the Azure CLI returns the URL of the app. You can use this URL to connect to the server from Visual Studio Code.

If the deployment fails, try again after updating the CLI and the Azure Container Apps extension:

az upgrade
az extension add -n containerapp --upgrade

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers