A Model Context Protocol (MCP) server that provides stock market data tools using the Alpha Vantage API.
- company_overview
- Fetch detailed fundamental information about any publicly traded company from company overview endpoint
- company_sentiment
- Retrieve market news and sentiment data filtered by tickers or topics from news and sentiment
- get_stock_price
- Get real-time global quotes for any stock ticker from quote endpoint
- get_monthly_historical_data
- Access monthly historical stock price data for technical analysis from time series monthly endpoint
- Python 3.10 or higher
- Poetry (Python package manager)
- Alpha Vantage API key (Get one free here)
- Claude Desktop
git clone <repo-url>
cd custom-mcp-serverpoetry installCreate a .env file in the project root:
ALPHA_VANTAGE_BASE_API_URL=https://www.alphavantage.co/query
ALPHA_VANTAGE_KEY=your_api_key_herepoetry run serverIf successful, you should see the MCP server start without errors.
poetry env info --pathThis will output something like:
/Users/username/Library/Caches/pypoetry/virtualenvs/custom-mcp-server-xxxxx-py3.13
Edit your Claude Desktop configuration file:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Add the following configuration:
{
"mcpServers": {
"Stock Analysis": {
"command": "/path/to/your/virtualenv/custom-mcp-server-xxxxx-py3.13/bin/python",
"args": ["-m", "custom_mcp_server"],
"cwd": "/absolute/path/to/custom-mcp-server",
"env": {
"ALPHA_VANTAGE_BASE_API_URL": "https://www.alphavantage.co/query",
"ALPHA_VANTAGE_KEY": "your_api_key_here"
}
}
}
}Important: Replace the paths with your actual paths:
- Use the virtualenv path from step 1
- Use the absolute path to your project directory
- The alpha vantage api allows 25 requests per day
Completely quit Claude Desktop (Cmd+Q on Mac) and restart it for the changes to take effect.
Once configured, you can interact with the server through Claude Desktop:
What's the company overview for Apple (AAPL)?
What's the current stock price of Tesla?
Get news sentiment for Microsoft from the last week
Show me the monthly historical data for Amazon stock
MIT License