Stock Market (Alpha Vantage) MCP server

Provides real-time stock market data through the Alpha Vantage API, delivering daily prices, volume, and metrics for any stock symbol with proper currency formatting and rate-limit awareness.
Back to servers
Provider
ctoouli
Release date
Mar 13, 2025
Language
TypeScript
Stats
1 star

This MCP Stock Market tool provides a simple interface to retrieve daily stock market data for any stock symbol using the Alpha Vantage API through the Model Context Protocol (MCP).

Installation Requirements

  • Node.js v18 or higher
  • An Alpha Vantage API key (free tier available)

Setup Instructions

Install Dependencies

npm install

Configure API Key

  1. Create a .env file based on the provided example
  2. Add your Alpha Vantage API key
ALPHA_VANTAGE_API_KEY=your_api_key_here

You can obtain a free API key from Alpha Vantage.

Build the Project

npm run build

Client Configuration

To use this tool with your MCP client, update your MCP server configuration by adding the following to your client's config:

{
  "mcpServers": {
    "stock-market": {
      "command": "node",
      "args": [
        "/ABSOLUTE/PATH/TO/PARENT/FOLDER/mcp-stock-market/build/index.js"
      ]
    }
  }
}

Important: Replace /ABSOLUTE/PATH/TO/PARENT/FOLDER with the actual absolute path to the parent directory containing this repository.

Using the Stock Market Tool

Retrieving Stock Data

The tool provides a get-stock-data command to retrieve daily stock market data.

Parameters:

  • symbol: Stock symbol (e.g., IBM, AAPL, MSFT, GOOG, AMZN)

Example Usage:

@stock-market get-stock-data symbol=AAPL

Example Response:

Stock: AAPL
Last Updated: 2025-03-12
Time Zone: US/Eastern

Daily Prices:

Date: 2025-03-12
Open: $178.35
High: $180.13
Low: $177.53
Close: $179.63
Volume: 58,492,206
---

Date: 2025-03-11
Open: $177.99
High: $179.70
Low: $176.86
Close: $178.95
Volume: 62,630,570
---

API Limitations

The free tier of Alpha Vantage has the following constraints:

  • 25 API calls per day
  • 5 API calls per minute

Consider upgrading to a premium plan if you need higher capacity.

Troubleshooting

If you encounter issues:

  • Verify your Alpha Vantage API key is correctly set in the .env file
  • Ensure you're using Node.js version 18 or higher
  • Check that the path in your MCP client configuration is correct
  • Try restarting your MCP client

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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