MAIN MCP
MAIN MCP Server
MCP (Model Context Protocol) Server für die MAIN DEX auf Base. Bietet KI-Agenten (Claude, Cursor, etc.) Tools zur Interaktion mit dem Protokoll: Token tauschen, Liquidität verwalten, ALM-Strategien beitreten/verlassen und mehr.
Verbindung zu Claude
Claude Code:
claude mcp add main-mcp --transport http https://api.main.exchange/mcpMCP-Protokoll
Der Server implementiert die MCP-Spezifikation 2025-03-26 über Streamable HTTP-Transport.
# Initialize
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}'
# List tools
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \
| jq '.result.tools[] | {name, description}'
# Health
curl https://api.main.exchange/mcp/healthx402-Zahlungen
Einige Tools erfordern eine USDC-Zahlung über das x402-Protokoll. Wenn ein kostenpflichtiges Tool ohne Zahlung aufgerufen wird, antwortet der Server mit einem JSON-RPC-Fehler, der die Zahlungsanforderungen (Betrag, Empfänger, Netzwerk) enthält. x402-kompatible Clients handhaben dies automatisch.
Kostenpflichtige Tools: createPool, launchToken
Tools
Token
getTokens — Alle Token im Protokoll abrufen, sortiert nach Handelsvolumen.
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"getTokens","arguments":{}}}' \
| jq '.result.content[0].text | fromjson'approveTokens — Eine ERC20-Genehmigungstransaktion vorbereiten.
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"approveTokens","arguments":{"tokenAddress":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","spenderAddress":"0x002E67c3F7BF96eB3aA4066073923e415581d385"}}}' \
| jq '.result.content[0].text | fromjson'launchToken (kostenpflichtig via x402) — Einen neuen ERC-20-Token auf MAIN starten. Gibt Calldata für TokenFactory.createToken zurück. Logo und Banner müssen zuvor auf IPFS hochgeladen werden (siehe IPFS-Upload-Endpunkt in der Tool-Beschreibung). Alle Token-Daten sind nach der Erstellung unveränderlich.
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"launchToken","arguments":{"name":"My Token","symbol":"MTK","totalSupply":"10000000","logo":"bafkreibgxsqxrkrha3oqoatypp4gpuemft47ablrgxkfucqn2rvhsdwaka","description":"A cool token","website":"https://example.com"}}}' \
| jq '.result.content[0].text | fromjson'Handel
getPrice — Ein Tauschangebot abrufen: wie viel tokenOut für einen bestimmten Betrag an tokenIn.
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"getPrice","arguments":{"amount":"1000000000000000000","tokenIn":"0x4200000000000000000000000000000000000006","tokenOut":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}}}' \
| jq '.result.content[0].text | fromjson'quoteSwap — Ein vollständiges Tauschangebot mit Calldata für die Ausführung über SwapRouter abrufen.
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"quoteSwap","arguments":{"amountIn":"1000000","tokenIn":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","tokenOut":"0x4200000000000000000000000000000000000006","recipient":"0xYOUR_ADDRESS"}}}' \
| jq '.result.content[0].text | fromjson'Pools
getPools — Liquiditätspools mit TVL, Volumen und Gebühren abrufen.
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"getPools","arguments":{}}}' \
| jq '.result.content[0].text | fromjson'getPoolAPR — Pool-APR abrufen (alle Pools oder ein spezifischer).
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"getPoolAPR","arguments":{}}}' \
| jq '.result.content[0].text | fromjson'addLiquidityToPool — Eine Transaktion vorbereiten, um Liquidität zu einem Algebra-Pool hinzuzufügen.
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"addLiquidityToPool","arguments":{"poolAddress":"0xPOOL","amount0":"1000000000000000000","amount1":"1000000","userAddress":"0xYOUR_ADDRESS"}}}' \
| jq '.result.content[0].text | fromjson'removeLiquidityFromPool — Eine Transaktion vorbereiten, um Liquidität zu entfernen.
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"removeLiquidityFromPool","arguments":{"tokenId":"123","percentage":100,"userAddress":"0xYOUR_ADDRESS"}}}' \
| jq '.result.content[0].text | fromjson'createPool (kostenpflichtig via x402) — Einen neuen CLMM-Pool auf MAIN erstellen und initialisieren. Akzeptiert Token in beliebiger Reihenfolge und einen menschenlesbaren Preis. Das Tool ruft die Token-Dezimalstellen on-chain ab, sortiert die Token, berechnet sqrtPriceX96 und prüft, ob der Pool noch nicht existiert.
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"createPool","arguments":{"tokenA":"0xTOKEN_A","tokenB":"0xTOKEN_B","price":"0.1"}}}' \
| jq '.result.content[0].text | fromjson'Positionen
getPositions — Alle offenen Liquiditätspositionen für eine Adresse abrufen.
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"getPositions","arguments":{"userAddress":"0xYOUR_ADDRESS"}}}' \
| jq '.result.content[0].text | fromjson'Smart Wallet
ALM-Strategien werden über ein Smart Wallet ausgeführt — einen deterministischen Proxy-Vertrag, der pro Benutzer bereitgestellt wird. Das Smart Wallet muss on-chain existieren, bevor eine Strategie begonnen werden kann.
deploySmartWallet — Ein Smart Wallet für den Benutzer bereitstellen. Muss einmal aufgerufen werden, bevor Strategie-Tools verwendet werden. Die Transaktion muss direkt vom EOA des Benutzers gesendet werden (die Factory verwendet msg.sender als Deployment-Salt).
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"deploySmartWallet","arguments":{"userAddress":"0xYOUR_ADDRESS"}}}' \
| jq '.result.content[0].text | fromjson'Strategien
getStrategies — Verfügbare ALM-Strategien mit Metriken abrufen.
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"getStrategies","arguments":{}}}' \
| jq '.result.content[0].text | fromjson'getStrategyPositions — Benutzerpositionen in ALM-Strategien abrufen.
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"getStrategyPositions","arguments":{"userAddress":"0xYOUR_ADDRESS"}}}' \
| jq '.result.content[0].text | fromjson'enterToStrategy — Einer ALM-Strategie beitreten. Gibt Calldata für das Smart Wallet zurück. Erfordert ein bereitgestelltes Smart Wallet (zuerst deploySmartWallet verwenden).
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"enterToStrategy","arguments":{"strategyId":"alm-v1","amount0":"500000","amount1":"0","userAddress":"0xYOUR_ADDRESS","duration":86400,"stopLoss":10,"takeProfit":25}}}' \
| jq '.result.content[0].text | fromjson'exitFromStrategy — Eine ALM-Strategie verlassen. Erfordert ein bereitgestelltes Smart Wallet.
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"exitFromStrategy","arguments":{"strategyId":"alm-v1","positionId":"5","percentage":10000,"userAddress":"0xYOUR_ADDRESS"}}}' \
| jq '.result.content[0].text | fromjson'increaseStrategy — Eine Position in einer ALM-Strategie erhöhen. Erfordert ein bereitgestelltes Smart Wallet.
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"increaseStrategy","arguments":{"strategyId":"alm-v1","positionId":"5","amount0":"500000","amount1":"0","userAddress":"0xYOUR_ADDRESS"}}}' \
| jq '.result.content[0].text | fromjson'Broadcast
broadcastTx — Eine signierte Transaktion an die Blockchain senden.
curl -s -X POST https://api.main.exchange/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"broadcastTx","arguments":{"signedTxHex":"0xSIGNED_TX"}}}' \
| jq '.result.content[0].text | fromjson'This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/asdener123/MAIN-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server