Azure Container Apps - AI & MCP Playground

by manekinekko

32 stars
405 downloads
Not rated
GitHub

About

This project showcases how to use the MCP protocol with Azure OpenAI. It provides a simple example to interact with OpenAI's API seamlessly via an MCP server and client.

Details

Author
manekinekko
GitHub stars
32
Downloads
405
Categories
Cloud Service, AI

- Two MCP server implementations: HTTP Streaming and SSE (legacy)
- Tools to add, list, complete, and delete TODO items
- Persistent state via DocumentDB Local database
- Support for OpenAI, Azure OpenAI, and GitHub Models as LLM providers
- Debug mode via DEBUG=mcp:* environment variable
- Runs locally with Docker or directly on Node.js 22+

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 Container Apps - AI & MCP Playground
    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

Clone the repository, install dependencies with npm install, configure your LLM provider (OpenAI API key, Azure OpenAI endpoint, or GitHub token) in a .env file, then start the MCP servers (HTTP and SSE) using docker compose up or npm start in separate terminals. Finally, run the MCP host with npm start --prefix mcp-host and interact with the agent through a terminal or VS Code’s built-in MCP support.

Claude Desktop / Cursor

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

{
    "mcpServers": {
        "azure container apps - ai & mcp playground": {
            "azure-container-apps-ai-mcp": {
                "command": "docker",
                "args": [
                    "compose",
                    "up",
                    "-d",
                    "--build"
                ]
            }
        }
    }
}

McpServers

{
    "azure-container-apps-ai-mcp": {
        "command": "docker",
        "args": [
            "compose",
            "up",
            "-d",
            "--build"
        ]
    }
}

Azure Container Apps - AI & MCP Playground

This project showcases how to use the MCP protocol with OpenAI, Azure OpenAI and GitHub Models. It provides a simple demo terminal application that interacts with a TODO list Agent.
The agent has access to a set of tools provided by the MCP server.

MCP Components

The current implementation consists of three main components:

1. MCP Host: The main application that interacts with the MCP server and the LLM provider. The host instanciates an LLM provider and provides a terminal interface for the user to interact with the agent.
2. MCP Client: The client that communicates with the MCP server using the MCP protocol. The application providers two MCP clients for both HTTP and SSE (Server-Sent Events) protocols.
3. MCP Server: The server that implements the MCP protocol and communicates with the DocumentDB database. The application provides two MCP server implementations: one using HTTP and the other using SSE (Server-Sent Events).
4. LLM Provider: The language model provider (e.g., OpenAI, Azure OpenAI, GitHub Models) that generates responses based on the input from the MCP host.
5. DocumentDB Local: A database used to store the state of the agent and the tools.
6. Tools: A set of tools that the agent can use to perform actions, such as adding or listing items in a shopping list.

flowchart TD
    user(("fa:fa-users User"))
    host["VS Code, Copilot, LlamaIndex, Langchain..."]
    client[MCP SSE Client]
    clientHttp[MCP HTTP Client]
    server([MCP SSE Server])
    serverHttp([MCP HTTP Server])
    agent[Agent]
    AzureOpenAI([Azure OpenAI])
    GitHub([GitHub Models])
    OpenAI([OpenAI])
    
    tools["fa:fa-wrench Tools"]
    db[(DocumentDB Local)]

user --> hostGroup
subgraph hostGroup["MCP Host"]
host -.- client & clientHttp & agent
end

agent -.- AzureOpenAI & GitHub & OpenAI

client a@ ---> |"Server Sent Events"| server
clientHttp aa@ ---> |"Streamable HTTP"| serverHttp

subgraph container["ACA Container (*)"]
server -.- tools
serverHttp -.- tools
tools -.- add_todo
tools -.- list_todos
tools -.- complete_todo
tools -.- delete_todo
end

add_todo b@ --> db
list_todos c@--> db
complete_todo d@ --> db
delete_todo e@ --> db

%% styles

classDef animate stroke-dasharray: 9,5,stroke-dashoffset: 900,animation: dash 25s linear infinite;
classDef highlight fill:#9B77E8,color:#fff,stroke:#5EB4D8,stroke-width:2px

class a animate
class aa animate
class b animate
class c animate
class d animate
class e animate

class container highlight

MCP Server supported features and capabilities

This demo application provides two MCP server implementations: one using HTTP and the other using SSE (Server-Sent Events). The MCP host can connect to both servers, allowing you to choose the one that best fits your needs.

| Feature | Completed |
| ------------------- | --------- |
| SSE (legacy) | ✅ |
| HTTP Streaming | ✅ |
| AuthN (token based) | wip |
| Tools | ✅ |
| Resources | #3 |
| Prompts | #4 |
| Sampling | #5 |

Quick Start (using Docker)

To get started with this project using Docker, follow the steps below:

1. Clone the repository:

git clone https://github.com/Azure-Samples/azure-container-apps-ai-mcp.git
cd azure-container-apps-ai-mcp

2. Start the Docker containers:

docker-compose up

3. Access the MCP servers using VS Code built-in MPC support, see ./.vscode/mcp.json. All data will be persisted in the DocumentDB Local database. You can use the VS Code extension for DocumentDB to explore the database.

Local development

To get started with this project, follow the steps below:

Prerequisites

- Node.js and npm (version 22 or higher)
- Docker (recommended for running the MCP servers, and DocumentDB Local in Docker)
- An OpenAI compatible endpoint:
- An OpenAI API key
- Or, a GitHub token, if you want to use the GitHub models: https://gh.io/models
- Or, if you are using Azure OpenAI, you need to have an Azure OpenAI resource and the corresponding endpoint.

Installation

1. Clone the repository.
2. Install the dependencies:

npm install --prefix mcp-host
npm install --prefix mcp-server-http
npm install --prefix mcp-server-sse

Configuring LLM providers to use

This sample supports the follwowing LLM providers:

| Provider | Supported API |
| ------------- | ------------------ |
| Azure OpenAI | Responses API |
| OpenAI | Responses API |
| GitHub Models | ChatCompletion API |

Azure OpenAI

> [!NOTE]
> Accessing Azure OpenAI using Managed Identity is not supported when running in a Docker container (locally). You can either run the code locally without Docker or use a different authentication method, such as AZURE_OPENAI_API_KEY key authentication.

In order to use Keyless authentication, using Azure Managed Identity, you need to provide the AZURE_OPENAI_ENDPOINT environment variable in the .env file:

```env
AZURE_OPENAI_ENDPOINT="https://<ai-foundry-openai-project>.openai.azure.com"
MODEL="gpt-4.1"

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.