Enables sending instant price alert notifications via Telegram bot messages when cryptocurrency price conditions are met on Deribit exchange
Deribit MCP Server
A Model Context Protocol (MCP) server that integrates with the Deribit cryptocurrency exchange, providing real-time price monitoring and intelligent alerts through Claude Desktop.
π± Multiple Messaging Options Available:
This README: Telegram integration (with text messages AND phone calls with TTS)
Signal Integration: Signal Messenger integration (privacy-focused, text messages only)
Both can run simultaneously! Choose based on your preferred messaging platform.
Overview
This MCP server enables Claude to monitor cryptocurrency prices on Deribit and send you instant Telegram notifications when price conditions are met. Set alerts for BTC, ETH, and other instruments using natural language in Claude Desktop.
Key Capabilities:
π Smart Price Alerts: Set alerts using conditions like "above", "below", "crosses above/below", or "percentage change"
π± Telegram Notifications: Receive instant alerts on your phone via Telegram
π Real-time Data: WebSocket connections for live price feeds
πΌ Account Management: View balances, positions, and account summaries
π Live Monitoring: Continuous price tracking with automatic alert triggering
Quick Start
Install dependencies:
python3 -m venv venv && source venv/bin/activate pip3 install -e .Get Telegram credentials:
Create a bot: Message @BotFather, send
/newbotGet chat ID: Message @userinfobot
Optional - For Phone Call Alerts:
Authorize CallMeBot: Visit https://api2.callmebot.com/txt/auth.php
Note your exact Telegram username (e.g.,
@yourname) from Settings β Edit Profile
Configure Claude Desktop: Edit
~/Library/Application Support/Claude/claude_desktop_config.json:{ "mcpServers": { "deribit": { "command": "/path/to/mcp-server/venv/bin/python", "args": ["-m", "src.server"], "cwd": "/path/to/mcp-server", "env": { "DERIBIT_TEST_MODE": "true", "TELEGRAM_BOT_TOKEN": "your_bot_token", "TELEGRAM_CHAT_ID": "your_chat_id", "CALLMEBOT_USERNAME": "@yourname" } } } }Note:
CALLMEBOT_USERNAMEis optional - only needed for phone call alertsRestart Claude Desktop and try:
"Set an alert for BTC-PERPETUAL when it goes above $100,000"
Features
Real-time Price Monitoring: WebSocket connection for live price feeds
Price Alerts: Configurable alerts with multiple condition types
Multi-channel Notifications: Telegram messages, phone calls with text-to-speech, console, and extensible notification system
Account Management: View balances, positions, and account summary
Trading Information: Access to instruments, order books, and market data
MCP Integration: Full compatibility with Claude Desktop and other MCP clients
Installation
Prerequisites
Python 3.10 or higher
Deribit API credentials (for account operations)
Telegram Bot Token (for notifications)
Setup
Clone or navigate to the repository:
Create a virtual environment:
Install dependencies:
Configure Deribit API (optional, for account features):
Create API credentials with appropriate permissions
Note: You'll add these to your Claude Desktop config later
Configure Telegram Bot (for notifications):
a. Create a bot:
Message @BotFather on Telegram
Send
/newbotand follow the promptsSave the bot token (e.g.,
123456789:ABCdefGHIjklMNOpqrsTUVwxyz)
b. Get your Chat ID:
Message @userinfobot on Telegram
It will reply with your user info including your chat ID
Or send a message to your bot, then visit:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdatesLook for
"chat":{"id":123456789}in the response
c. Save credentials:
You'll add these to your Claude Desktop config in the next step
Configure CallMeBot (optional, for phone call alerts):
a. Authorize CallMeBot (choose one method):
Method 1 - Web Authorization (Recommended):
Log in with your Telegram account
Click "Authorize" to grant permissions
You'll see a success page with a test URL
Method 2 - Telegram Bot:
Message @CallMeBot_API on Telegram (note: use @CallMeBot_API, not @CallMeBot_txtbot)
Send
/startto authorize your accountWait for confirmation message
b. Get your Telegram username:
Your username is in the format
@yourname(visible in Telegram Settings β Edit Profile)Make sure to use the EXACT username shown in your Telegram profile
Alternatively, you can use your phone number in international format (e.g.,
+1234567890)
c. Add to config:
Add
CALLMEBOT_USERNAMEto your Claude Desktop config (see next section)Use the exact username from your Telegram profile (case-sensitive)
You can also customize the voice language with
CALLMEBOT_DEFAULT_LANG(default:en-US-Standard-B)
Configuration
For Local Testing (Optional)
If you want to run the server directly (not through Claude Desktop), create a .env file:
Edit .env with your settings:
Note: The .env file is only used for local development/testing. For Claude Desktop integration, you must include these values in the claude_desktop_config.json file (see next section).
Usage
Running the Server
Direct execution:
With uv:
Claude Desktop Integration
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Important: When using Claude Desktop, you must include ALL environment variables (including Telegram credentials) in the env section, as the .env file is not automatically loaded.
Note:
Use the full path to your virtual environment's Python executable
Include Telegram credentials directly in the config for notifications to work
Set
DERIBIT_TEST_MODEtofalsefor production tradingOptionally add
DERIBIT_API_KEYandDERIBIT_API_SECRETto theenvsection for account features
Available Tools
set_price_alert
Create a price alert for an instrument.
Parameters:
instrument: Trading instrument (e.g., "BTC-PERPETUAL")condition: Alert type - "above", "below", "crosses_above", "crosses_below", "percentage_change"threshold: Price level or percentagenotification_channel: "telegram" (text message), "telegram_call" (phone call with TTS), or "console"message: Custom alert message (optional)repeat: Re-trigger after cooldown (default: false)
Examples:
remove_alert
Remove an existing alert.
Parameters:
alert_id: Alert ID to remove
list_alerts
List all configured alerts with optional filtering.
Parameters:
instrument: Filter by instrument (optional)status: Filter by status (optional)
get_current_price
Get the current price for an instrument.
Parameters:
instrument: Trading instrument
get_instruments
List available trading instruments.
Parameters:
currency: Currency code (default: "BTC")kind: "future", "option", or "spot"
get_account_summary
View account balance and equity.
Parameters:
currency: Currency code (default: "BTC")
get_positions
List all open positions.
Parameters:
currency: Currency code (default: "BTC")
Resources
deribit://price/{instrument}
Real-time price data for an instrument.
deribit://alerts
JSON list of all configured alerts.
deribit://account/{currency}
Account summary information.
Alert Conditions
above: Triggers when price goes above threshold
below: Triggers when price goes below threshold
crosses_above: Triggers when price crosses up through threshold
crosses_below: Triggers when price crosses down through threshold
percentage_change: Triggers on percentage change from last check
Example Use Cases
Basic Price Monitoring
Phone Call Alert
Crossing Alert
Percentage Change
Check Current Price
View Alerts
Account Management
Development
Project Structure
Running Tests
Code Formatting
Security Considerations
API Credentials: Never commit
.envfile to version controlTest Mode: Use
DERIBIT_TEST_MODE=truefor testingPermissions: Limit Deribit API permissions to minimum required
Notifications: Secure your Telegram bot token
Troubleshooting
Connection Issues
If WebSocket connection fails:
Check internet connectivity
Verify Deribit API status
Try test environment first (
DERIBIT_TEST_MODE=true)
Authentication Errors
If API authentication fails:
Verify API key and secret
Check API key permissions on Deribit
Ensure credentials are in
.envfile
Telegram Notifications
If notifications don't arrive:
Check environment variables in Claude Desktop config:
Most common issue: Telegram credentials not in
claude_desktop_config.jsonThe
.envfile is NOT read by Claude DesktopYou MUST add
TELEGRAM_BOT_TOKENandTELEGRAM_CHAT_IDto theenvsection of your config
Verify credentials:
Check bot token is correct
Check chat ID is correct (should be a number like
1950437710)Send a message to your bot first (so it knows your chat ID)
Check logs (macOS):
tail -f ~/Library/Logs/Claude/mcp-server-deribit.logLook for "Initialized Telegram notification channel" (good)
Or "Telegram credentials not found" (means env vars not set correctly)
Test notification on startup:
When the server starts, it sends a test message
If you receive this, Telegram is configured correctly
If not, check your Claude Desktop config
CallMeBot Phone Calls
If phone call alerts don't work:
Verify authorization:
Best method: Visit https://api2.callmebot.com/txt/auth.php and authorize with your Telegram account
Or send
/startto @CallMeBot_API (not @CallMeBot_txtbot)Check authorization status:
curl "http://api.callmebot.com/start.php?user=@yourname&text=test"
Check username format:
Use EXACT format
@yournamefrom Telegram Settings β Edit ProfileUsername is case-sensitive and must match exactly
Or use international phone format like
+1234567890Common mistake: using wrong username (verify in Telegram app)
Check environment variable:
Make sure
CALLMEBOT_USERNAMEis set correctly in Claude Desktop configMust match the username you authorized with CallMeBot
Restart Claude Desktop after changes
Check logs (macOS):
tail -f ~/Library/Logs/Claude/mcp-server-deribit.logLook for "Telegram call channel initialized for @yourname" (good)
Look for "Successfully initiated call to @yourname" (call was sent)
Or "CallMeBot username not configured" (means env var not set)
Or "HTTP Request: GET http://api.callmebot.com/start.php" (shows API call)
Test with a simple alert:
Try: "Set a telegram_call alert for BTC-PERPETUAL above $1"
This should trigger immediately if price is above $1
Check logs to see if "Successfully initiated call" appears
Note: There's a known issue with audio playback on iOS Telegram app. Android and Desktop work better.
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
License
MIT License - see LICENSE file for details
Support
For issues and questions:
Check the MCP documentation
Review Deribit API docs
Open an issue on GitHub
Acknowledgments
Built with FastMCP
Integrates with Deribit Exchange
Notifications via python-telegram-bot
This server cannot be installed