- MCP Server - FastAPI on Azure App Service
MCP Server - FastAPI on Azure App Service
Content
MCP Server - FastAPI on Azure App Service
This is a Python implementation of the MCP (Model Context Protocol) server using FastAPI and deployed to Azure App Service, providing multiplication, temperature conversion, and weather tools.
Features
- Multiplication Tool: Multiply two numbers
- Temperature Converter Tools: Convert between Celsius and Fahrenheit
- Weather Tools: Get US weather alerts by state and forecasts by coordinates
Local Development
Prerequisites
- Python 3.11+
- uv for faster dependency management and virtual environment creation
- Node.js & npm (for running MCP Inspector)
Setup and Running
- Create a virtual environment:
cd src
uv venv
# Activate the virtual environment
source .venv/bin/activate # On macOS/Linux
# OR
.venv\Scripts\activate # On Windows
- Install dependencies:
uv pip install -r requirements.txt
- Run the development server with auto-reload:
uvicorn main:app --reload
The server will start on http://localhost:8000 by default.
API Endpoints
/- Root endpoint showing server status/health- Health check endpoint/mcp-server/mcp- MCP server endpoint for tool interactions
Testing with MCP Inspector
- Start the server (if not already running):
uvicorn main:app --reload
- Run MCP Inspector:
npx @modelcontextprotocol/inspector
-
Connect to the MCP Server:
- Transport Type: streamable-http
- URL:
http://localhost:8000/mcp-server/mcp - Authentication: None
-
Available Tools:
multiply- Multiply two numberscelsius_to_fahrenheit- Convert Celsius to Fahrenheitfahrenheit_to_celsius- Convert Fahrenheit to Celsiusget_alerts- Get US weather alerts by stateget_forecast- Get weather forecast by coordinates
Azure Deployment
Azure Prerequisites
- Azure CLI installed (
az) - Azure Developer CLI installed (
azd) - Azure subscription
Deployment Process
- Login to Azure:
az login
azd auth login
- Deploy using Azure Developer CLI:
# From the project root directory
azd up
This will:
- Create a new resource group
- Deploy an App Service Plan (Linux)
- Deploy the Python web app
- Configure all necessary settings
Post-Deployment
After deployment:
- Check the application health:
https://<your-app>.azurewebsites.net/health - View available tools:
https://<your-app>.azurewebsites.net/ - Monitor logs in Azure Portal or using Azure CLI
Connecting to the MCP Server
The MCP endpoint is available at:
https://<your-app>.azurewebsites.net/mcp-server/mcp
To connect using MCP Inspector or other MCP clients:
- Use the full URL:
https://<your-app>.azurewebsites.net/mcp-server/mcp - Select "streamable-http" as the transport type
- No authentication is currently required (the endpoint is publicly accessible)
Security Considerations
- No authentication is currently implemented (public endpoints)
- CORS is wide open for development
- Consider implementing API key or OAuth2 authentication for production
- Validate all user inputs in tools to prevent injection attacks
Troubleshooting
- Check logs:
az webapp log tail --name <app-name> --resource-group <rg-name> - SSH into container:
az webapp ssh --name <app-name> --resource-group <rg-name> - Restart app:
az webapp restart --name <app-name> --resource-group <rg-name>
Resources
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
DeepChatYour AI Partner on Desktop
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Playwright McpPlaywright MCP server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Tavily Mcp
Serper MCP ServerA Serper MCP Server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题;
Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
ChatWiseThe second fastest AI chatbot™
WindsurfThe new purpose-built IDE to harness magic
CursorThe AI Code Editor
Amap Maps高德地图官方 MCP Server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.