Trading MCP Server
An intelligent trading assistant that fetches live stock prices using the Yahoo Finance API.
Trading-MCP-Server
An intelligent trading assistant that integrates with the Claude AI MCP (Model Context Protocol) platform. This tool fetches live stock prices using Yahoo Finance and enables seamless command-based interaction with the market via Claude's agent interface.
π Features
- π Fetches real-time (or near real-time) stock prices using Yahoo Finance
- π€ Connects to Claude MCP as a server with custom trading commands
- π Built using Python with support for virtual environments and
uvfor dependency management - βοΈ Supports modular expansion to include trading signals, historical analysis, and more
π§ Architecture
- Claude AI MCP Integration: Uses
mcp[cli]to expose a server interface to Claude. - Yahoo Finance API: For retrieving stock data (via
yfinance). - Virtual Environment: Managed using
uvfor fast and deterministic builds.
π¦ Setup
# Install uv if not already installed
brew install uv
# Navigate to the project directory
cd MCPtrading
# Install dependencies
uv pip install -r requirements.txt
# (Optional) Add packages
uv add yfinance
πββοΈ Running the Server
Make sure to use the correct Python environment:
uv run --python .venv/bin/python --with "mcp[cli]" mcp run trader_tools.py
Or update your Claude config:
{
"mcpServers": {
"Trading": {
"command": "/Users/yourname/.local/bin/uv",
"args": [
"run",
"--python",
"/full/path/to/.venv/bin/python",
"--with",
"mcp[cli]",
"mcp",
"run",
"trader_tools.py"
]
}
}
}
π§ͺ Example Usage
Ask Claude:
"What's the latest price of AAPL?"
Claude will call the MCP server and respond with the current stock price.
Related Servers
NBA MCP Server
Provides NBA statistics and live game data using the Model Context Protocol (MCP).
Baseball MCP
An MCP server for retrieving Major League Baseball (MLB) game results, schedules, and specific game details using the mlb-statsapi library.
Stock Analysis
An MCP server for stock analysis, offering tools for chip distribution, pattern analysis, trend reversal detection, and market scanning.
OpenRoute MCP
πΊοΈ MCP server to help plan routes using OpenRouteService.org, for activities such as hiking or mountain biking.
Minecraft MCP
Control a Minecraft character to build, explore, and interact with the game world using natural language.
USA Spending MCP
Track government spending, search government spending be agency, explore government spending to communities, and much more.
Tokyo WBGT MCP Server
Provides real-time and forecast WBGT (Heat Index) data for Tokyo from Japan's Ministry of the Environment.
UPS MCP Server
An MCP server for accessing UPS shipping and logistics services.
Minecraft MCP Integration
Enables AI assistants to interact with a Minecraft server using the Model Context Protocol (MCP).
Salaah MCP
FastAPI and MCP service providing Islamic prayer times and other useful calculations.