azure function hosting mcp server
Run the following command to create the azure function with mcp
azd init --template remote-mcp-functions-python -e mcpserver-python
Once you have finish, go to the root folder where you will see pyproject.toml and azure.yaml, etc.
Then start vscode. Make sure you have the pre-requisites like Azure function Developer tool and azurite all setup.
From vscode, select "Debug". It will prompt you to create a virtual environment. Please select "yes". When it ask you to run azurite - please select yes.
Running the MCP function app
Next run the function app. You have to go into the src folder first and run vscode.
Then you will be prompted to create an environment. Hit F5 or Run -> Debug. that will install your python modules under requirements.txt.
Launch MCP Server
Next we will lanch our mcp server by creating a file call mcp.json.
}
And you can see it here
Goto local-mcp-function and click "Run"
From the chat window, we issue a "say hello". Then the chatbot will ask for permission to use mcp tool.
Ensure you have configure the chatbox correctly. Ensure it is agent mode and then click on "Configure tools" you can see mcp-local-function, as shown here
Next we will configure the chatbox
And as you can see from here, we are able to hit the azure function mcp server hello_mcp function and it is also asking for permission.
And finally we can see the outputs:-
Comments