Alpha Vantage Stock Data MCP server

Integrates with Alpha Vantage API to provide real-time and historical stock market data, enabling financial analysis with customizable price alerts and data retrieval options.
Back to servers
Setup instructions
Provider
qubaoming
Release date
Mar 18, 2025
Language
TypeScript
Stats
4 stars

This MCP server provides access to Alpha Vantage stock market data through the Model Context Protocol. It enables Claude and other MCP clients to retrieve real-time and historical stock information, generate alerts based on price movements, and access stock data as resources.

Prerequisites

  • Node.js 16 or higher
  • An Alpha Vantage API key (get one for free at Alpha Vantage)

Installation

  1. Clone the repository
  2. Install dependencies:
    npm install
    
  3. Create a .env file in the root directory with your API key:
    ALPHA_VANTAGE_API_KEY=your_api_key_here
    

Running the Server

Build the TypeScript code:

npm run build

Start the server:

npm start

For development with auto-reloading:

npm run dev

Integration with Claude for Desktop

  1. Open Claude for Desktop
  2. Navigate to Settings > Developer > Edit Config
  3. Add the following to your claude_desktop_config.json:
{
  "mcpServers": {
    "alpha-vantage": {
      "command": "node",
      "args": ["/absolute/path/to/dist/index.js"],
      "env": {
        "ALPHA_VANTAGE_API_KEY": "YOUR_API_KEY"
      } 
    }
  }
}
  1. Replace /absolute/path/to/dist/index.js with the absolute path to the built index.js file
  2. Restart Claude for Desktop

Available Tools

get-stock-data

Retrieves intraday stock data for a specific symbol.

Parameters:

  • symbol (required): Stock symbol (e.g., IBM, AAPL)
  • interval (optional): Time interval between data points (1min, 5min, 15min, 30min, 60min). Default: 5min
  • outputsize (optional): Amount of data to return (compact: latest 100 data points, full: up to 20 years of data). Default: compact

get-daily-stock-data

Retrieves daily stock data for a specific symbol.

Parameters:

  • symbol (required): Stock symbol (e.g., IBM, AAPL)
  • outputsize (optional): Amount of data to return (compact: latest 100 data points, full: up to 20 years of data). Default: compact

get-stock-alerts

Analyzes stock data to generate alerts based on price movements.

Parameters:

  • symbol (required): Stock symbol (e.g., IBM, AAPL)
  • threshold (optional): Percentage threshold for price movement alerts. Default: 5

Available Resources

stock-data

Access stock data directly as a resource.

URI Template: stock://{symbol}/{interval}

Parameters:

  • symbol: Stock symbol (e.g., IBM, AAPL)
  • interval: Time interval (daily, 1min, 5min, 15min, 30min, 60min). Default: daily

Example usage in Claude:

  • "Can you analyze this stock data: stock://AAPL/daily"
  • "What do you think about this data: stock://MSFT/5min"

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" '{"command":"node","args":["/absolute/path/to/dist/index.js"],"env":{"ALPHA_VANTAGE_API_KEY":"YOUR_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": {
            "command": "node",
            "args": [
                "/absolute/path/to/dist/index.js"
            ],
            "env": {
                "ALPHA_VANTAGE_API_KEY": "YOUR_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": {
            "command": "node",
            "args": [
                "/absolute/path/to/dist/index.js"
            ],
            "env": {
                "ALPHA_VANTAGE_API_KEY": "YOUR_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