Blog Post

Apps on Azure Blog
4 MIN READ

Hosting Remote MCP Server on Azure Container Apps (ACA) using Streamable HTTP transport mechanism

DeepGanguly's avatar
DeepGanguly
Icon for Microsoft rankMicrosoft
Oct 15, 2025

About

Continuing from the earlier article of Hosting Remote MCP Server on Azure Container Apps (ACA) using SSE transport mechanism

This blog showcases the Hosting Remote MCP Servers on Azure Container Apps (ACA) as HTTP type transport. 

Overview

The Model Context Protocol (MCP) has revolutionized how AI assistants interact with external tools and data sources. While many examples focus on local implementations using stdio transport, this post demonstrates how to build and deploy a production-ready MCP server using HTTP transport in Azure Container Apps.

In this article, we create a live forex converter that fetches real-time exchange rates from external APIs, showcasing how MCP servers can integrate with third-party services to provide dynamic, up-to-date information to AI assistants.

What is MCP HTTP Transport?

MCP supports multiple transport mechanisms, with HTTP being ideal for cloud deployments:

  • Stdio Transport: {"type": "stdio"} - Direct process communication
  • HTTP Transport: {"type": "http"} - RESTful API communication

HTTP transport enables:

  • Cloud deployment and scaling
  • Cross-platform compatibility
  • Multiple client connections
  • Load balancing and high availability
  • Integration with external APIs
  • Real-time data fetching from third-party services

Building and testing the MCP Server from the GitHub Repo

Follow the steps to clone the code on your local machine and test the server locally

# Clone the repository
git clone https://github.com/deepganguly/azure-container-apps-mcp-sample.git

# Navigate to the project directory
cd azure-container-apps-mcp-sample

# Install dependencies
npm install

# Test Locally, Run the MCP server
npm start

# Test the server (in another terminal)
curl -X POST http://localhost:3001/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

The `server.js` (checkout the file from the above repository for more details) fetches live forex exchange rates from a Third-Party API and servers as live price converter for any requests. It performs the following functions

1. Exchange Rate Management

  • Caches live exchange rates from exchangerate-api.com for 10 minutes
  • Fetches fresh rates when cache expires or is empty
  • Falls back to hardcoded rates if the external API fails (USD, EUR, GBP, JPY, INR, CAD, AUD, CHF, CNY)

2. Exchange Rate Management

  • Listens on /mcp endpoint for POST requests with JSON-RPC 2.0 format
  • Handles tools/list method - Returns available tools (convert_currency)
  • Handles tools/call method - Executes currency conversion requests
  • Returns proper MCP responses with jsonrpc, id, and result/error fields

     

    // Fetch live exchange rates from exchangerate-api.com (free, no API key needed)
    async function getLiveRates() {
        try {
            // Check cache first
            if (ratesCache && cacheTimestamp && (Date.now() - cacheTimestamp) < CACHE_DURATION) {
                return ratesCache;
            }
            console.log('Fetching live exchange rates...');
            const response = await fetch('https://api.exchangerate-api.com/v4/latest/USD');
            const data = await response.json()

 

3. Currency Conversion Logic

  • USD as base conversion - Direct rate lookup for USD to other currencies
  • Other to USD conversion - Uses inverse rate (1/rate)
  • Cross-currency conversion - Converts through USD (from→USD→to)
  • Calculates exchange rate and final converted amount

4. Response Formatting

  • Success response - Returns formatted text with amount, converted value, live rate, and timestamp
  • Error handling - Returns proper JSON-RPC error responses for failures

Deploy the App to Azure Container Apps

The code can be deployed with the following commands. Also, check out the main.bicep file provided in the repository for quick one step deployment 

# Clone the repository
git clone https://github.com/deepganguly/azure-container-apps-mcp-sample.git

#Login to Azure
az login

# Create resource group
az group create --name mcp-live-rates-rg --location eastus

# Create Container App environment
az containerapp env create --name mcp-forex-env --resource-group mcp-live-rates-rg --location eastus

# Deploy container app
az containerapp up --name mcp-live-forex-server --resource-group mcp-live-rates-rg --environment mcp-forex-env --source . --target-port 3001 --ingress external

Connect the MCP Server with VS Code Chat

Step 1: Get Your Deployed Server URL

After deployment, your server is available at:
https://mcp-live-forex-server.****.eastus.azurecontainerapps.io/

Key Endpoints:
- MCP Endpoint: https://mcp-live-forex-server.****.eastus.azurecontainerapps.io/mcp
- Health Check: https://mcp-live-forex-server.****.eastus.azurecontainerapps.io//health

Step 2: Configure VS Code Settings

1. Open VS Code
2. Navigate to .vscode/mcp.json file with the following configurations
{
	"servers": {
		"my-mcp-server-1a118d61": {
			"url": "https://mcp-live-forex-server.****.eastus.azurecontainerapps.io/mcp",
			"type": "http"
		}
	},
	"inputs": [
		{
			"id": "convert_currency",
			"type": "promptString",
			"description": "Convert {amount} {from} to {to} using live exchange rates"
		}
	]
}
3. Add the mcp.json as a Server
4. Reload the Window and query the VS code chat client

Following picture showcases the Add Server configuration from the mcp.json file and the follow up conversation for the exchange rates

 

Conclusion

In this article we see the approach that enables to run serverless functions in a fully managed, scalable container environment, leveraging the flexibility of containers and the power of Azure Container Apps. You can now monitor, scale, and update your app easily using Azure tools and CLI.

Updated Oct 14, 2025
Version 1.0
No CommentsBe the first to comment