anicarrr/conflux-mcp-server
If you are the rightful owner of conflux-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Conflux MCP Server is a Model Context Protocol server designed for seamless interaction with the Conflux blockchain, supporting both HTTP/SSE and STDIO transport modes.
🌊 Conflux MCP Server
Model Context Protocol (MCP) server for Conflux blockchain operations
A powerful MCP server that enables AI assistants to interact with the Conflux blockchain. Supports both HTTP/SSE and STDIO transport modes for seamless integration with Cursor IDE, Claude Desktop, and any MCP-compatible client.
✨ Features
- 🔗 Universal MCP Support - Works with Cursor IDE, Claude Desktop, and any MCP client
- 🔐 Client-Side Security - Private keys provided by clients, never stored on server
- 🌐 Multi-Network - Supports Conflux mainnet and testnet
- 🛠️ 27 Blockchain Tools - Complete toolkit for Conflux operations
- 🐳 Docker Ready - Production-ready containerization
- 📡 Real-time - Server-Sent Events for live communication
🚀 Quick Start
One-Command Setup
Mac/Linux:
./start.sh
Windows:
.\start.ps1
🎯 This single command does everything: setup, build, and run automatically!
Manual Setup
# Install dependencies
bun install
# Build the project
bun run build
bun run build:http
# Start the server
bun run start:http
Docker Setup
# Build and run with Docker
docker-compose up -d
# Or run directly
docker run -d --name conflux-mcp-server -p 3333:3333 conflux-mcp-server:latest
🔧 MCP Client Configuration Examples
Docker - stdio
{
"mcpServers": {
"conflux-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e", "MCP_MODE=stdio",
"conflux-mcp-server:latest"
],
"env": {
"PRIVATE_KEY": "0x..."
}
}
}
}
HTTP - sse
{
"mcpServers": {
"conflux-mcp-server": {
"url": "http://localhost:3333/sse",
"headers": {
"X-Private-Key": "0x..."
}
}
}
}
🛠️ Available Tools
Network Operations
get_supported_networks- List available networksget_chain_info- Get chain ID, block number, RPC infoget_chain_id- Get current chain ID
Balance Operations
get_balance- Get native Conflux balanceget_erc20_balance- Get ERC20 token balanceget_erc721_balance- Get NFT balanceget_erc1155_balance- Get ERC1155 token balance
Transaction Operations
transfer_conflux- Transfer Conflux tokenstransfer_erc20- Transfer ERC20 tokenstransfer_erc721- Transfer NFTstransfer_erc1155- Transfer ERC1155 tokens
Block & Transaction Data
get_latest_block- Get latest block infoget_block_by_number- Get specific blockget_transaction- Get transaction detailsget_transaction_receipt- Get transaction receipt
Smart Contracts
read_contract- Call view/pure contract functionswrite_contract- Execute state-changing contract functionsis_contract- Check if address is contract
Gas & Fees
estimate_gas- Estimate transaction gas
Advanced
get_address_from_private_key- Derive address from key
🌐 Supported Networks
| Network | Chain ID | Description |
|---|---|---|
conflux | 1030 | Conflux Mainnet |
conflux-testnet | 71 | Conflux Testnet |
🔐 Security Model
Private Key Management
- ✅ Client-Side: Private keys provided by MCP client
- ✅ Per-Request: Each request includes the private key securely
- ✅ No Server Storage: Server doesn't store private keys
- ✅ Multi-Client: Different clients can use different keys
🐳 Docker Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
PORT | Server port | 3333 |
HOST | Bind address | 0.0.0.0 |
NODE_ENV | Environment | production |
LOG_LEVEL | Logging level | info |
Health Check
# Test server health
curl http://localhost:3333/health
📊 Server Endpoints
GET /sse- Server-Sent Events endpointPOST /messages- MCP message handlingGET /health- Health check endpoint
🧪 Testing
# Run tests
bun test
# Test network connectivity
curl http://localhost:3333/health
📚 Examples
Get Supported Networks
const networks = await client.call("get_supported_networks");
// Returns: ["conflux", "conflux-testnet"]
Check Balance
const balance = await client.call("get_balance", {
address: "0x...",
network: "conflux-testnet"
});
// Returns: { address, network, wei, cfx }
Send Transaction
const result = await client.call("transfer_native", {
to: "0x...",
amount: "0.01",
network: "conflux-testnet"
});
// Returns: { transactionHash, to, amount, network, status }
🤝 Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the file for details.
🆘 Support
- Issues: GitHub Issues
- Health Check:
curl http://localhost:3333/health - Documentation: See
docs/directory
Ready to use Conflux blockchain operations in any MCP client! 🚀