Token导航 LogoToken导航TokenDH.com
Full Stack MCP Stock Analyser logo
金融服务stdio官方级别未说明来源级核验

Full Stack MCP Stock Analyser

MCP Server

一个基于AI的股票分析平台,通过FastAPI MCP服务器后端和Next.js前端,连接金融市场数据并提供智能自然语言分析,生成可下载的PDF股票报告。

工具数

2

提示词数

0

GitHub Stars

0

资源数

0
金融数据自然语言处理Python

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

anishiisc

提供方

anishiisc

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python3 -m venv venv

详细介绍

Stock Analyzer using MCP Server + AI

AI-powered stock analysis platform that connects financial market data with intelligent natural language insights using OpenAI GPT. Built with a FastAPI MCP server backend and a Next.js frontend, this system analyzes stock trends, displays financial metrics, and generates downloadable PDF stock reports with AI summaries.


⚡ Quick Start Guide

✅ Start Backend (FastAPI MCP Server)

cd stock_analyzer
python3 -m venv venv
source venv/bin/activate      # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn mcp_server.server:app --reload --port 8000

✅ Start Frontend (Next.js UI)

cd frontend
npm install
npm run dev

Now open your browser ➝ http://localhost:3000


✅ Features

FeatureDescription
Stock MetricsSMA, RSI, Returns, Volatility
Data SourceYahoo Finance (yfinance)
AI SummaryGPT-4o-mini (OpenAI)
PDF ReportAuto-generated report with chart
Frontend UIBuilt in Next.js + Tailwind CSS
MCP BackendFastAPI HTTP endpoints
Stock OptionsRELIANCE, TCS, INFY, HDFCBANK, SBIN
Time Periods3mo, 6mo, 1y, 5y

🏗️ Architecture Overview

Frontend (Next.js UI)
        │
        ▼
Backend API (FastAPI MCP Server)
  ├─ /analyze_stock
  ├─ /download_report
        │
 ┌──────┴─────────┐
 │                │
Yahoo Finance   OpenAI GPT

📦 Project Directory Structure

stock_analyzer/
├── analyzer.py                # Stock analysis logic
├── llm_reporter.py            # AI summary using GPT
├── report_pdf.py              # PDF report generator
│
├── mcp_server/
│   ├── server.py              # FastAPI backend
│   ├── templates.py           # Prompt templates
│   ├── traders.py             # Buy/Hold/Sell logic
│   ├── mcp_params.py          # Config
│
├── frontend/                  # Next.js frontend
│   ├── app/page.tsx
│   ├── components/AnalyzerForm.tsx
│   ├── package.json
│
├── reports/                   # Generated PDFs + charts
├── .env                       # Environment file

stock_analyzer/
│
├── analyzer.py
├── llm_reporter.py
├── main.py
│
├── mcp_server/
│   ├── __init__.py
│   ├── server.py               # UPDATED (adds CORS + /download_report)
│   ├── mcp_params.py
│   ├── templates.py
│   └── traders.py
│
├── report_pdf.py               # NEW (PDF generation helper)
├── reports/                    # charts + cached PDFs
│
├── requirements.txt            # ensure: fastapi, uvicorn, reportlab
├── .env
│
└── frontend/                   # NEW Next.js 14 app
    ├── package.json
    ├── next.config.js
    ├── postcss.config.js
    ├── tailwind.config.ts
    ├── tsconfig.json
    ├── app/
    │   ├── globals.css
    │   └── page.tsx
    └── components/
        └── AnalyzerForm.tsx
└── README.md

🔧 Environment Setup

Create .env file inside project root:

OPENAI_API_KEY=your_openai_api_key
DEFAULT_STOCK=RELIANCE.NS
DEFAULT_PERIOD=3mo

🔌 API Endpoints (Backend)

EndpointDescriptionMethod
/analyze_stockReturns stock metrics + AI summaryGET
/download_reportReturns PDF stock reportGET

Example request:

http://localhost:8000/analyze_stock?symbol=TCS.NS&period=6mo

📄 Sample PDF Output

✅ AI Summary ✅ Stock Chart ✅ Metrics Table ✅ Time Period ✅ Downloadable & Shareable Report

📎 *Reports are saved inside /reports*


🚀 Deployment

Deploy Backend

You can deploy the FastAPI server to:

  • Render.com
  • Railway.app
  • Azure App Service
  • AWS EC2 or Lightsail

Deploy Frontend (Recommended)

npm install -g vercel
vercel deploy

Update API URL:

NEXT_PUBLIC_API_BASE=https://your-api-url.com

🛠️ Troubleshooting

ProblemSolution
Address already in use :8000Run: lsof -i :8000 then `kill -9
`
OpenAI API errorCheck .env and billing
Chart save errorMake sure /reports folder exists
CORS error frontend-backendAllow origin in server.py
No stock dataUse .NS suffix for NSE stocks

✅ Roadmap

  • [ ] Deploy on Vercel + Render
  • [ ] Add multi-stock comparison
  • [ ] Add Bollinger Bands & MACD
  • [ ] Add database for user history
  • [ ] Add authentication
  • [ ] Host as AI microservice

👨‍💻 Author

Built by Anish Roychowdhury For AI engineering, education & financial data insights.


📜 License

MIT License – Free to use, learn & modify.


Full-Stack-MCP-Stock-Analyser

目录标签

目录标签

金融数据自然语言处理Python股票分析本地部署AI金融PDF报告FastAPINext.js

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

2

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP