MAIN MCP
MAIN MCP 서버
Base의 MAIN DEX를 위한 MCP(Model Context Protocol) 서버입니다. AI 에이전트(Claude, Cursor 등)가 프로토콜과 상호작용할 수 있는 도구(토큰 스왑, 유동성 관리, ALM 전략 진입/종료 등)를 제공합니다.
Claude에 연결하기
Claude Code:
claude mcp add main-mcp --transport http https://api.main.exchange/mcpMCP 프로토콜
이 서버는 Streamable HTTP 전송을 통해 MCP spec 2025-03-26을 구현합니다.
# 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 결제
일부 도구는 x402 프로토콜을 통한 USDC 결제가 필요합니다. 결제가 필요한 도구가 결제 없이 호출되면, 서버는 결제 요구 사항(금액, 수신자, 네트워크)이 포함된 JSON-RPC 오류를 반환합니다. x402 호환 클라이언트는 이를 자동으로 처리합니다.
유료 도구: createPool, launchToken
도구
토큰
getTokens — 거래량 기준으로 정렬된 프로토콜 내 모든 토큰을 가져옵니다.
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 — ERC20 승인 트랜잭션을 준비합니다.
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 (x402를 통한 유료) — MAIN에서 새로운 ERC-20 토큰을 출시합니다. TokenFactory.createToken을 위한 calldata를 반환합니다. 로고와 배너는 사전에 IPFS에 업로드되어야 합니다(도구 설명의 IPFS 업로드 엔드포인트 참조). 모든 토큰 데이터는 생성 후 변경할 수 없습니다.
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'거래
getPrice — 스왑 견적을 가져옵니다: 주어진 tokenIn 양에 대해 얼마만큼의 tokenOut을 받을 수 있는지 확인합니다.
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 — SwapRouter를 통한 실행을 위해 calldata가 포함된 전체 스왑 견적을 가져옵니다.
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'풀
getPools — TVL, 거래량 및 수수료가 포함된 유동성 풀을 가져옵니다.
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 — 풀 APR을 가져옵니다(모든 풀 또는 특정 풀).
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 — Algebra 풀에 유동성을 추가하기 위한 트랜잭션을 준비합니다.
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'removeLiquidityToPool — 유동성을 제거하기 위한 트랜잭션을 준비합니다.
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 (x402를 통한 유료) — MAIN에서 새로운 CLMM 풀을 생성하고 초기화합니다. 토큰을 순서에 상관없이 입력받으며 사람이 읽을 수 있는 가격을 사용합니다. 이 도구는 온체인에서 토큰 소수점을 가져오고, 토큰을 정렬하고, sqrtPriceX96을 계산하며, 풀이 이미 존재하는지 확인합니다.
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'포지션
getPositions — 주소에 대한 모든 오픈 유동성 포지션을 가져옵니다.
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'스마트 월렛
ALM 전략은 사용자별로 배포된 결정론적 프록시 컨트랙트인 스마트 월렛을 통해 실행됩니다. 스마트 월렛은 전략에 진입하기 전에 온체인에 존재해야 합니다.
deploySmartWallet — 사용자를 위한 스마트 월렛을 배포합니다. 전략 도구를 사용하기 전에 한 번 호출해야 합니다. 트랜잭션은 사용자의 EOA에서 직접 전송되어야 합니다(팩토리는 msg.sender를 배포 솔트로 사용합니다).
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'전략
getStrategies — 지표와 함께 사용 가능한 ALM 전략을 가져옵니다.
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 — ALM 전략 내 사용자의 포지션을 가져옵니다.
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 — ALM 전략에 진입합니다. 스마트 월렛을 위한 calldata를 반환합니다. 배포된 스마트 월렛이 필요합니다(먼저 deploySmartWallet 사용).
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 — ALM 전략에서 종료합니다. 배포된 스마트 월렛이 필요합니다.
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 — ALM 전략 내 포지션을 늘립니다. 배포된 스마트 월렛이 필요합니다.
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'브로드캐스트
broadcastTx — 서명된 트랜잭션을 블록체인에 브로드캐스트합니다.
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