lotero-mcp
Provably fair on-chain slot machine: x402 spins in USDC on Base, Chainlink VRF results, winnings claimed to the human's wallet. Ships an enforced session spin limit as a responsible-gambling guardrail.
README
š° Lotero
A Provably Fair Casino for AI Agents
A provably fair, on-chain slot machine with Chainlink VRF 2.5. Designed for autonomous agents: clients pay in USDC via x402, execution is gasless.
Overview
Lotero lets users (or AI agents) bet USDC and win prizes when three matching symbols appear on the reels. The game uses Chainlink VRF 2.5 for provably fair randomness.
- RTP ~93% ā DOCS/RTP_MODEL.md
- Max win: 30Ć ā Bet 1 USDC, win up to 30 USDC (three BTC)
- Symbols ā DOGE 5Ć, BNB 14Ć, ETH 20Ć, BTC 30Ć
- Referral ā 1% commission on referred players' bets
- Dev fee ā 5% of each bet to the team
ā ļø Frontend in development ā The web app in
packages/frontendis incomplete. The contracts and agent are production-ready.
Smart Contract
SlotMachineV2 (Base mainnet)
| Item | Value |
|---|---|
| Address | 0xC4b88e90a73fA9ec588E504255A43d4Ccb82edE9 |
| Token | USDC. Bet 1 USDC, win up to 30 USDC. |
| VRF | Chainlink VRF 2.5 |
| Events | SpinRequested, SpinResolved |
Core functions
playFor(player, referringUserAddress, amountToPlay)ā Pay on behalf of another address; theplayerreceives the round, wins, and stats.claimPlayerEarnings(userAddress)ā Claim winnings and referral earnings.isResolved(requestId)ā Check if a round has been resolved.
Agents
Lotero Agent
Stateless HTTP API that sells spins and claims as a service. Clients pay via x402 (1.1 USDC spin, 0.1 USDC claim); the agent relays playFor and claimPlayerEarnings onchain. Two-agent system: Lotero Agent (Express API) + Ops Agent (external cron calling GET /cron/health). See packages/agent/README.md.
POST /spinWith1USDCā Paid (x402). Execute spin forplayer.POST /claimā Paid (x402). Claim player earnings (gasless).GET /round?requestId=...,GET /player/:address/balances,GET /contract/healthā Read-only.GET /cron/healthā Ops Agent: system status, may execute transfers and Telegram alerts.
yarn agent # Start agent
yarn agent:dev # Dev with watch
Documentation: DOCS/AGENT_FLOWS.md | DOCS/AGENT_API.md
For AI agents:
-
MCP server (
lotero-mcpon npm, listed on the official Model Context Protocol registry asio.github.csacanam/lotero): exposes 5 MCP tools over stdio āspin(paid via x402),get_round,get_balances,claimandget_contract_healthā built with the official MCP TypeScript SDK (@modelcontextprotocol/sdk), with an enforced session spin limit as a responsible-gambling guardrail. Install:claude mcp add lotero -- npx -y lotero-mcpSee
mcp/README.mdfor configuration and tool reference. -
Agent skill:
npx skills add csacanam/lotero-core(or read it at lotero.xyz/skill.md) ā wallet setup, x402 spin/poll/claim flow, payouts, budget guardrails. -
LLM index: lotero.xyz/llms.txt.
Project Structure
packages/
āāā agent/ # Lotero Agent ā x402 + onchain relay
āāā contracts/ # Smart contracts, tests, deploy scripts
ā āāā contracts/ SlotMachine.sol, SlotMachineV2.sol
ā āāā deploy/
ā āāā test/
āāā frontend/ # Web app (in development)
Documentation
| Doc | Description |
|---|---|
| DOCS/AGENT_FLOWS.md | Flow diagrams (cron health, spin, claim) |
| DOCS/AGENT_API.md | API reference, endpoints, env, constants |
| DOCS/DEPLOY_BASE.md | Deploy contracts to Base |
| DOCS/RTP_MODEL.md | RTP math and reel layout |
Requirements
Quick Start
1. Install dependencies
git clone https://github.com/csacanam/lotero-core.git
cd lotero-core
yarn install
2. Run local chain
yarn chain
3. Deploy contracts (new terminal)
yarn deploy
4. Run tests
yarn contracts:test
5. Start the frontend (optional, in development)
yarn start
App runs at http://localhost:3000.
Production
For Base mainnet: see DOCS/DEPLOY_BASE.md. Contract address above. Fund the VRF subscription with LINK.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.