Derive MCP Trading Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Derive MCP Trading Server
An MCP (Model Context Protocol) server that exposes Derive.xyz trading capabilities as tools for AI agents like Claude.
⚠️ Important Warnings
Real Money
This server places real trades with real cryptocurrency. Use at your own risk:
Start with small amounts
Test thoroughly before using larger positions
Never invest more than you can afford to lose
Geo-Restrictions
Derive.xyz may block access from certain countries, including Canada. If you receive 403 Forbidden errors, you may need to use a VPN connected to an allowed region.
Related MCP server: deribit-mcp
Setup
1. Install Dependencies
cd derive-mcp-trader
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt2. Generate a Session Key
python generate_session_key.pyThis prints a private key and address. Save the private key — you'll need it in step 4.
3. Register the Session Key on Derive
Go to app.derive.xyz
Navigate to: Home → Developers → Session Keys
Register the address from step 2 as a new session key
On the same Developers page, note the following values:
DERIVE_WALLET_ADDRESS— the address shown under "Wallet" (this is your Derive smart contract wallet, not the Signer/EOA address)DERIVE_SUBACCOUNT_ID— your subaccount ID
4. Save Credentials
python credentials.pyThis prompts for your session key, wallet address, and subaccount ID via hidden input (not logged in shell history) and saves them to a .env file with 600 permissions.
5. Run the MCP Server
source .venv/bin/activate
python server.pyClaude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"derive-trader": {
"command": "/path/to/derive-mcp-trader/.venv/bin/python",
"args": ["/path/to/derive-mcp-trader/server.py"]
}
}
}Replace /path/to/derive-mcp-trader with the actual path to this directory.
Available MCP Tools
Market Data (public, no auth)
Tool | Description |
| List available instruments by currency and type (option/perp/spot) |
| Get price, volume, and market data for an instrument |
| Get bids and asks for an instrument |
Account (authenticated)
Tool | Description |
| Show all open positions with P&L |
| Show all pending orders |
| Show collateral and balance per asset |
Trading (authenticated)
Tool | Description |
| Place a buy or sell order (limit/market) |
| Cancel a specific order by ID |
| Cancel all open orders (optionally for one instrument) |
Project Structure
derive-mcp-trader/
├── server.py # MCP server entry point
├── derive_client.py # API client (auth, signing, REST calls)
├── credentials.py # Standalone credential setup (writes .env)
├── generate_session_key.py # Generate Ethereum keypair for session key
├── requirements.txt # Python dependencies
├── README.md # This file
└── .env # Credentials (auto-created, gitignored)Security
Session Keys: Use session keys instead of your main wallet private key
Hidden Input:
credentials.pyusesgetpass— nothing logged in shell historyPermissions:
.envis created with 600 permissions (owner only)Revocation: You can revoke session keys anytime via the Derive UI
Never commit:
.envshould never be committed to version control
Troubleshooting
403 Forbidden Error
Derive.xyz may block access from certain countries. Use a VPN connected to an allowed region.
Authentication Failed
Verify your session key is correct and hasn't expired
Check that the Derive Wallet address matches your account
Ensure the session key is registered for your subaccount
Missing Credentials Error
Run python credentials.py to set up or re-enter your credentials.
Protocol Constants
If place_order fails with signing errors, the protocol constants in derive_client.py may need updating from docs.derive.xyz/reference/protocol-constants.
Resources
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
OpenFinance gives any AI agent easy trading across every major market through one hosted MCP server. Trade crypto spot and perpetuals on Hyperliquid with market, limit and TWAP orders, leverage and margin control. Trade stocks, indices, commodities, forex and pre-IPO names as Hyperliquid HIP-3 perps. Trade Polymarket prediction markets with odds, order books, positions, PnL and trader leaderboards. Swap and bridge across 40+ EVM chains and Solana with Relay and Jupiter, find memecoins across 200+ chains, launch tokens on Robinhood Chain and Solana, and buy crypto with card, bank or UPI. Write actions are designed to ask for your confirmation first. Connect with OAuth (sign in to OpenFinance and approve) or an API key. Works with Claude, ChatGPT, Cursor, VS Code, Codex and any MCP client. No install. Home: https://openfinance.tech/agents · Docs: https://docs.openfinance.tech · GitHub: https://github.com/openfinance-tech/mcp
Trade 16 crypto exchanges + MetaTrader 5 from your AI assistant via one MCP connection.
Agent MCP: 72 tools — 10 live chains, prediction & crypto trends, 17 web tools.
Agent MCP: 72 tools — 10 live chains, prediction & crypto trends, 17 web tools.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Interactive Brokers through 48 tools for market data, orders, account management, and more, via the MCP protocol.MIT
- AlicenseAqualityCmaintenanceMCP server for Deribit's crypto options exchange, enabling AI assistants to query market data, manage accounts and orders, and execute trades with safety defaults (testnet, trading disabled by default).181MIT
- FlicenseNot gradedqualityDmaintenanceEnables agents to access live crypto market data and execute risk-controlled paper trades through standardized MCP tool calls.-
- AlicenseAqualityFmaintenanceEnables AI agents to place and manage Hyperliquid trades through MCP with position, leverage, daily-loss, market, and stop-loss limits enforced outside the model, plus paper trading and an auditable decision log.9104 npmMIT