MCP Server: Security Performance Report [NEW]
MCP Server for multi-security performance report. Provides Web reports and CSV files
MCP Server: Security Performance Report
Professional FastAPI and MCP server for comprehensive portfolio reporting using dual methodology: custom performance calculations validated against QuantStats combined with FFN library analytics, delivering beautiful HTML reports and CSV exports.
- Talk to AI Agent (NextJS)
- Suite
- Custom GPT
- Agent (React + Adv. Analysis)
- Agent (Flowise UI)
- Excel (xlwings Lite)
What It Does
A portfolio reporting tool using dual calculation methodology, combining custom performance calculations with FFN library analytics. Features FastAPI endpoints, Model Context Protocol (MCP) integration, and a clean web interface:
- Dual methodology approach: custom calculations for core metrics + FFN library for comprehensive analytics
- Core performance metrics (Total Return, CAGR, Sharpe, Sortino) use custom implementations based on QuantStats methodology
- Additional analytics (drawdowns, monthly returns, statistical analysis) powered by FFN library
- Selective validation carried out against QuantStats for key performance metrics
- Professional HTML reports with TIGZIG AI branding and matplotlib visualizations
- Exports multiple CSV files with detailed data for further analysis
Detailed Methodology & Validation: SPR vs QuantStats Comparison Complete methodology documentation, calculation details, and validation results comparing SPR with QuantStats implementations.
How to Use
- Available Endpoints
- Base URL:
https://ffn.hosting.tigzig.com/
- MCP Endpoint:
https://ffn.hosting.tigzig.com/mcp
- API Endpoint:
https://ffn.hosting.tigzig.com/analyze
- Base URL:
- Access Methods
- Web Interface: Visit
/
for clean web form. - Direct API: Make HTTP POST requests to
/analyze
with parameters:symbols
,start_date
,end_date
,risk_free_rate
. - MCP/LLM: Connect to
/mcp
using any MCP-compatible client.
- Web Interface: Visit
How It Works
- Dual Calculation Methodology: Core Performance Metrics: Custom implementations based on QuantStats methodology for Total Return, CAGR, Sharpe, and Sortino ratios. Additional Analytics: FFN library for drawdown analysis, monthly returns, and statistical metrics. Historical price data sourced from Yahoo Finance with preprocessing applied including removal of zero/NaN values and date alignment.
- Validation & Accuracy: Selective validation against QuantStats library shows: Perfect matches for Total Return (100%) and CAGR (100%), near-perfect matches for Sharpe (97%+) and Sortino (97%+) ratios. The 3% variance is attributed to data quality filters and precision differences.
- Integration & Output: FastAPI backend with efficient dual-methodology processing. Professional HTML reports with matplotlib charts and TIGZIG AI branding. 6 different CSV files: price data, returns, correlations, and statistics. MCP protocol integration for AI/LLM interactions.
How to Replicate
- Repository & Setup: Clone the repository
shared-fastap-mcp-ffn
. Create virtual environment and install dependencies. Configure environment variables. Run the FastAPI server with uvicorn. - Key Dependencies: Custom calculation engine, FFN Library, FastAPI, yfinance, fastapi-mcp.
- Documentation: Detailed methodology, calculations, and validation results are documented in the GitHub repository README and the SPR vs QuantStats methodology comparison.
Resources
- MCP Server: SPR Portfolio (GitHub)
- SPR vs QuantStats Methodology
- API Docs: SPR Server
- FFN Library (GitHub)
- FastAPI-MCP Package (GitHub)
Fine Print: This is for informational purposes only and should not be considered as investment advice. This implementation uses a dual methodology approach. For complete methodology documentation, validation results, and detailed explanations of any variations, please refer to the SPR vs QuantStats methodology comparison and the linked GitHub repository. Always validate outputs.