Trading MCP Server
Provides AI-powered news analysis and social sentiment analysis, including market impact assessment and sentiment scoring.
Enables discovery of trending stocks and AI-driven sentiment analysis of retail investor discussions from subreddits.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Trading MCP Server analyze AAPL comprehensive stock analysis"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Trading MCP Server
A comprehensive Model Context Protocol (MCP) server for stock analysis and trading insights. This server provides advanced stock screening, fundamental analysis, insider trading data, social media sentiment, and news analysis capabilities.
π¬ Demo
https://github.com/user-attachments/assets/71995014-7cbb-48fa-80fb-f1f6d22fc91c
See the Trading MCP Server in action - from stock screening to comprehensive analysis
Related MCP server: Financial Modeling Prep (FMP) MCP Server
π MCP Configuration
Add this to your MCP configuration file (typically ~/.cursor/mcp.json or your IDE's MCP settings):
{
"mcpServers": {
"trading-mcp": {
"command": "node",
"args": ["/path/to/trading-mcp/dist/server.js"],
"env": {
"OPENAI_API_KEY": "sk-your-openai-api-key-here",
"REDDIT_CLIENT_ID": "your-reddit-client-id",
"REDDIT_CLIENT_SECRET": "your-reddit-client-secret",
"REDDIT_USERNAME": "your-reddit-username",
"REDDIT_PASSWORD": "your-reddit-password"
}
}
}
}π Features
π Stock Screening: Technical pattern recognition and advanced multi-criteria filtering
π Fundamental Analysis: Comprehensive metrics, valuation comparison, and AI health scoring
π’ Insider Trading: Real-time insider activity tracking and sentiment analysis
π Options Analysis: Put/call ratio data and options market sentiment analysis
π Social Media Research: Reddit integration with AI-powered sentiment analysis
π° News Analysis: AI-curated news with market impact assessment
π― Comprehensive Analysis: All-in-one stock analysis combining multiple data sources
π Available Tools
Note:
OpenAI API key is required for news analysis and social sentiment analysis
Reddit credentials are required for social media research features
Stock Screening Tools
screen_stocks_advanced_filters
Advanced stock screening using Finviz filters with support for technical patterns, fundamental criteria, and multi-parameter filtering. Returns stocks matching specific criteria with key metrics.
Parameters:
filters(object): Finviz format filters. Use "f" for basic filters, "o" for ordering. Example:{"f": "cap_large,fa_pe_profitable,ta_pattern_channeldown", "o": "marketcap"}limit(number, default: 50): Maximum results to return
Fundamental Analysis Tools
get_fundamental_stock_metrics
Retrieves comprehensive financial metrics including P/E ratios, PEG, ROE, debt ratios, growth rates, and profitability margins.
Parameters:
ticker(string, required): Stock ticker symbolmetrics(array, optional): Specific metrics to retrieve (returns all if not specified)
compare_stock_valuations
Compares valuation metrics across multiple stocks to identify relative value opportunities. Perfect for peer analysis and sector comparisons.
Parameters:
tickers(array, required): Stock ticker symbols to comparemetrics(array, default: ['pe', 'forwardPE', 'peg', 'priceToBook']): Valuation metrics to compare
calculate_financial_health_score
Calculates a comprehensive financial health score (0-100) based on profitability, liquidity, leverage, efficiency, and growth metrics with customizable weightings.
Parameters:
ticker(string, required): Stock ticker symbolweights(object, optional): Custom weights for health factorsprofitability(default: 0.3),liquidity(default: 0.2),leverage(default: 0.2),efficiency(default: 0.15),growth(default: 0.15)
Insider Trading Tools
analyze_insider_activity
Monitors insider transactions and analyzes sentiment patterns. Returns transaction history with sentiment analysis and confidence scores.
Parameters:
ticker(string, required): Stock ticker symbollimit(number, default: 10): Maximum transactions to returntransaction_types(array, optional): Filter by transaction typesanalysis_period(number, default: 90): Analysis period in daysmin_transaction_value(number, default: 10000): Minimum transaction value threshold
Options Analysis Tools
get_put_call_ratio
Retrieves put/call ratio data from Barchart to assess options market sentiment. Returns ratios by expiration with sentiment analysis.
Parameters:
ticker(string, required): Stock ticker symbol
Comprehensive Analysis Tools
comprehensive_stock_analysis
All-in-one stock analysis combining fundamental metrics, financial health scoring, insider analysis, options sentiment, news analysis, and social sentiment when configured.
Parameters:
ticker(string, required): Stock ticker symbol to analyze
Social Media Research Tools
Requires Reddit API configuration
discover_trending_stocks
Identifies stocks gaining attention across Reddit investing communities. Returns trending tickers with mention frequency and engagement metrics.
Parameters:
subreddits(array, default: ['wallstreetbets', 'stocks']): Subreddits to analyzelimit(number, default: 20): Maximum trending tickers to return
analyze_reddit_sentiment
Requires both Reddit and OpenAI APIs
Searches Reddit discussions and uses AI to analyze retail investor sentiment. Returns posts with sentiment analysis and confidence scores.
Parameters:
ticker(string, required): Stock ticker symbolsubreddits(array, default: ['stocks', 'wallstreetbets', 'investing', 'ValueInvesting']): Subreddits to searchtime_filter(string, default: 'week'): Time period ('hour', 'day', 'week', 'month', 'year')limit(number, default: 25): Maximum posts to retrievesort(string, default: 'hot'): Sort order ('relevance', 'hot', 'top', 'new')max_posts_for_sentiment(number, default: 50): Posts to use for sentiment analysisinclude_comments(boolean, default: false): Include comments from specific postpost_id_for_comments(string, optional): Post ID for comment retrievalcomment_limit(number, default: 100): Maximum comments if including comments
News Analysis Tools
Requires OpenAI API configuration
analyze_news_and_market_context
Combines news sentiment analysis, market impact assessment, and sector context analysis. Returns analyzed articles with sentiment scores and market predictions.
Parameters:
ticker(string, required): Stock ticker symboldays_back(number, default: 7): Days to look back for newsmax_articles(number, default: 10): Maximum articles to analyzeinclude_sentiment(boolean, default: true): Include sentiment analysissector(string, optional): Stock sector for enhanced contextnews_items(array, optional): Specific headlines to analyze
π οΈ Installation & Setup
Installation
Clone and install dependencies:
git clone <repository-url>
cd trading-mcp
npm installBuild the project:
npm run buildConfigure in your MCP client: Add the MCP configuration shown above to your MCP client settings with your API credentials.
π§ Configuration
Required APIs
OpenAI: Required for news analysis and social sentiment analysis
Reddit: Required for social media research features
Getting API Keys
OpenAI API Key
Visit OpenAI API
Create an account or sign in
Generate a new API key
Add to your MCP configuration as
OPENAI_API_KEY
Reddit API Credentials
Visit Reddit App Preferences
Click "Create App" or "Create Another App"
Choose "script" as the app type
Use a dummy redirect URI such as
http://localhost:8080Note your
client_idandclient_secretAdd your Reddit credentials to your MCP configuration
ποΈ Architecture
trading-mcp/
βββ src/
β βββ server.ts # Main MCP server
β βββ config.ts # Configuration management
β βββ types/ # TypeScript interfaces
β β βββ index.ts
β βββ adapters/ # External API adapters
β β βββ finviz.ts # Finviz web scraping
β β βββ barchart.ts # Barchart options data scraping
β β βββ reddit.ts # Reddit API integration
β β βββ openai.ts # OpenAI API integration
β βββ tools/ # Tool implementations
β βββ screening.ts # Stock screening tools
β βββ fundamentals.ts # Fundamental analysis
β βββ insider.ts # Insider trading analysis
β βββ options.ts # Options analysis tools
β βββ social.ts # Social media research
β βββ news.ts # News analysis
β βββ comprehensive.ts # Comprehensive analysis
βββ dist/ # Compiled JavaScript
βββ package.json
βββ tsconfig.json
βββ README.mdπ Known Issues
Finviz web scraping may occasionally fail due to rate limiting or site changes
Barchart web scraping may occasionally fail due to site changes or rate limiting
Reddit API has rate limits that may affect high-volume usage
OpenAI API usage incurs costs based on tokens consumed
π Example Usage
Once configured, you can use the tools through your MCP-enabled client:
# Screen for stocks with specific technical patterns
Use screen_stocks_advanced_filters with filters: {"f": "ta_pattern_channeldown,cap_large,geo_usa"}
# Get comprehensive fundamental analysis
Use get_fundamental_stock_metrics for "AAPL" to see detailed financial data
# Compare multiple stocks
Use compare_stock_valuations for ["AAPL", "MSFT", "GOOGL"] to compare valuations
# Calculate financial health score
Use calculate_financial_health_score for "TSLA" to get AI-powered health assessment
# Analyze insider activity
Use analyze_insider_activity for "NVDA" to see insider trading patterns and sentiment
# Get options market sentiment
Use get_put_call_ratio for "SPY" to see put/call ratios and options sentiment
# Comprehensive analysis (all-in-one)
Use comprehensive_stock_analysis for "AMZN" to get complete multi-dimensional analysis
# Analyze social sentiment (requires Reddit + OpenAI)
Use analyze_reddit_sentiment for "GME" to see Reddit community sentiment
# Get trending stocks (requires Reddit)
Use discover_trending_stocks to find stocks gaining social media momentum
# Analyze news and market context (requires OpenAI)
Use analyze_news_and_market_context for "META" to get news analysis and market contextβ οΈ Disclaimer
This software is for educational and research purposes only. It is not intended as financial advice. Always do your own research and consider consulting with a qualified financial advisor before making investment decisions.
The data provided by this server comes from third-party sources and may not always be accurate or up-to-date. Users should verify information independently before making any trading decisions.
Stock trading and investing involves risk, including the potential loss of principal. Past performance does not guarantee future results.
For questions or support, please open an issue on GitHub.
Available Tools
10 toolsanalyze_insider_activityA
Comprehensive insider trading analysis tool that monitors recent transactions and analyzes sentiment patterns. Retrieves buy/sell activity by executives, directors, and major shareholders, then evaluates trading patterns to determine overall insider confidence (bullish, bearish, neutral). Returns detailed transaction history with sentiment analysis, confidence scores, and key insights about insider motivation. Essential for identifying stocks with strong insider support or potential red flags.
Inputs: ticker (required), limit, transaction_types, analysis_period, +1 more.
analyze_news_and_market_contextA
Comprehensive news and market analysis tool that combines recent news sentiment analysis, market impact assessment, and broader sector context analysis. Use this when researching current events affecting a stock, evaluating news-driven price movements, or understanding how individual stocks fit into current market trends. Returns analyzed articles with sentiment scores, impact predictions, sector performance analysis, and macroeconomic context. Essential for making informed investment decisions based on current market conditions.
Inputs: ticker (required), days_back, max_articles, include_sentiment, +2 more.
analyze_reddit_sentimentA
Comprehensive Reddit sentiment analysis tool that searches for stock discussions across multiple investing subreddits and uses AI to analyze retail investor sentiment. Combines Reddit post search, optional comment extraction, and advanced sentiment classification to gauge community opinion and engagement. Use this when assessing retail investor sentiment, detecting sentiment shifts, or validating investment decisions against community consensus. Returns posts, sentiment analysis with confidence scores, key themes, and community engagement metrics.
Inputs: ticker (required), subreddits, time_filter, limit, +5 more.
calculate_financial_health_scoreA
Financial health analysis tool that calculates a comprehensive score based on profitability, liquidity, leverage, efficiency, and growth metrics. Use this when evaluating the overall financial strength of a company for investment decisions, risk assessment, or portfolio screening. Returns a weighted health score (0-100) with detailed breakdowns of each category, component analysis, and actionable insights. Allows custom weighting of different financial factors to match your investment strategy.
Inputs: ticker (required), weights.
compare_stock_valuationsA
Relative valuation analysis tool that compares key valuation metrics across multiple stocks to identify undervalued or overvalued opportunities. Use this when performing peer analysis, sector comparisons, or evaluating multiple investment candidates side-by-side. The tool returns a comparative analysis with P/E, PEG, Price-to-Book ratios and highlights relative value opportunities. Essential for making informed investment decisions based on relative attractiveness.
Inputs: tickers (required), metrics.
comprehensive_stock_analysisA
Ultimate comprehensive stock analysis tool that combines multiple analyses in parallel to provide a complete investment evaluation. Executes fundamental metrics, financial health scoring, insider trading analysis, put/call ratio analysis, and when configured, news analysis and Reddit sentiment analysis. Use this when you need a complete overview of a stock across all analysis dimensions for investment decision-making. Returns a formatted report with all analysis results, key insights, and investment summary.
Inputs: ticker (required).
discover_trending_stocksA
Social momentum detection tool that identifies stocks gaining significant attention and discussion volume across Reddit investing communities. Use this when looking for emerging investment opportunities, detecting viral stock movements, or identifying potential meme stock candidates before they peak. The tool returns ranked lists of trending tickers with mention frequency, sentiment indicators, and community engagement metrics. Perfect for staying ahead of retail investor trends and social media-driven market movements.
Inputs: subreddits, limit.
get_fundamental_stock_metricsA
Comprehensive fundamental analysis tool that retrieves detailed financial metrics including P/E ratios, PEG, ROE, debt ratios, growth rates, and profitability margins. Use this when conducting deep fundamental analysis of individual stocks for investment decisions or valuation assessments. The tool returns complete financial data with key ratios, growth metrics, and profitability indicators. Supports selective metric retrieval for targeted analysis.
Inputs: ticker (required), metrics.
get_put_call_ratioA
Options market analysis tool that retrieves put/call ratio data from Barchart to assess market sentiment and options flow. Use this when analyzing options market sentiment, detecting potential market reversals, or understanding institutional hedging activity. The tool returns comprehensive put/call ratios for different expiration dates, volume and open interest data, and AI-powered sentiment analysis. Higher put/call ratios typically indicate bearish sentiment, while lower ratios suggest bullish sentiment. Essential for options traders and investors looking to gauge market sentiment.
Inputs: ticker (required).
screen_stocks_advanced_filtersA
Comprehensive stock screening using Finviz filters that supports technical patterns, fundamental criteria, and multi-parameter filtering. Use this when you need to find stocks matching specific investment criteria like channel down patterns, profitable companies, or large-cap stocks. The tool returns a ranked list of stocks with key metrics including market cap, P/E ratios, and current prices. Supports complex filter combinations for advanced screening strategies using Finviz format parameters.
Inputs: filters, limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 10 tools
Each tool targets a specific analysis domain (insider, news, Reddit, fundamentals, etc.), but there is slight overlap between analyze_reddit_sentiment and discover_trending_stocks (both use Reddit), and comprehensive_stock_analysis duplicates the functionality of many individual tools. Nonetheless, the descriptions clearly differentiate their purposes.
All tools use snake_case with action verbs (analyze, calculate, compare, discover, get, screen). There is one outlier (comprehensive_stock_analysis) that uses a phrase rather than verb_noun, but the pattern is mostly consistent.
10 tools is well-scoped for a trading analysis server. Each tool provides a distinct function without being overwhelming, and the count aligns with typical MCP server sizes for this domain.
The tool set covers fundamental analysis, valuation, sentiment (news, Reddit, options), insider activity, screening, and trending detection. Missing technical analysis and risk metrics, but overall it's a robust coverage for a stock analysis server.
Maintenance
Related MCP Connectors
Production MCP server for US equity and options intelligence: real-time IV radar, Monte Carlo simulation, options pressure, strategy backtesting, AI prediction, pre-trade risk analysis, and automated stock research reports.
Official Intrinio MCP server. US stock prices, options and fundamentals for AI agents.
Official Score VI MCP server: intrinsic value, fundamentals, and a stock screener.
101The Octagon MCP server provides specialized AI-powered financial research and analysis by integrating with the Octagon Market Intelligence API. It enables users to analyze public market data (SEC filings, earnings transcripts, financial metrics, and stock data for 8000+ companies), private market data (3M+ companies, 500k+ funding rounds, 2M+ M&A/IPO transactions), and conduct deep research including web scraping capabilities. The server also features autonomous research agents that search hundreds of sources and return fully cited reports in approximately one minute.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that provides comprehensive financial insights and analysis by leveraging real-time market data, news, and advanced analytics for stocks, options, financial statements, and economic indicators.1751PythonMIT
- AlicenseBqualityDmaintenanceAn MCP server that provides comprehensive access to real-time stock quotes, financial statements, analyst estimates, and technical indicators via the Financial Modeling Prep API. It enables users to conduct in-depth financial analysis and track market performance through specialized tools, resources, and prompt templates.2647 npm1MIT
- AlicenseAqualityCmaintenanceComprehensive MCP server for real-time stock, cryptocurrency, options, and fundamental analysis, including SEC filings and insider trading data.269 npmMIT
- AlicenseAqualityCmaintenanceA free MCP server for stock research combining Finviz screening and SEC EDGAR filings, offering 24 tools for fundamental analysis, insider trades, and financial data without paid subscriptions.24MIT