Sponsored by Deepsite.site

AlphaVantage MCP Server with Azure Functions

Created By
dsaad688 months ago
A demo to showcase a MCP Server with Azure Functions
Content

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.

Architecture diagram

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

Local Development

  1. Clone this repository
  2. Create a virtual environment and install dependencies:
uv sync --frozen
  1. Create a local.settings.json file in the src directory with your AlphaVantage API key:
{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "python",
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "ALPHAVANTAGE_API_KEY": "your-alphavantage-api-key"
  }
}
  1. Run the function locally:
cd src
func start

Deployment

  1. Log in to Azure:
azd auth login
  1. 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:

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:

  1. Input definitions - Prompts for:

    • The Azure Functions MCP Extension System Key (stored securely)
    • Your Azure Functions App Name
  2. Server configurations:

    • remote-mcp-function - Connects to your deployed Azure Function using the inputs above
    • local-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.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
WindsurfThe new purpose-built IDE to harness magic
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Playwright McpPlaywright MCP server
ChatWiseThe second fastest AI chatbot™
DeepChatYour AI Partner on Desktop
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Amap Maps高德地图官方 MCP Server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Serper MCP ServerA Serper MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
CursorThe AI Code Editor
Tavily Mcp
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。