alphavantage

The Alpha Vantage MCP server is a tool for providing stock market data via the Alpha Vantage API. Users can easily utilize it by obtaining an API key and setting it in their environment variables. It can run in two modes: the standard stdio server mode and a streamable HTTP server mode that offers real-time updates, allowing for flexible usage.

GitHub Stars

69

User Rating

Not Rated

Favorites

0

Views

29

Forks

21

Issues

1

Installation
Difficulty
Intermediate
Estimated Time
10-20 minutes
Requirements
Python 3.6以上
Alphavantage APIキー

Installation

Installation

Prerequisites

Python: 3.6 or higher
Alphavantage API Key: Obtain [here](https://www.alphavantage.co/support/#api-key)

Installation Steps

1. Clone Repository

bash
git clone https://github.com/calvernaz/alphavantage.git
cd alphavantage

2. Set Environment Variables

Add the API key to your environment variables:
bash
export ALPHAVANTAGE_API_KEY="YOUR_API_KEY_HERE"

3. Start the Server

bash
alphavantage

Troubleshooting

Common Issues

Issue: Server won't start Solution: Check if the API key is set correctly. Issue: Unable to fetch data Solution: Verify the validity of the API key and check API limits.

Configuration

Configuration

Claude Desktop Setup

Edit claude_desktop_config.json to add the MCP server:
json
{
  "mcpServers": {
    "alphavantage": {
      "command": "uv",
      "args": [
        "--directory",
        "/alphavantage",
        "run",
        "alphavantage"
      ],
      "env": {
        "ALPHAVANTAGE_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

Advanced Configuration

Security Settings

Store the API key in environment variables to prevent access by other users.
Configure the server port settings appropriately.

Performance Tuning

To set the port for streaming mode, use the following:
json
{
  "mcpServers": {
    "alphavantage": {
      "command": "uv",
      "args": [
        "--directory",
        "/alphavantage",
        "run",
        "alphavantage",
        "--server",
        "http",
        "--port",
        "8080"
      ],
      "env": {
        "ALPHAVANTAGE_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

Examples

Examples

Using with Claude Desktop

1Verify MCP Server Startup
Open Claude Desktop and confirm that the configuration has been loaded correctly.
2Execute Basic Commands

   Available tools from this MCP server:
   - tool1: Description of tool1
   - tool2: Description of tool2
   

Programmatic Usage

python
import requests

def call_mcp_tool(tool_name, params):
    response = requests.post(
        'http://localhost:8080/mcp/call',
        json={
            'tool': tool_name,
            'parameters': params
        }
    )
    return response.json()

Usage example

result = call_mcp_tool('analyze', { 'input': 'sample data', 'options': {'format': 'json'} })

Use Cases

Developing applications for real-time monitoring of stock data
Fetching market data for automated trading systems
Evaluating stock performance in data analysis tools
Building dashboard applications for investors

Additional Resources