Back to MCP Servers

Alpha Vantage

Alpha Vantage API integration to fetch both stock and crypto information

finance-fintechapi
By berlinbra
10140Updated 8 months agoPythonMIT

Installation

npx -y alpha-vantage-mcp

Configuration

{
  "mcpServers": {
    "alpha-vantage-mcp": {
      "command": "npx",
      "args": ["-y", "alpha-vantage-mcp"]
    }
  }
}

How to use

  1. Run the installation command above (if needed)
  2. Open your Claude Code settings file (~/.claude/settings.json)
  3. Add the configuration to the mcpServers section
  4. Restart Claude Code to apply changes

Alpha Vantage MCP Server

smithery badge

A Model Context Protocol (MCP) server that provides real-time access to financial market data through the free Alpha Vantage API. This server implements a standardized interface for retrieving stock quotes and company information.

<a href="https://glama.ai/mcp/servers/0wues5td08"><img width="380" height="200" src="https://glama.ai/mcp/servers/0wues5td08/badge" alt="AlphaVantage-MCP MCP server" /></a>

Features

  • Real-time stock quotes with price, volume, and change data
  • Detailed company information including sector, industry, and market cap
  • Real-time cryptocurrency exchange rates with bid/ask prices
  • Daily, weekly, and monthly cryptocurrency time series data
  • Real-time options chain data with Greeks and implied volatility
  • Historical options chain data with advanced filtering and sorting
  • Comprehensive ETF profile data with holdings, sector allocation, and key metrics
  • Upcoming earnings calendar with customizable time horizons
  • Historical earnings data with annual and quarterly reports
  • Built-in error handling and rate limit management

Installation

Using Claude Desktop

Installing via Docker

  • Clone the repository and build a local image to be utilized by your Claude desktop client
cd alpha-vantage-mcp
docker build -t mcp/alpha-vantage .
  • Change your claude_desktop_config.json to match the following, replacing REPLACE_API_KEY with your actual key:

claude_desktop_config.json path

  • On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
  • On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "alphavantage": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-e",
        "ALPHA_VANTAGE_API_KEY",
        "mcp/alpha-vantage"
      ],
      "env": {
        "ALPHA_VANTAGE_API_KEY": "REPLACE_API_KEY"
      }
    }
  }
}

Installing via Smithery

To install Alpha Vantage MCP Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @berlinbra/alpha-vantage-mcp --client claude
<summary> <h3> Development/Unpublished Servers Configuration <h3> </summary> <details>
{
 "mcpServers": {
  "alpha-vantage-mcp": {
   "args": [
    "--directory",
    "/Users/{INSERT_USER}/YOUR/PATH/TO/alpha-vantage-mcp",
    "run",
    "alpha-vantage-mcp"
   ],
   "command": "uv",
   "env": {
    "ALPHA_VANTAGE_API_KEY": "<insert api key>"
   }
  }
 }
}
</details>

Install packages

uv install -e .

Running

After connecting Claude client with the MCP tool via json file and installing the packages, Claude should see the server's mcp tools:

You can run the sever yourself via: In alpha-vantage-mcp repo:

uv run src/alpha_vantage_mcp/server.py

with inspector

* npx @modelcontextprotocol/inspector uv --directory /Users/{INSERT_USER}/YOUR/PATH/TO/alpha-vantage-mcp run src/alpha_vantage_mcp/server.py `

Available Tools

The server implements twelve tools:

  • get-stock-quote: Get the latest stock quote for a specific company
  • get-company-info: Get stock-related information for a specific company
  • get-crypto-exchange-rate: Get current cryptocurrency exchange rates
  • get-time-series: Get historical daily price data for a stock
  • get-realtime-options: Get real-time options chain data with Greeks and implied volatility
  • get-historical-options: Get historical options chain data with advanced filtering and sorting capabilities
  • get-etf-profile: Get comprehensive ETF profile information including holdings and sector allocation
  • get-crypto-daily: Get daily time series data for a cryptocurrency
  • get-crypto-weekly: Get weekly time series data for a cryptocurrency
  • get-crypto-monthly: Get monthly time series data for a cryptocurrency
  • get-earnings-calendar: Get upcoming earnings calendar data for companies
  • get-historical-earnings: Get historical earnings data for a specific company

get-stock-quote

Input Schema:

{
    "symbol": {
        "type": "string",
        "description": "Stock symbol (e.g., AAPL, MSFT)"
    }
}

Example Response:

Stock quote for AAPL:

Price: $198.50
Change: $2.50 (+1.25%)
Volume: 58942301
High: $199.62
Low: $197.20

get-company-info

Retrieves detailed company information for a given symbol.

Input Schema:

{
    "symbol": {
        "type": "string",
        "description": "Stock symbol (e.g., AAPL, MSFT)"
    }
}

Example Response:

Company information for AAPL:

Name: Apple Inc
Sector: Technology
Industry: Consumer Electronics
Market Cap: $3000000000000
Description: Apple Inc. designs, manufactures, and markets smartphones...
Exchange: NASDAQ
Currency: USD

get-crypto-exchange-rate

Retrieves real-time cryptocurrency exchange rates with additional market data.

Input Schema:

{
    "crypto_symbol": {
        "type": "string",
        "description": "Cryptocurrency symbol (e.g., BTC, ETH)"
    },
    "market": {
        "type": "string",
        "description": "Market currency (e.g., USD, EUR)",
        "default": "USD"
    }
}

Example Response:

Cryptocurrency exchange rate for BTC/USD:

From: Bitcoin (BTC)
To: United States Dollar (USD)
Exchange Rate: 43521.45000
Last Updated: 2024-12-17 19:45:00 UTC
Bid Price: 43521.00000
Ask Price: 43522.00000

get-time-series

Retrieves daily time series (OHLCV) data with optional date filtering.

Input Schema:

{
    "symbol": {
        "type": "string",
        "description": "Stock symbol (e.g., AAPL, MSFT)"
    },
    "outputsize": {
        "type": "string",
        "description": "compact (latest 100 data points) or full (up to 20 years of data). When start_date or end_date is specified, defaults to 'full'",
        "default": "compact"
    },
    "start_date": {
        "type": "string",
        "description": "Optional: Start date in YYYY-MM-DD format for filtering results",
        "pattern": "^20[0-9]{2}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12][0-9]|3[01])$"
    },
    "end_date": {
        "type": "string",
        "description": "Optional: End date in YYYY-MM-DD format for filtering results",
        "pattern": "^20[0-9]{2}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12][0-9]|3[01])$"
    },
    "limit": {
        "type": "integer",
        "description": "Optional: Number of data points to return when no date filtering is applied (default: 5)",
        "default": 5,
        "minimum": 1
    }
}

Example Response (Recent Data):

Time Series Data for AAPL (Last Refreshed: 2024-12-17 16:00:00):
(Showing 5 most recent data points)

Date: 2024-12-16
Open: $195.09
High: $197.68
Low: $194.83
Close: $197.57
Volume: 55,751,011
---
Date: 2024-12-13
Open: $194.50
High: $196.25
Low: $193.80
Close: $195.12
Volume: 48,320,567
---

Example Response (Date Range Filtering):

Time Series Data for AAPL (Last Refreshed: 2024-12-17 16:00:00):
Date Range: 2024-12-01 to 2024-12-07 (5 data points)

Date: 2024-12-06
Open: $191.25
High: $193.80
Low: $190.55
Close: $192.90
Volume: 52,145,890
---
Date: 2024-12-05
Open: $189.75
High: $192.40
Low: $188.90
Close: $191.30
Volume: 47,892,345
---

get-realtime-options

Retrieves real-time options chain data for a stock with optional Greeks calculation and contract filtering.

⚠️ PREMIUM SUBSCRIPTION REQUIRED: This endpoint requires Alpha Vantage Premium with either the 600 requests/minute or 1200 requests/minute plan. The standard 75 requests/minute plan and free accounts will receive placeholder/demo data instead of real market data. For most use cases, consider using get-historical-options which works with all API key tiers.

Input Schema:

{
    "symbol": {
        "type": "string",
        "description": "Stock symbol (e.g., AAPL, MSFT)"
    },
    "require_greeks": {
        "type": "boolean",
        "description": "Optional: Enable Greeks and implied volatility calculation (default: false)",
        "default": false
    },
    "contract": {
        "type": "string",
        "description": "Optional: Specific options contract ID to retrieve"
    },
    "datatype": {
        "type": "string",
        "description": "Optional: Response format (json or csv, default: json)",
        "enum": ["json", "csv"],
        "default": "json"
    }
}

Example Response:

Realtime Options Data for AAPL
Last Updated: 2025-01-21 16:00:00

=== Expiration: 2025-01-24 ===

Strike: $220.0 (CALL)
Last: $5.25
Bid: $5.10
Ask: $5.30
Volume: 1250
Open Interest: 8420
IV: 0.28
Delta: 0.65
Gamma: 0.02
Theta: -0.15
Vega: 0.45
Rho: 0.12
---

Strike: $220.0 (PUT)
Last: $1.85
Bid: $1.80
Ask: $1.90
Volume: 820
Open Interest: 5240
IV: 0.25
Delta: -0.35
Gamma: 0.02
Theta: -0.12
Vega: 0.42
Rho: -0.08
---

Note: The above example shows real market data which is only available with Alpha Vantage Premium 600+ requests/minute plans. Users with free accounts or 75 requests/minute plans will see placeholder data (symbols like "XXYYZZ", dates like "2099-99-99") and should use get-historical-options instead.

get-historical-options

Retrieves historical options chain data with advanced filtering and sorting capabilities to find specific contracts.

Input Schema:

{
    "symbol": {
        "type": "string",
        "description": "Stock symbol (e.g., AAPL, MSFT)"
    },
    "date": {
        "type": "string",
        "description": "Optional: Trading date in YYYY-MM-DD format (defaults to previous trading day, must be after 2008-01-01)",
        "pattern": "^20[0-9]{2}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12][0-9]|3[01])$"
    },
    "expiry_date": {
        "type": "string",
        "description": "Optional: Filter by expiration date in YYYY-MM-DD format",
        "pattern": "^20[0-9]{2}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12][0-9]|3[01])$"
    },
    "min_strike": {
        "type": "number",
        "description": "Optional: Minimum strike price filter (e.g., 100.00)",
        "minimum": 0
    },
    "max_strike": {
        "type": "number",
        "description": "Optional: Maximum strike price filter (e.g., 200.00)",
        "minimum": 0
    },
    "contract_id": {
        "type": "string",
        "description": "Optional: Filter by specific contract ID (e.g., MSTR260116C00000500)"
    },
    "contract_type": {
        "type": "string",
        "description": "Optional: Filter by contract type (call or put)",
        "enum": ["call", "put", "C", "P"]
    },
    "limit": {
        "type": "integer",
        "description": "Optional: Number of contracts to return after filtering (default: 10, use -1 for all contracts)",
        "default": 10,
        "minimum": -1
    },
    "sort_by": {
        "type": "string",
        "description": "Optional: Field to sort by",
        "enum": ["strike", "expiration", "volume", "open_interest", "implied_volatility", "delta", "gamma", "theta", "vega", "rho", "last", "bid", "ask"],
        "default": "strike"
    },
    "sort_order": {
        "type": "string",
        "description": "Optional: Sort order",
        "enum": ["asc", "desc"],
        "default": "asc"
    }
}

Example Response (Basic):

Historical Options Data for AAPL (2024-02-20):
Status: success
Found 156 contracts, sorted by: strike (asc)

Contract Details:
Contract ID: AAPL240315C00190000
Expiration: 2024-03-15
Strike: $190.00
Type: call
Last: $8.45
Bid: $8.40
Ask: $8.50
Volume: 1245
Open Interest: 4567
Implied Volatility: 0.25
Greeks:
  Delta: 0.65
  Gamma: 0.04
  Theta: -0.15
  Vega: 0.30
  Rho: 0.25
---

Example Response (Filtered):

Historical Options Data for MSTR (2024-02-20):
Status: success
Filters: Expiry: 2026-01-16, Strike: min $4

…
View source on GitHub