π Python Upgrade Guide for FastMCP
π Python Upgrade Guide for FastMCP
This guide walks you through upgrading Python to 3.12 for full FastMCP support.
π¦ Step 1: Install Python 3.12 (In Progress)
brew install python@3.12
Status: Currently installingβ¦
π Step 2: Set Up Python 3.12 (After installation)
After the installation completes, run these commands:
# Add Python 3.12 to your PATH
echo 'export PATH="/opt/homebrew/opt/python@3.12/bin:$PATH"' >> ~/.zshrc
# Reload your shell configuration
source ~/.zshrc
# Create an alias for easier access
echo 'alias python3.12="/opt/homebrew/opt/python@3.12/bin/python3.12"' >> ~/.zshrc
echo 'alias pip3.12="/opt/homebrew/opt/python@3.12/bin/pip3.12"' >> ~/.zshrc
# Reload again
source ~/.zshrc
# Verify the new Python version
python3.12 --version
π¦ Step 3: Install FastMCP and Dependencies
# Install FastMCP with Python 3.12
pip3.12 install fastmcp httpx pydantic pydantic-settings python-dotenv
# Verify installation
python3.12 -c "import fastmcp; print('FastMCP version:', fastmcp.__version__)"
π§ Step 4: Update Claude Desktop Config
Replace your claude_desktop_config.json
with:
{
"mcpServers": {
"luno": {
"command": "/opt/homebrew/opt/python@3.12/bin/python3.12",
"args": [
"/Users/aman-asmuei/Documents/mcp/mcp-luno/src/luno_mcp_server/server.py"
],
"cwd": "/Users/aman-asmuei/Documents/mcp/mcp-luno",
"env": {
"LUNO_API_KEY": "your_api_key_here",
"LUNO_API_SECRET": "your_api_secret_here"
}
}
}
}
Key change: Using the full path to Python 3.12
β Step 5: Test the Full FastMCP Implementation
After setup, youβll have access to:
All 7 Luno Tools:
get_crypto_price
- Real-time prices for any pairget_market_overview
- Market dataget_account_balance
- Real account balancesplace_order
- Place tradescancel_order
- Cancel ordersget_order_status
- Order statusget_transaction_history
- Transaction historyget_fees
- Trading fees
Real API Integration:
- Live data from Luno API
- All currency pairs (ZAR, EUR, GBP, USD)
- Proper async/await handling
- Production-ready error handling
π§ͺ Test Commands
After upgrade, test with:
# Test the FastMCP server directly
cd /Users/aman-asmuei/Documents/mcp/mcp-luno
python3.12 src/luno_mcp_server/server.py
# Test imports
python3.12 -c "
from src.luno_mcp_server.server import mcp
print('β
FastMCP server loaded')
print(f'β
Tools available: {len(mcp._tools)}')
for tool in mcp._tools:
print(f' - {tool}')
"
π Alternative: Use Python 3.12 as Default
If you want to make Python 3.12 your default:
# Create symlinks (optional)
ln -sf /opt/homebrew/opt/python@3.12/bin/python3.12 /opt/homebrew/bin/python3
ln -sf /opt/homebrew/opt/python@3.12/bin/pip3.12 /opt/homebrew/bin/pip3
# Update your Claude config to just use "python3"
π― Benefits of Python 3.12 + FastMCP
β
Latest FastMCP features - All newest capabilities
β
Better performance - Python 3.12 is faster
β
Real async support - Proper async/await handling
β
Production ready - Stable, mature implementation
β
Full Luno integration - All 7 tools working perfectly
β
Multi-currency support - All trading pairs
π¨ Backup Plan
If anything goes wrong, you can always fall back to the Python 3.9 compatible version:
{
"mcpServers": {
"luno": {
"command": "python3",
"args": [
"/Users/aman-asmuei/Documents/mcp/mcp-luno/src/sync_working_server.py"
],
"cwd": "/Users/aman-asmuei/Documents/mcp/mcp-luno",
"env": {
"LUNO_API_KEY": "your_api_key_here",
"LUNO_API_SECRET": "your_api_secret_here"
}
}
}
}
Next: Wait for Python installation to complete, then follow Step 2!