# ๐ฑ Currency Converter - Quick Start
## ๐ Get Started in 2 Steps
### Step 1: Start the Server
```bash
./start-currency.sh
```
### Step 2: Open Browser
```
http://localhost:3001
```
**That's it!** ๐ No API key required!
---
## ๐ก How It Works
1. **Auto-loads** on page open
2. **Calls** `window.openai.callTool('convertCurrency', { from: 'USD', to: 'EUR', amount: 100 })`
3. **Displays** real-time conversion results
4. **Updates** as you type or change currencies
---
## ๐ฏ Features
- โ
Convert between 160+ currencies
- โ
Real-time exchange rates
- โ
Auto-convert as you type
- โ
Popular currency pair shortcuts
- โ
Live exchange rates table
- โ
Beautiful dark mode UI
- โ
Responsive mobile design
- โ
No API key required (free tier)
---
## ๐ Usage Examples
### Basic Conversion
1. Select **From** currency (e.g., USD)
2. Enter **Amount** (e.g., 100)
3. Select **To** currency (e.g., EUR)
4. See instant result!
### Quick Conversions
Click any popular pair button:
- **USD โ EUR**
- **EUR โ USD**
- **GBP โ USD**
- **USD โ JPY**
### Swap Currencies
Click the **๐ Swap** button to reverse the conversion
---
## ๐ Example API Calls
### JavaScript (in ChatGPT app)
```javascript
// Convert 100 USD to EUR
const result = await window.openai.callTool('convertCurrency', {
from: 'USD',
to: 'EUR',
amount: 100
});
console.log(result);
// { from: 'USD', to: 'EUR', amount: 100, result: 92.50, rate: 0.925, ... }
```
### cURL
```bash
curl -X POST http://localhost:3001/mcp/tools/call \
-H "Content-Type: application/json" \
-d '{
"name": "convertCurrency",
"arguments": { "from": "USD", "to": "EUR", "amount": 100 }
}'
```
---
## ๐ Expose with ngrok
**Terminal 1** (Keep running):
```bash
./start-currency.sh
```
**Terminal 2**:
```bash
ngrok http 3001
```
You'll get a public URL like: `https://abc123.ngrok.io`
---
## ๐ Free vs Paid API
### Free Tier (Default - No Key Required)
- โ
1500 requests/month
- โ
160+ currencies
- โ
Real-time rates
- โ
No registration needed
### Unlimited (Optional API Key)
- โ
Unlimited requests
- โ
Higher reliability
- โ
Priority support
**To upgrade:**
1. Get free key: https://www.exchangerate-api.com/
2. Set it: `export EXCHANGE_RATE_API_KEY=your_key`
3. Restart server
---
## ๐ฑ Supported Currencies
Major currencies include:
- ๐บ๐ธ USD - US Dollar
- ๐ช๐บ EUR - Euro
- ๐ฌ๐ง GBP - British Pound
- ๐ฏ๐ต JPY - Japanese Yen
- ๐ฆ๐บ AUD - Australian Dollar
- ๐จ๐ฆ CAD - Canadian Dollar
- ๐จ๐ญ CHF - Swiss Franc
- ๐จ๐ณ CNY - Chinese Yuan
- ๐ฎ๐ณ INR - Indian Rupee
- And 150+ more!
---
## ๐จ UI Features
- **Dark Mode**: Beautiful gradient theme
- **Live Updates**: Auto-refresh every 60 seconds
- **Smooth Animations**: Anime.js transitions
- **Responsive**: Works on all devices
- **Color Coding**: Success green for results
---
## ๐ง Troubleshooting
**Port 3001 already in use?**
```bash
PORT=3002 ./start-currency.sh
```
**Dependencies missing?**
```bash
npm install
npm run build
./start-currency.sh
```
**Rate limit exceeded?**
- Get a free API key (unlimited)
- Or wait for the monthly reset
---
## ๐ Learn More
- **Full Documentation**: See `CURRENCY_README.md`
- **API Details**: https://www.exchangerate-api.com/docs
- **MCP SDK**: https://modelcontextprotocol.io/
---
**Happy Converting! ๐ฑ**