Crypto MCP — Fullstack
Simple crypto data viewer with FastAPI backend and React + Vite frontend. Fetch ticker data via REST and stream updates over WebSocket.
Prerequisites
- Windows PowerShell
- Python 3.13+ (virtual env located at
backend/.venv) - Node.js 18+ and npm
Backend — Step by Step
- Open PowerShell and go to backend directory:
powershell cd backend - Activate virtual environment:
powershell .\.venv\Scripts\Activate.ps1 - Install dependencies:
powershell python -m pip install -r .\requirements.txt - Run the API server on port 8001:
powershell .\.venv\Scripts\python.exe -m uvicorn app.main:app --host 127.0.0.1 --port 8001 - Verify the server responds and CORS works:
powershell Invoke-WebRequest -Uri http://127.0.0.1:8001/api/ping -Method GET -Headers @{Origin='http://localhost:5173'}
Frontend — Step by Step
- Open a new PowerShell and go to frontend directory:
powershell cd frontend - Install dependencies:
powershell npm install - Set backend host/port for the frontend and start Vite on a fixed port:
powershell $env:VITE_API_HOST='127.0.0.1' $env:VITE_API_PORT=8001 npm run dev -- --host --port 5173 --strictPort - Open the app:
- http://localhost:5173/
Using the App
- Enter
exchange(e.g.,binance) andsymbol(e.g.,BTC/USDT). - Click
Fetch Tickerfor REST data (/api/ticker/{exchange}/{symbol}). - Click
Connect WSto subscribe to live updates (/api/ws/subscribe/{exchange}/{symbol}).
Tips
- If a port is busy, free it and retry:
powershell Get-NetTCPConnection -LocalPort 5173 | Select LocalAddress,LocalPort,State,OwningProcess Get-Process -Id <PID> | Select Id, ProcessName, Path Stop-Process -Id <PID> -Force - Backend also works on port 8000. If you use 8000, set:
powershell $env:VITE_API_PORT=8000 - Symbols with slashes like
BTC/USDTare supported by backend routes.
