AlphaVantage MCP Server with Azure Functions
A demo to showcase a MCP Server with Azure Functions
dsaad68
README
AlphaVantage MCP Server with Azure Functions
This project implements an Azure Function that serves as a bridge between an Agent as a MCP Server and the AlphaVantage Financial API. It allows AI agents to access financial data and perform financial analysis through tools exposed via MCP.
<div align="center"> <img src="docs/az-func-mcp.drawio.png" alt="Architecture diagram" width="100%"/> </div>
The Azure Function exposes the following financial data endpoints as MCP tools:
- Company Overview
- Income Statement
- Balance Sheet
- Cash Flow
- Earnings Report
There is a demo agent created with PydanticAI in the agent
directory that can be used to test the MCP server. More information Demo Agent file.
Prerequisites
- An Azure subscription
- Azure Developer CLI (azd)
- Azure Functions Core Tools
- Python 3.11
- An AlphaVantage API key (see AlphaVantage)
Local Development
- Clone this repository
- Create a virtual environment and install dependencies:
uv sync --frozen
- Create a
local.settings.json
file in thesrc
directory with your AlphaVantage API key:
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "python",
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"ALPHAVANTAGE_API_KEY": "your-alphavantage-api-key"
}
}
- Run the function locally:
cd src
func start
Deployment
- Log in to Azure:
azd auth login
- Deploy the application:
azd up
This will provision the necessary Azure resources and deploy the Function App.
Note: For setting up environment variables, refer to the Adding Environment Variables section.
Getting the MCP Endpoint URL
After deployment, retrieve your MCP extension system key:
az functionapp keys list \
--resource-group <resource_group> \
--name <function_app_name>
Your MCP endpoint URL will be:
https://<funcappname>.azurewebsites.net/runtime/webhooks/mcp/sse?code=<your-mcp-extension-system-key>
Adding Environment Variables
You can add environment variables to your Azure Function in two ways:
1. Using the parameters file (recommended for deployment)
Add your environment variables to the infra/main.parameters.json
file:
{
"parameters": {
// Other parameters...
"functionAppEnvironmentVariables": {
"value": {
"ALPHAVANTAGE_API_KEY": "your-api-key",
"MY_VARIABLE": "my-value"
}
}
}
}
Then deploy with:
azd up
2. Using Azure CLI (for updating existing deployments)
az functionapp config appsettings set \
--name <function_app_name> \
--resource-group <resource-group> \
--settings ALPHAVANTAGE_API_KEY=<your-api-key>
Setting up VS Code for MCP Development
This project includes a .vscode/mcp.json
configuration file that helps you connect to your MCP endpoint during development. This file contains:
-
Input definitions - Prompts for:
- The Azure Functions MCP Extension System Key (stored securely)
- Your Azure Functions App Name
-
Server configurations:
remote-mcp-function
- Connects to your deployed Azure Function using the inputs abovelocal-mcp-function
- Connects to a locally running function on port 7071
This allows you to test your MCP tools directly from VS Code during development, either against your local function app or your deployed Azure instance.
Demo Agent
The agent
directory contains an example of how to use this MCP endpoint with an AI agent using the Agno framework. You can use this as a starting point for your own financial analysis agent.
Infrastructure Code Attribution
The infrastructure code for this project was adapted from Azure-Samples/remote-mcp-functions-python, which provides a template for deploying Python functions as remote MCP tools on Azure.
Recommended Servers
Crypto Price & Market Analysis MCP Server
A Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface.
MCP PubMed Search
Server to search PubMed (PubMed is a free, online database that allows users to search for biomedical and life sciences literature). I have created on a day MCP came out but was on vacation, I saw someone post similar server in your DB, but figured to post mine.
dbt Semantic Layer MCP Server
A server that enables querying the dbt Semantic Layer through natural language conversations with Claude Desktop and other AI assistants, allowing users to discover metrics, create queries, analyze data, and visualize results.
mixpanel
Connect to your Mixpanel data. Query events, retention, and funnel data from Mixpanel analytics.

Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Nefino MCP Server
Provides large language models with access to news and information about renewable energy projects in Germany, allowing filtering by location, topic (solar, wind, hydrogen), and date range.
Vectorize
Vectorize MCP server for advanced retrieval, Private Deep Research, Anything-to-Markdown file extraction and text chunking.
Mathematica Documentation MCP server
A server that provides access to Mathematica documentation through FastMCP, enabling users to retrieve function documentation and list package symbols from Wolfram Mathematica.
kb-mcp-server
An MCP server aimed to be portable, local, easy and convenient to support semantic/graph based retrieval of txtai "all in one" embeddings database. Any txtai embeddings db in tar.gz form can be loaded
Research MCP Server
The server functions as an MCP server to interact with Notion for retrieving and creating survey data, integrating with the Claude Desktop Client for conducting and reviewing surveys.