PSX MCP
by moiz-imran
README.md
# PSX MCP — Cloudflare Workers
Real-time Pakistan Stock Exchange data for Claude — market summaries, stock quotes, history, sector breakdowns, and more.
---
## Quick Start (no setup needed)
A live instance is already running. Just add it to Claude Desktop:
1. Open **Claude Desktop**
2. Click **+** → **Connectors** → **Add custom connector**
3. Name: `PSX`
4. URL: `https://psx-mcp.moizwasti.workers.dev/mcp`
5. Click **Add**
Done. Now ask Claude things like:
- "What's the KSE-100 at right now?"
- "Give me OGDC's latest price"
- "Show LUCK's last 30 days of history"
- "Search for cement companies on PSX"
- "How are the banking and energy sectors doing?"
---
## Self-host (optional)
### Prerequisites
- Node.js 18+
- A free Cloudflare account → https://dash.cloudflare.com/sign-up
### Install dependencies
```bash
npm install
```
### Login to Cloudflare
```bash
npx wrangler login
```
This opens your browser — log in and authorize Wrangler.
### Deploy
```bash
npm run deploy
```
Wrangler will output something like:
```
✅ Deployed to: https://psx-mcp.YOUR-ACCOUNT.workers.dev
```
Your MCP endpoint is: `https://psx-mcp.YOUR-ACCOUNT.workers.dev/mcp`
---
## Tools
| Tool | What it does |
|------|-------------|
| `psx_market_summary` | All index values + daily change (KSE-100, KSE-30, KMI-30...) |
| `psx_stock_quote` | Latest EOD price for any ticker |
| `psx_stock_history` | OHLCV history, up to 365 trading days |
| `psx_search_stocks` | Search companies by name or ticker |
| `psx_sector_summary` | Sector-wise performance breakdown |
---
## Data & Disclaimer
Data from `dps.psx.com.pk` — PSX's own public data portal.
End-of-day only (not real-time intraday).
For personal/educational use. Not financial advice.