- Home
- MCP servers
- Trading Quantitative
Trading Quantitative
- python
1
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"j840425-mcp_trading": {
"command": "/ruta/completa/a/pry_mcp_trading/.venv/bin/python",
"args": [
"/ruta/completa/a/pry_mcp_trading/server.py"
],
"env": {
"PYTHONPATH": "/ruta/completa/a/pry_mcp_trading",
"NEWSDATA_API_KEY": "your_newsdata_key",
"ALPHA_VANTAGE_API_KEY": "your_alpha_vantage_key"
}
}
}
}This MCP Trading Quantitative Analysis Server offers a modular MCP (Model Context Protocol) workflow that exposes market data, technical indicators, sentiment analysis, and trading signals for stocks and forex. You can connect an MCP client to query current prices, historical data, indicators, sentiment from financial news, and generate actionable signals, all through a single, extensible server.
How to use
You interact with the server through an MCP client. Start by connecting to the local MCP server you configured and then request tools from the four groups. Use the market data tools to fetch current prices or historical OHLCV data, the technical indicators tools to compute indicators such as RSI, MACD, or Bollinger Bands, the news analysis tools to retrieve and assess sentiment from financial news, and the signals tools to generate technical, fundamental, or hybrid trading signals. Combine results to form a trading view or automate decision making in your workflow.
How to install
Prerequisites you need before installation:
Follow these concrete steps to install and run the server locally:
# 1. Clone the project folder
cd /path/to/pry_mcp_trading
# 2. Create and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activate # Linux/Mac
# or
.venv\Scripts\activate # Windows
# 3. Install Python dependencies
pip install -r requirements.txt
# 4. Configure API keys
cp .env.example .env
nano .env
# In the .env file add your keys:
ALPHA_VANTAGE_API_KEY=your_alpha_vantage_key
NEWSDATA_API_KEY=your_newsdata_key
# 5. Test the connection to APIs
python test_connection.py
# 6. Start the MCP server
python server.py
Additional sections
Configuration and runtime behavior rely on environment variables and modular components. You can adapt paths to your system during setup and use environment variables to control runtime behavior. The server exposes tools grouped into market data, technical indicators, news analysis, and trading signals, all accessible through the MCP interface.
Configuration snippet for local MCP client
{
"mcpServers": {
"trading_quantitative": {
"command": "/ruta/completa/a/pry_mcp_trading/.venv/bin/python",
"args": [
"/ruta/completa/a/pry_mcp_trading/server.py"
],
"env": {
"PYTHONPATH": "/ruta/completa/a/pry_mcp_trading"
}
}
}
}
Security and maintenance notes
Never expose API keys or secrets in code or logs. Use a secure environment management strategy and rotate keys periodically. Keep dependencies up to date and monitor API usage to avoid rate limits.
Troubleshooting tips
If you encounter connection or runtime issues, verify the virtual environment is activated, check that the Python path is correct, and confirm API keys are loaded in the environment. Use the test connection script to validate API accessibility and inspect any error messages returned by the MCP server for clues.
Notes on tools and usage patterns
The server provides organized access to 12 MCP tools across four groups: market data, technical indicators, news sentiment, and trading signals. You can request single indicators, combined indicator sets, or signals that weight technical and fundamental analyses to yield actionable guidance.
Examples of common queries
Current price for a ticker: "What is the current price of AAPL?" Historical data: "Show TSLA historical data for the last 3 months" RSI value: "What is the current RSI for GOOGL?" Sentiment signal: "What do the latest news say about AMD?" Hybrid signal: "Generate a hybrid trading signal for Bitcoin".
Project structure overview
The codebase is organized to separate concerns: market data, indicators, news analysis, and signals. This makes it straightforward to extend with new sources or indicators while keeping the MCP server interface stable.
Available tools
get_current_price
Obtains the current price for a stock or forex pair.
get_historical_data
Fetches OHLCV historical data with multiple intervals (1min to monthly).
get_quote_info
Returns price, fundamentals, and company information.
calculate_trend_indicators
Computes 8 trend indicators including SMA, EMA, MACD, ADX, AROON, PSAR, SUPERTREND, DEMA.
calculate_momentum_indicators
Computes 8 momentum indicators including RSI, STOCHASTIC, CCI, WILLR, ROC, MFI, TSI, MOMENTUM.
calculate_volatility_indicators
Computes 6 volatility indicators including BBANDS, ATR, KELTNER, STDDEV, DONCHIAN, ULCER.
calculate_volume_indicators
Computes 6 volume indicators including OBV, VWAP, AD, CMF, VO, PVT.
get_financial_news
Retrieves the latest financial news for a given asset.
analyze_news_sentiment
Analyzes sentiment using FinBERT with a positive/negative/neutral classification and score.
generate_technical_signal
Creates technical trading signals based on indicators (single or composite).
generate_fundamental_signal
Generates signals based on news sentiment with FinBERT.
generate_hybrid_signal
Generates signals that blend technical and fundamental analyses with configurable weights.