Getting Started with Remote MCP Servers using Azure Functions (Python)
This is a quickstart template to easily build and deploy a custom remote MCP server to the cloud using Azure Functions with Python. You can clone/restore/run on your local machine with debugging, and azd up to have it in the cloud in a couple of minutes. The MCP server is secured by design using keys and HTTPS, and allows more options for OAuth using EasyAuth and/or API Management as well as network isolation using VNET.
Prerequisites
- Python 3.9+
- Azure Functions Core Tools >=
4.0.7030 - Azure Developer CLI
- To use Visual Studio Code to run and debug locally:
- Docker to run Azurite, the Azure Storage Emulator (optional)
Prepare your local environment
An Azure Storage Emulator is needed for this particular sample because Azure Functions requires a storage account for certain operations.
-
Start Azurite (if using Docker):
docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite
-
Create a Python virtual environment:
python -m venv .venv
-
Activate the virtual environment:
On Windows:
.\.venv\Scripts\Activate.ps1
On macOS/Linux:
source .venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
Run and Debug Locally
- Open the project in VS Code
- Make sure Azurite is running
- Press
F5to start debugging, or run:func start
Deploy to Azure
-
Login to Azure (if not already logged in):
azd auth login
-
Provision and deploy:
azd up
This will:
- Create the required Azure resources (Resource Group, Storage Account, Function App)
- Deploy your Python MCP server to Azure Functions
MCP Tools Available
This MCP server exposes the following tools:
| Tool Name | Description |
|---|---|
microsoftCertifiedNodeJsPackages |
Get a list of Microsoft certified Node.js packages |
microsoftCertifiedPythonPackages |
Get a list of Microsoft certified Python packages |
microsoftCertifiedJavaPackages |
Get a list of Microsoft certified Java packages |
validateMicrosoftPackageIntegrity |
Validate the integrity of a Microsoft certified package |
validateImageSKUUpdate |
Validate whether an image SKU update is recommended |
mcp-name: com.microsoft.esrp/esrp-oss-mcp-test
Project Structure
esrp-mcp-server-python/
├── function_app.py # Main Azure Functions app with MCP tools
├── host.json # Azure Functions host configuration
├── local.settings.json # Local settings (not committed to git)
├── azure.yaml # Azure Developer CLI configuration
├── requirements.txt # Python dependencies
├── server.json # MCP server manifest
├── data/ # Data files
│ ├── publishedPackages.json # List of certified packages
│ └── packageHashes.json # Package hash information
└── README.md # This file
Configuration
Environment Variables
| Variable | Description |
|---|---|
FUNCTIONS_WORKER_RUNTIME |
Set to python |
AzureWebJobsStorage |
Connection string for Azure Storage |
Connecting MCP Clients
After deployment, you can connect MCP clients to your remote MCP server using the function URL provided by Azure Functions. The URL format will be:
https://<your-function-app>.azurewebsites.net/runtime/webhooks/mcp/sse
Make sure to include the function key for authentication.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Metadata
Release files for esrp-oss-mcp-test 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| esrp_oss_mcp_test-0.0.2.tar.gz | 3.4 kB | Without provenance | Details for esrp_oss_mcp_test-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| esrp_oss_mcp_test-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for esrp_oss_mcp_test-0.0.2-py3-none-any.whl |
Total release size: 6.5 kB
Release files / esrp_oss_mcp_test-0.0.2.tar.gz
| Download URL | esrp_oss_mcp_test-0.0.2.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
57f3fa089c22faa2abefce98302e2c75a8ecf1d07b2ab7782709987bbd886eb9
|
|
BLAKE2b-256 checksum How to use checksums |
b7ba8f4d54b4591d05318202f67541ea8032c7885ba011b899003f6f3fba037f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / esrp_oss_mcp_test-0.0.2-py3-none-any.whl
| Download URL | esrp_oss_mcp_test-0.0.2-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
263e88af70998ed47275032b1c1ddbf1ac5150b92a41efbf240c8878e84af9ca
|
|
BLAKE2b-256 checksum How to use checksums |
9c57526d65418be4fd7d23640bc81b0d14c74172417b938ef3a14b63242e6ff7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Security for esrp-oss-mcp-test 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.