madebygps/remote-mcp-webapp-python
If you are the rightful owner of remote-mcp-webapp-python and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This document provides a comprehensive overview of the MCP Server implemented using FastAPI and deployed on Azure App Service, offering various computational and weather-related tools.
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>