Docs/Mcp Server

MCP Server

Let AI agents interact with AutoLoop via the Model Context Protocol.


Overview

The AutoLoop MCP server allows AI agents (Claude, GPT, Cursor, etc.) to query and interact with the AutoLoop protocol programmatically. It exposes a set of read-only tools for free and operational/analysis tools behind x402 micropayments.

Endpoint: https://mcp.tryautoloop.com SSE: https://mcp.tryautoloop.com/sse

Free Tools (Read-Only)

These tools require no payment and return live protocol data:

ToolDescription
get_deploymentsGet contract addresses for a given network
get_loop_statusCheck a specific contract's loop status, balance, and execution count
detect_contract_typeIdentify if a contract is Standard, Hybrid VRF, or Full VRF
get_registered_loopsList all registered contracts on a network
get_gas_pricesCurrent gas prices and cost-per-tick estimates
get_controller_infoCheck if an address is a registered controller
get_contract_balanceGet a contract's deposited ETH balance
get_protocol_statsAggregate stats (total contracts, total executions, etc.)

Example: Check a Contract

Ask any MCP-compatible AI agent:

"Check the status of contract 0x1234... on Sepolia using AutoLoop"

The agent will call get_loop_status and return registration status, balance, last execution time, and whether the loop is currently ready.

Operational and analysis tools use x402 micropayments. Payment is gasless — your agent signs an EIP-3009 authorization for USDC on Base.

Operational Tools ($0.10 USDC base)

ToolDescription
generate_registration_txGenerate a ready-to-sign registration transaction
estimate_session_costEstimate total cost for a game session (duration, tick rate, mode)
generate_integration_guideGet a customized integration guide based on your use case

Analysis Tools ($0.25 USDC base)

ToolDescription
audit_loop_configAnalyze a registered contract's configuration for issues
analyze_loop_historyReview execution history, gas trends, and failure patterns
analyze_vrf_frequencyFor Hybrid VRF contracts, analyze VRF usage patterns and cost optimization

Prices scale dynamically with ETH/USD to keep real costs stable.

Configuration

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "autoloop": {
      "url": "https://mcp.tryautoloop.com/sse"
    }
  }
}

Cursor

Add to your .cursor/mcp.json:

{
  "mcpServers": {
    "autoloop": {
      "url": "https://mcp.tryautoloop.com/sse"
    }
  }
}

Claude Code

Add to your .claude/settings.json or project settings:

{
  "mcpServers": {
    "autoloop": {
      "url": "https://mcp.tryautoloop.com/sse"
    }
  }
}

Payment Flow

For paid tools, the x402 flow works automatically:

  1. Agent calls a paid tool
  2. Server returns a 402 Payment Required response with a payment request
  3. Agent's x402 client signs an EIP-3009 USDC authorization (gasless)
  4. Agent retries the request with the signed payment header
  5. Server verifies payment and returns the result

This requires the agent to have access to a Coinbase CDP wallet or compatible x402 payment facilitator with USDC on Base.

Self-Hosting

The MCP server is open-source. To run your own:

git clone https://github.com/LuckyMachines/autoloop-mcp.git
cd autoloop-mcp
npm install
cp .env-example .env
# Edit .env with your RPC URLs and optional CDP credentials
npm start

Required environment variables:

VariableRequiredDescription
RPC_URL_MAINNETYesEthereum mainnet RPC
RPC_URL_SEPOLIAYesSepolia testnet RPC
PORTNoServer port (default: 3001)
CDP_API_KEYFor paid toolsCoinbase CDP API key
CDP_API_SECRETFor paid toolsCoinbase CDP API secret

Use Cases

  • AI game designers can query cost estimates and generate integration code
  • Monitoring bots can check contract health and balance alerts
  • Developer assistants can audit configurations and suggest optimizations
  • Automated pipelines can register and fund contracts programmatically