remote-mcp-functions-python
61
This project is a quickstart template for deploying a custom Model Context Protocol (MCP) server using Azure Functions and Python. It offers features such as easy deployment, enhanced security measures, and options for OAuth integration. The server can be run locally for development and easily deployed to Azure with network and security configurations.
Getting Started with Remote MCP Servers using Azure Functions (Python)
- This is a template to build and deploy a custom remote MCP server to the cloud using Azure Functions with Python.
- Easily clone, restore, and run locally with debugging and deploy to the cloud.
- The server ensures security with keys, HTTPS, and offers OAuth options.
- Architecture diagram and examples in .NET and Node.js/TypeScript are available.
Prerequisites
- Python 3.11 or higher
- Azure Functions Core Tools
- Azure Developer CLI
- Visual Studio Code with Azure Functions extension
Prepare your local environment
- Start Azurite for Azure Storage Emulator.
Run your MCP Server locally
- Change to the src folder, install Python dependencies, and start the Functions host locally.
Connect to the local MCP server
- Use VS Code or MCP Inspector to connect and interact with the server.
Deploy to Azure for Remote MCP
- Use Azure Developer CLI to deploy the function app and use VNet for network isolation.
- API Management and App Service built-in authentication can enhance security.
Connect to your remote MCP server
- Requires a system key to invoke the SSE endpoint. Keys can be obtained via portal or CLI.
Redeploy your code
- Use
azd up
to redeploy code as needed.
Clean up resources
- Delete resources using
azd down
command to avoid costs.
Helpful Azure Commands
- Various commands to manage and monitor the application are provided.
Source Code
- Functions such as
get_snippet
andsave_snippet
are defined in Python files in thesrc
directory.
Next Steps
- Add API Management or built-in auth to your MCP server, enable VNET, and explore more resources from Microsoft.