Skip to content

Agent API (MCP)

Every HookKit endpoint is also an MCP tool. The hosted server at https://api.hookkit.dev/mcp speaks MCP over streamable HTTP (JSON-RPC over POST, JSON responses, no sessions). No API key.

For editor setup (Cursor, Claude Code, Windsurf), see Use with Cursor and Claude Code.

Tool REST equivalent Arguments
decode_hook GET /v1/hooks/:address/flags address
inspect_hook GET /v1/hooks/:address address
list_hooks GET /v1/hooks sort?, limit?, offset?
mine_hook_salt POST /v1/hooks/mine flags, initCodeHash or initCode, deployer?, startSalt?, maxIterations?
list_pools GET /v1/pools hook?, token?, hooked?, limit?, offset?
get_pool GET /v1/pools/:poolId, POST /v1/pools/state poolId or key fields
compute_pool_id POST /v1/pools/id currency0, currency1, fee, tickSpacing, hooks?
quote POST /v1/quote poolId or key, tokenIn or zeroForOne, amount, exactOut?, hookData?
build_swap POST /v1/swap/build poolId or key, tokenIn, amount, sender, slippageBps?, hookData?
get_stats GET /v1/stats none

Tool results are the same JSON as the REST API, returned as a text content block. Errors come back as a result with isError: true and the error message.

  • “Is the hook on pool 0x641d…eddc safe to swap through? What can it do?”
  • “List the 10 most used hooks on Robinhood Chain and flag any that can take over swap pricing.”
  • “Mine a salt for a hook with beforeSwap and afterSwap, init code hash 0x…”
  • “Quote 0.01 ETH to USDG on the 0.05% pool, then build the swap for my wallet 0x…”

Raw JSON-RPC, if you are writing your own client:

Terminal window
curl -X POST https://api.hookkit.dev/mcp \
-H "content-type: application/json" \
-H "accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"decode_hook","arguments":{"address":"0x4e3468951D49f2EEa976eD0D6e75fFCb44a9a544"}}}'
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{
"type": "text",
"text": "{\n \"address\": \"0x4e3468951D49f2EEa976eD0D6e75fFCb44a9a544\",\n \"flags\": 9540,\n \"flagsHex\": \"0x2544\",\n ..."
}
]
}
}

Supported methods: initialize, ping, tools/list, tools/call. Batched requests (a JSON array) are accepted. GET (SSE) is not supported.

build_swap returns unsigned transactions. The agent must sign them with a wallet it controls; HookKit has no way to move funds. A good agent workflow is: get_pool or inspect_hook to check the hook, quote to show the user the expected output, then build_swap and ask for confirmation before signing.