Skip to main content

MCP Server

Model Context Protocol (MCP) server for Achswap V2 DEX on ARC Testnet. Connect any AI agent to Achswap for token swaps, liquidity management, and pool data.

Overview

The Achswap MCP server allows AI agents to interact with the Achswap DEX through natural language. Execute swaps, manage liquidity, check pool reserves, and more.

Features

  • Wallet: Generate wallets, get addresses, check balances
  • Pool Data: Get reserves, swap quotes
  • Swap: Token swaps (exact in/out, native/ERC20)
  • Liquidity: Add/remove V2 liquidity positions

API Endpoint

https://api.achswapfi.xyz/mcp

Configuration

Claude Code

{
"mcpServers": {
"achswap": {
"url": "https://api.achswapfi.xyz/mcp/message",
"headers": {
"X-Private-Key": "0xYOUR_PRIVATE_KEY"
}
}
}
}

Cline

{
"mcpServers": {
"achswap": {
"url": "https://api.achswapfi.xyz/mcp/message",
"headers": {
"X-Private-Key": "0xYOUR_PRIVATE_KEY"
}
}
}
}

OpenCode

{
"mcp": {
"achswap": {
"type": "remote",
"url": "https://api.achswapfi.xyz/mcp",
"headers": {
"X-Private-Key": "0xYOUR_PRIVATE_KEY"
},
"enabled": true
}
}
}

cURL

curl -X POST https://api.achswapfi.xyz/mcp/message \
-H "Content-Type: application/json" \
-H "X-Private-Key: 0xYOUR_PRIVATE_KEY" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_swap_quote","arguments":{"amount_in":"1000000000000000000","token_in":"USDC","token_out":"ACHS"}}}'

Available Tools

Wallet

ToolDescription
generate_walletGenerate a new random wallet
get_wallet_addressGet the wallet address
get_wallet_infoGet wallet address (alias)
get_native_balanceGet native USDC balance
get_token_balanceGet ERC20 token balance
get_all_token_balancesGet all token balances
check_rpc_statusVerify RPC connection

Transfers

ToolDescription
transfer_nativeTransfer native USDC
transfer_tokenTransfer ERC20 tokens
wrap_nativeWrap native USDC → wUSDC
unwrap_wusdcUnwrap wUSDC → native USDC

Pool Data

ToolDescription
get_pool_reservesGet V2 pool reserves
check_pair_existsCheck if pool exists
get_add_liquidity_ratioCalculate liquidity ratio
get_swap_quoteGet swap quote (output for input)
get_swap_quote_reverseGet required input for desired output

Swaps

ToolDescription
approve_tokenApprove router to spend token
swap_exact_tokens_for_tokensSwap token → token
swap_exact_eth_for_tokensSwap native → token
swap_exact_tokens_for_ethSwap token → native

Liquidity

ToolDescription
add_liquidityAdd token + token liquidity
add_liquidity_ethAdd native + token liquidity
remove_liquidityRemove liquidity to tokens
remove_liquidity_ethRemove liquidity to native
get_liquidity_positionGet LP balance in pool

Approvals

ToolDescription
get_allowanceCheck router allowance
approve_tokenApprove token for trading

Token Addresses (ARC Testnet)

TokenAddress
Native USDC0x0000000000000000000000000000000000000000
wUSDC0xDe5DB9049a8dd344dC1B7Bbb098f9da60930A6dA
ACHS0x45Bb5425f293bdd209c894364C462421FF5FfA48

Contract Addresses

ContractAddress
V2 Factory0x7cC023C7184810B84657D55c1943eBfF8603B72B
V2 Router0xB92428D440c335546b69138F7fAF689F5ba8D436

RPC

  • ARC Testnet RPC: https://rpc.testnet.arc.network
  • Chain ID: 5042002

Examples

Check RPC Status

tools/call: check_rpc_status

Get Wallet Address

tools/call: get_wallet_address

Get Swap Quote (1 USDC to ACHS)

tools/call: get_swap_quote
Arguments: {
"amount_in": "1000000000000000000",
"token_in": "USDC",
"token_out": "ACHS"
}

Add Liquidity

tools/call: add_liquidity
Arguments: {
"token_a": "USDC",
"token_b": "ACHS",
"amount_a_desired": "1000000000000000000",
"amount_b_desired": "100000000000000000000"
}