mcp_azure/
├── function_app.py # Azure Function entry point + HTTP trigger
├── mcp_server.py # FastMCP server + product tool
├── requirements.txt # Python dependencies
├── host.json # Azure Functions host config
├── local.settings.json.template # Copy → local.settings.json for local dev
└── README.md
- MCP client (e.g. Claude Desktop) sends a JSON-RPC
POSTto your Azure Function URL. function_app.pycatches the request via themcp/{*path}HTTP trigger.- The request is forwarded into FastMCP's Streamable HTTP ASGI app.
- FastMCP routes it to the
producttool inmcp_server.py. - The tool calls the Book4Time API with your credentials from App Settings.
- The JSON response travels back up the chain to the MCP client.
# 1. Install dependencies
pip install -r requirements.txt
# 2. Configure secrets
cp local.settings.json.template local.settings.json
# Edit local.settings.json — fill in BOOK4TIME_API_TOKEN and BOOK4TIME_ACCOUNT_TOKEN
# 3. Start the Functions runtime
func startThe MCP endpoint will be at:
http://localhost:7071/api/mcp
# 1. Create resource group and Function App (one-time)
az group create --name rg-book4time-mcp --location uksouth
az functionapp create \
--resource-group rg-book4time-mcp \
--consumption-plan-location uksouth \
--runtime python \
--runtime-version 3.11 \
--functions-version 4 \
--name <YOUR_APP_NAME> \
--storage-account <YOUR_STORAGE_ACCOUNT>
# 2. Set the API tokens as App Settings (not in code)
az functionapp config appsettings set \
--name <YOUR_APP_NAME> \
--resource-group rg-book4time-mcp \
--settings \
BOOK4TIME_API_TOKEN="your_real_api_token" \
BOOK4TIME_ACCOUNT_TOKEN="your_real_account_token"
# 3. Deploy the code
func azure functionapp publish <YOUR_APP_NAME>The live MCP endpoint will be:
https://<YOUR_APP_NAME>.azurewebsites.net/api/mcp
In claude_desktop_config.json:
{
"mcpServers": {
"book4time": {
"url": "https://<YOUR_APP_NAME>.azurewebsites.net/api/mcp?code=<FUNCTION_KEY>"
}
}
}Get your function key from the Azure Portal → Function App → App keys.
Add new @mcp.tool() functions to mcp_server.py — they are automatically
discovered and registered. No changes needed in function_app.py.
@mcp.tool()
async def bookings(location_id: str = "11506000") -> dict:
"""Fetch bookings from Book4Time."""
...