Paloma DEX MCP Server
A Model Context Protocol server that enables AI agents to autonomously execute cross-chain trading operations on Paloma DEX across seven EVM chains including Ethereum, Arbitrum, and Polygon.
README
Paloma DEX MCP Server
A Model Context Protocol (MCP) server that enables AI agents to autonomously trade on Paloma DEX across 7 EVM chains.
Overview
This MCP server provides AI agents with tools to perform decentralized trading operations on Paloma DEX, supporting cross-chain functionality across Ethereum, Arbitrum, Optimism, Base, BSC, Polygon, and Gnosis chains. The server prioritizes automation over security by enabling autonomous transaction execution through environment-based private key management.
Features
Core Trading Tools
buy_token: Purchase ETF tokens or PUSD using any input tokensell_token: Sell ETF tokens or PUSD back to other tokensget_balance: Check token balances across all 7 supported chainsget_price: Get current token prices
Chain Support
Supports all 7 EVM chains used by Paloma DEX:
- Ethereum Mainnet (Chain ID: 1)
- Arbitrum One (Chain ID: 42161)
- Optimism (Chain ID: 10)
- Base (Chain ID: 8453)
- BNB Smart Chain (Chain ID: 56)
- Polygon (Chain ID: 137)
- Gnosis (Chain ID: 100)
Key Capabilities
- Autonomous Trading: AI agents can execute transactions independently
- Cross-Chain Support: Works across all Paloma DEX supported chains
- Gas Management: Handles gas estimation and protocol fees automatically
- Token Approvals: Automatic approval handling for ERC20 tokens
- Error Handling: Comprehensive transaction error management
- Contract Integration: Ready integration with PUSD and ETF connector contracts
Installation
-
Clone the repository:
git clone https://github.com/Cieloc/mcpPADEX.git cd mcpPADEX -
Install dependencies using uv:
uv sync
Configuration
-
Set up environment variables:
cp .env.example .env -
Configure your
.envfile with the following required variables:# REQUIRED: Your private key for transaction signing # WARNING: Keep this secure and never commit to version control PRIVATE_KEY=your_private_key_here # Contract addresses for each chain (obtain from Paloma DEX) PUSD_TOKEN_ETH= PUSD_CONNECTOR_ETH= ETF_CONNECTOR_ETH= # ... (repeat for all chains) # Optional: Moralis API key for enhanced features MORALIS_SERVICE_API_KEY=your_moralis_api_key_here -
Obtain contract addresses from Paloma DEX documentation or team for:
- PUSD token addresses
- PUSD connector addresses
- ETF connector addresses
Usage
Running the Server
uv run python main.py
The server will start and listen for MCP protocol messages via stdin/stdout.
Tool Examples
Buy Tokens
{
"tool": "buy_token",
"arguments": {
"chain_id": "1",
"input_token_address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"output_token_address": "0x...",
"input_amount": "100.0",
"slippage": 2.0
}
}
Sell Tokens
{
"tool": "sell_token",
"arguments": {
"chain_id": "1",
"token_address": "0x...",
"amount": "50.0"
}
}
Check Balances
{
"tool": "get_balance",
"arguments": {
"chain_id": "1"
}
}
Get Prices
{
"tool": "get_price",
"arguments": {
"chain_id": "1",
"token_address": "0x..."
}
}
Architecture
Core Components
padex.py: Main MCP server implementation with all trading toolsmain.py: Entry point that launches the MCP server- Contract ABIs: Simplified ABIs for PUSD and ETF connector interactions
- Chain Configuration: Complete configuration for all 7 supported chains
Security Considerations
⚠️ Important Security Notes:
- This implementation prioritizes automation over security
- Private keys are stored in environment variables for autonomous operation
- Ensure your
.envfile is never committed to version control - Consider using more secure key management for production use
- The
.gitignorefile excludes.envby default
Dependencies
- web3: Ethereum blockchain interaction
- eth-account: Private key and transaction signing
- eth-abi: ABI encoding for contract calls
- httpx: HTTP client for API interactions
- mcp: Model Context Protocol implementation
- python-dotenv: Environment variable management
API Integrations
The server integrates with:
- Paloma DEX API: For ETF data and custom pricing
- Moralis API: For balance and price data (optional)
- Uniswap Protocol: For swap path generation and routing
Development
Project Structure
mcpPADEX/
├── padex.py # Main MCP server implementation
├── main.py # Entry point
├── pyproject.toml # Project dependencies
├── .env.example # Environment variable template
├── .gitignore # Git ignore rules
└── README.md # This file
Adding New Features
The server is designed to be extensible. To add new tools:
- Define the tool in the
handle_list_tools()method - Implement the tool handler in
handle_call_tool() - Add the corresponding async method to the
PalomaDEXServerclass
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is open source. Please check the license file for details.
Disclaimer
This software is provided "as is" without warranty. Trading cryptocurrencies involves risk of loss. Use at your own risk and ensure you understand the implications of automated trading before deployment.
Support
For questions about Paloma DEX integration, consult the Paloma DEX documentation or reach out to the Paloma team.
For MCP-related questions, see the Model Context Protocol documentation.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。