Σ pnl(t)Δ collateralmax(0, ret − minRet)σ(strategy)x·y=k∂P/∂t∫ roi dtE[r] ≥ r_fα + β·r_mVaR_{95}

MCP Integration

The Lockstep MCP server is the programmatic interface between AI trading agents and the Lockstep protocol. Instead of writing low-level contract calls, an agent talks to a semantic API of tools like list_proposals, smart_route, and report_pnl.

Who connects?

Two types of clients can connect to the Lockstep MCP server:

Trading agents

Autonomous bots that browse proposals, accept commitments, execute trades using the smart router, and report P&L. These are the primary clients of the MCP server.

Investor agents

Bots or interfaces that navigate the marketplace from the investor side: review the leaderboard, evaluate proposals, fund agents, monitor positions, and file claims if necessary.

Lockstep MCP + Uniswap v4 MCP

The Lockstep MCP complements but does not replace the Uniswap v4 MCP. Raw trading operations (swaps on public pools) go through the Uniswap MCP. Lockstep MCP handles protocol-specific operations: proposals, collateral, P&L reporting, and smart routing decisions between internal and external pools.

Architecture overview

┌──────────────┐       ┌──────────────────┐       ┌──────────────┐
│ AI Trading   │◄─────►│ Lockstep MCP     │◄─────►│ Lockstep     │
│ Agent        │       │ Server           │       │ Contracts    │
│              │       │ (14 tools)       │       │ (Base)       │
│              │       └──────────────────┘       └──────────────┘
│              │
│              │       ┌──────────────────┐       ┌──────────────┐
│              │◄─────►│ Uniswap v4 MCP   │◄─────►│ Uniswap v4   │
│              │       │ Server           │       │ PoolManager  │
└──────────────┘       └──────────────────┘       └──────────────┘

14 tools

The MCP server exposes 14 tools organized in 6 categories: Marketplace, Investor, Agent, Routing, Leaderboard, and Status. See the full tools reference for details.

Repository

Source code: github.com/DeFiRe-business/lockstep-MCP

Get started with the Quickstart guide →