Alpha Vantage MCP server

Integrates with Alpha Vantage API to provide real-time financial market data for stock quotes, company information, cryptocurrency rates, and historical prices.
Back to servers
Setup instructions
Provider
berlinbra
Release date
Dec 19, 2024
Language
Python
Stats
48 stars

The Alpha Vantage MCP Server provides real-time access to financial market data through the Alpha Vantage API. This server implements a standardized interface for retrieving stock quotes, company information, cryptocurrency data, and options chain information.

Installation

Using Docker with Claude Desktop

  1. Clone the repository and build a local Docker image:
cd alpha-vantage-mcp
docker build -t mcp/alpha-vantage .
  1. Update your claude_desktop_config.json file (replace REPLACE_API_KEY with your actual Alpha Vantage API key):

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

For automatic installation with Claude Desktop via Smithery:

npx -y @smithery/cli install @berlinbra/alpha-vantage-mcp --client claude

Manual Installation

  1. Install required packages:
uv install -e .
  1. Run the server:
uv run src/alpha_vantage_mcp/server.py

To run with inspector:

npx @modelcontextprotocol/inspector uv --directory /path/to/alpha-vantage-mcp run src/alpha_vantage_mcp/server.py

Available Tools

Get Stock Quote

Retrieves the latest stock quote for a specific company.

Input:

{
    "symbol": "AAPL"
}

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.

Input:

{
    "symbol": "AAPL"
}

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.

Input:

{
    "crypto_symbol": "BTC",
    "market": "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 for stocks.

Input:

{
    "symbol": "AAPL",
    "outputsize": "compact"
}

Example Response:

Time Series Data for AAPL (Last Refreshed: 2024-12-17 16:00:00):

Date: 2024-12-16
Open: $195.09
High: $197.68
Low: $194.83
Close: $197.57
Volume: 55,751,011

Get Historical Options

Retrieves historical options chain data with advanced sorting.

Input:

{
    "symbol": "AAPL",
    "date": "2024-02-20",
    "limit": 10,
    "sort_by": "strike",
    "sort_order": "asc"
}

Example Response:

Historical Options Data for AAPL (2024-02-20):

Contract 1:
Strike: $190.00
Expiration: 2024-03-15
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

Get Crypto Daily

Retrieves daily time series data for cryptocurrencies.

Input:

{
    "symbol": "SOL",
    "market": "USD"
}

Example Response:

Daily cryptocurrency time series for SOL in USD:

Daily Time Series for Solana (SOL)
Market: United States Dollar (USD)
Last Refreshed: 2025-04-17 00:00:00 UTC

Date: 2025-04-17
Open: 131.31000000 USD
High: 131.67000000 USD
Low: 130.74000000 USD
Close: 131.15000000 USD
Volume: 39652.22195178
---
Date: 2025-04-16
Open: 126.10000000 USD
High: 133.91000000 USD
Low: 123.46000000 USD
Close: 131.32000000 USD
Volume: 1764240.04195810

Get Crypto Weekly

Retrieves weekly time series data for cryptocurrencies.

Input:

{
    "symbol": "SOL",
    "market": "USD"
}

Example Response:

Weekly cryptocurrency time series for SOL in USD:

Weekly Time Series for Solana (SOL)
Market: United States Dollar (USD)
Last Refreshed: 2025-04-17 00:00:00 UTC

Date: 2025-04-17
Open: 128.32000000 USD
High: 136.00000000 USD
Low: 123.46000000 USD
Close: 131.15000000 USD
Volume: 4823091.05667581

Get Crypto Monthly

Retrieves monthly time series data for cryptocurrencies.

Input:

{
    "symbol": "SOL",
    "market": "USD"
}

Example Response:

Monthly cryptocurrency time series for SOL in USD:

Monthly Time Series for Solana (SOL)
Market: United States Dollar (USD)
Last Refreshed: 2025-04-17 00:00:00 UTC

Date: 2025-04-17
Open: 124.51000000 USD
High: 136.18000000 USD
Low: 95.16000000 USD
Close: 131.15000000 USD
Volume: 34268628.85976021

Error Handling

The server includes comprehensive error handling for:

  • Rate limit exceeded
  • Invalid API key
  • Network connectivity issues
  • Timeout handling
  • Malformed responses

All errors are returned in a clear, human-readable format.

System Requirements

  • Python 3.12 or higher
  • An Alpha Vantage API key (obtain from alphavantage.co)

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "alpha-vantage-mcp" '{"command":"uv","args":["run","src/alpha_vantage_mcp/server.py"],"env":{"ALPHA_VANTAGE_API_KEY":"<insert api key>"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "alpha-vantage-mcp": {
            "command": "uv",
            "args": [
                "run",
                "src/alpha_vantage_mcp/server.py"
            ],
            "env": {
                "ALPHA_VANTAGE_API_KEY": "<insert api key>"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "alpha-vantage-mcp": {
            "command": "uv",
            "args": [
                "run",
                "src/alpha_vantage_mcp/server.py"
            ],
            "env": {
                "ALPHA_VANTAGE_API_KEY": "<insert api key>"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later