A Model Context Protocol (MCP) server for stock traders.
The server provides the following tools for stock analysis and trading:
analyze-stock: Performs technical analysis on a given stock symbol
symbol
(string, e.g. "NVDA")relative-strength: Calculates a stock's relative strength compared to a benchmark
symbol
(string, e.g. "AAPL")benchmark
(string, default: "SPY")volume-profile: Analyzes volume distribution by price
symbol
(string, e.g. "MSFT")lookback_days
(integer, default: 60)detect-patterns: Identifies chart patterns in price data
symbol
(string, e.g. "AMZN")position-size: Calculates optimal position size based on risk parameters
symbol
(string, e.g. "TSLA")stop_price
(number)risk_amount
(number)account_size
(number)price
(number, default: current price)suggest-stops: Suggests stop loss levels based on technical analysis
symbol
(string, e.g. "META")The server leverages several specialized analysis modules:
TechnicalAnalysis: Core technical indicators and trend analysis
RelativeStrength: Comparative performance analysis
VolumeProfile: Advanced volume analysis
PatternRecognition: Chart pattern detection
RiskAnalysis: Position sizing and risk management
The server uses the Tiingo API for market data:
Create a .env
file:
TIINGO_API_KEY=your_api_key_here
To install Trader for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install mcp-trader --client claude
This will:
The server includes a smithery.yaml
configuration file that defines:
You can customize the Smithery configuration by editing the smithery.yaml
file.
uv venv --python 3.11
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv sync
The project includes a Dockerfile for containerized deployment:
# Build the Docker image
docker build -t mcp-trader .
# Run the container with your API key
docker run -e TIINGO_API_KEY=your_api_key_here -p 8000:8000 mcp-trader
To run the container in HTTP server mode:
docker run -e TIINGO_API_KEY=your_api_key_here -p 8000:8000 mcp-trader uv run mcp-trader --http
On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
Development Configuration:
{
"mcpServers": {
"stock-analyzer": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/mcp-trader",
"run",
"mcp-trader"
]
"env": {
"TIINGO_API_KEY": "your_api_key_here"
}
}
}
}
uv build
uv run mcp-trader
The server can also run as a standalone HTTP server for testing or integration with other applications:
uv run mcp-trader --http
This starts an HTTP server on http://localhost:8000 with the following endpoints:
{
"name": "analyze-stock",
"arguments": {
"symbol": "AAPL"
}
}
Use the MCP Inspector for debugging:
npx @modelcontextprotocol/inspector uv --directory /path/to/mcp-trader run mcp-trader
In Claude Desktop:
Analyze the technical setup for NVDA
The server will return a technical analysis summary including trend status, momentum indicators, and key metrics.
See pyproject.toml for full dependency list:
- aiohttp >=3.11.11
- mcp >=1.2.0
- numpy ==1.26.4
- pandas >=2.2.3
- pandas-ta >=0.3.14b0
- python-dotenv >=1.0.1
- setuptools >=75.8.0
- ta-lib >=0.6.0
Contributions to MCP Trader are welcome! Here are some ways you can contribute:
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)The MCP Trader project has several planned enhancements:
Learn more about this project through these detailed blog posts:
Seamless access to top MCP servers powering the future of AI integration.