FinRLExtention is a powerful financial analysis and report generation platform that leverages the Model Context Protocol (MCP) and multiple AI backends (Gemini, Claude, Perplexity) to provide deep stock research, interactive charts, and professionally formatted PDF reports.
- Deep Stock Research: Integrated with Perplexity AI for real-time market data and comprehensive equity research.
- Dynamic Chart Generation: Automated creation of technical and fundamental charts using Matplotlib.
- AI-Powered Formatting: Professional HTML/PDF report generation using Claude for high-quality layout and styling.
- MCP Architecture: Modular design using Model Context Protocol (MCP) to separate research, charting, and formatting services.
- Interactive Web UI: Modern React-based frontend for chatting with the AI and previewing generated reports.
- Automated PDF Export: Pixel-perfect PDF conversion using Playwright.
FinRLExtention/
├── config/ # Configuration files
│ ├── config.yml # Main API keys and model settings (User created)
│ └── mcpservers.yml # MCP server definitions
├── reports/ # Generated HTML and PDF reports
├── src/
│ ├── backend/ # FastAPI backend and MCP client
│ │ ├── app.py # Main FastAPI application
│ │ ├── generate_report.py # CLI tool for report generation
│ │ ├── mcp_client.py # Gemini-based MCP client
│ │ └── mcp_servers/ # Specialized MCP services
│ │ ├── mcp_research/ # Perplexity-based research
│ │ ├── mcp_chart_generation/ # Matplotlib charting
│ │ └── mcp_formatting/ # Claude-based HTML formatting
│ └── frontend/ # React + Vite frontend
│ ├── public/ # Images for frontend
│ └── src/
│ ├── App.css # Static styles for the frontend
│ ├── App.jsx # Loads the frontend
│ ├── Frontend.jsx # Frontend functionality
│ ├── index.css # Basic page styles
│ ├── main.jsx # Where the frontend runs from
│ └── PdfPreviewOverlay.jsx # PDF preview overlay styles and functionality
├── requirements.txt # Python dependencies
└── README.md
- Python 3.10+
- Node.js & npm (for frontend)
- API Keys for:
- Google Gemini (Main Orchestrator)
- Anthropic Claude (Formatting)
- Perplexity (Research)
-
Clone the repository:
git clone <repository-url> cd FinRLExtention
-
Set up the Python environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Install Playwright Browsers:
playwright install chromium
-
Set up the Frontend:
cd src/frontend npm install cd ../..
-
Create a
config/config.ymlfile based on the following structure:gemini: api_key: "YOUR_GOOGLE_API_KEY" model: "gemini-2.5-flash" temperature: 0.7 claude: api_key: "YOUR_ANTHROPIC_API_KEY" model: "claude-4-6-sonnet" temperature: 0.7 perplexity: api_key: "YOUR_PERPLEXITY_API_KEY" model: "sonar" temperature: 0.7
-
Verify
config/mcpservers.ymlpoints to the correct server paths.
From the project root:
python -m uvicorn src.backend.app:app --reload --port 8000In a new terminal:
cd src/frontend
npm run devThe frontend will typically be available at http://localhost:5173.