mcp

v0.16.0
@yosuku/mcp Checked 58 minutes ago Published 8 days ago

MCP server for Yosuku: bet on Bitcoin from your agent.

Bet on Bitcoin from your agent. Read the live DeepBook Predict BTC markets on Sui mainnet (real Circle USDC), the exact Pyth price they settle on and each settlement, then bet through your own wallet. Or duel another person's Claude, one on one, on a Sui allowance you cap. The server never asks for your wallet's private key. Owner-signed bets still need your approval. The optional prediction agent has its own local key and can spend real USDC only after your wallet grants it an app-bound, capped, expiring allowance. Revoking stops future spending, not orders already queued.

Summary extracted from the README.

@yosuku/mcp

Yosuku's Bitcoin markets as agent tools, for Claude Code, Codex and any MCP client.

Bet on Bitcoin from your agent. Read the live DeepBook Predict BTC markets on Sui mainnet (real Circle USDC), the exact Pyth price they settle on and each settlement, then bet through your own wallet. Or duel another person's Claude, one on one, on a Sui allowance you cap.

The server never asks for your wallet's private key. Owner-signed bets still need your approval. The optional prediction agent has its own local key and can spend real USDC only after your wallet grants it an app-bound, capped, expiring allowance. Revoking stops future spending, not orders already queued. Duels also use a separate testnet agent key.

Approve-once prediction budgets (mainnet)

The prediction contract is published on mainnet, and a funded pilot on 2026-10-26 passed the whole lifecycle: grant, over-cap refusal, agent-signed bet, fill, settlement, fee finalization, funds returned to the owner, revocation and refused spend after revocation (see prediction-agent/PILOT-2026-10-26b.md). The verified mainnet deployment is enabled by default. Bets target the quoted payout, with an 80% minimum rounded down to the venue lot size; below that minimum they are refunded. A filled order is not necessarily a win or a settled position.

Only override the defaults when retargeting a verified deployment (an empty package or registry value disables the prediction tools):

YOSUKU_PREDICTION_PACKAGE=<latest verified call-target package>
YOSUKU_PREDICTION_TYPE_PACKAGE=0xf2ef30fcf908952540c0efb5575e4c12b34df7f144e875b9f0eb56577cf8800b
YOSUKU_PREDICTION_REGISTRY=0x68e5783a5edc4085f664c54cbad3617cd0c00e1f2674513693ac28cc6232d263

The call target can change after an upgrade; the witness/type identity remains the original package.

Tool Purpose
prediction_setup Creates a dedicated local agent key and an owner-approval link. Does not approve or spend.
prediction_status Reads that machine's owner-approved prediction permission.
prediction_quote Quotes the maximum total debit, including venue fees and the 1% fee reserve.
prediction_history Reads queued, filled, refunded and settled orders, available funds and durable receipts. Labels incomplete history.
prediction_bet Agent-signs a real, capped mainnet queued bet after owner approval. Requires an explicit spending ceiling, loss acknowledgement and a unique request ID.
prediction_return Returns available funds only to the owner; can finalize a receipt's fee reserve. Works after expiry or revocation.

Both contract caps include the full fee reserve. Only 1% of confirmed filled cost is charged; refunds return the reserve, although the venue may retain its order fee. A cleaned-up queue record cannot prove a fill, so the contract conservatively returns its reserve instead of charging it. Refunded attempts still count toward the permission's conservative gross-spending budget.

The dedicated prediction account receives refunds and winnings. They are not an agent's property; prediction_return or the owner page sends available funds to the owner. Yosuku's gas station sponsors prediction transactions. If it is unavailable or refuses a request, the agent can fall back to its own SUI; without enough gas, the transaction is refused. Never fund its address with your whole USDC balance.

Keys and idempotency journals live under ~/.yosuku (or YOSUKU_HOME). Do not delete or replace an approved agent key. Reuse the same requestId on retries; uncertain requests must be checked on chain before doing anything else. No automatic prediction loop starts when the MCP starts.

Hosted connector (Grok, ChatGPT, claude.ai)

Chat apps that only take a connector URL use the hosted server in worker/ (a Cloudflare Worker). Open its root page, tap Make my link, and paste the link into the app (Grok: grok.com/connectors, New connector, Custom). It has the same tools minus duels and memory, which need a machine of their own.

Each link is a random token made in the browser. It gets its own storage (remembered wallet, bet journal) and its own prediction agent, derived as HMAC(MCP_MASTER, token), so one link can never sign for another. The agent still spends only inside the allowance the owner's wallet approves. Keep the link private, and keep a copy of MCP_MASTER: losing it orphans every link's agent (the owner can still revoke and recover funds from the permission page).

Install

Requires Node.js 22 or newer (the Sui SDK's runtime requirement).

Claude Code

claude mcp add yosuku -- npx -y @yosuku/mcp

.mcp.json (Claude Code / Cursor / Claude Desktop)

{
  "mcpServers": {
    "yosuku": { "command": "npx", "args": ["-y", "@yosuku/mcp"] }
  }
}

Codex (~/.codex/config.toml)

[mcp_servers.yosuku]
command = "npx"
args = ["-y", "@yosuku/mcp"]

DeepBook Predict (Sui mainnet, real USDC)

Tool What it does
list_markets Open BTC markets: id, close time, length (1m/5m/1h/1d/1w), minutes left. Start here.
get_spot BTC now, from the Pyth feed the markets settle on.
market_state One market by id; after the close, its settlement price.
price_history Recent prints from that feed, newest first.
bet_link For a person: prices the bet live (what a win pays, the strike, the close time) and returns a yosuku.xyz link with the stake filled in and the side marked. They connect their wallet and tap. Gas is covered; the first bet also opens their trading account. Smallest bet 1 USDC.
my_bets How their bets are doing: open, won, lost, refunded, net up or down, and the USDC in their wallet and trading account. Their address is asked once and remembered.
agent_setup A trading agent from a plan in plain words ("buy $10 of SUI every Monday, sell half if it rises 30%"): reads it back as rules and returns a link with the plan and limits filled in. They sign one Sui allowance; nothing is deposited, and they revoke it in one tap.
agent_status Whether their agent is on, paused or off, its rules, what Sui still lets it spend this week, what it holds and how many trades it made.
place_bet For an agent with its own signer: an unsigned bet for that address to sign, with the cost quoted. Gas is sponsored when available. The MCP reads the bytes before handing them over and refuses anything that is not a bet in your own account (a transfer, another account, another BuilderCode, a spend above the quote). DeepBook's smallest bet costs 1 USDC, so payouts under about 3 come back refused with the size that works.

Deposits from other chains

Fund betting from Bitcoin, Tron (USDT), XRP, NEAR, Aptos, Dogecoin and more. The person sends from any wallet or exchange to a one-time address; it lands in their own Sui wallet as USDsui (1:1 with USDC), and one tap on yosuku.xyz converts it to USDC. Bridged by Talise; there is a minimum (currently $100).

Tool What it does
deposit_networks Networks and tokens you can send from.
deposit_quote What arrives and how long it takes. Reserves nothing.
deposit_start A one-time address, the exact amount and any memo to send.
deposit_status Where the deposit is; once delivered, the link to convert it to USDC.

Duels (person to person, Sui testnet)

Two people's agents bet against each other on where BTC closes. Each person signs one Sui allowance that caps what their agent can stake per week and only lets it pay into a duel; winnings go to their own address. Settles on the same Pyth price DeepBook Predict uses.

Tool What it does
duel_setup A link to approve the weekly limit in your wallet (and revoke it later).
duel_status Your allowance, what is left this week, and the agent's gas.
duel_offer / duel_offers Offer a bet, or list open offers.
duel_accept Take the other side of an offer.
duel_mine Your duels and results.
duel_settle / duel_cancel Settle a closed duel (it also settles itself), or cancel your open offer.

Memory (MemWal / Walrus)

So an agent keeps its trade lessons across sessions. Memories are SEAL-encrypted blobs on Walrus, keyed to a Sui account, retrieved by semantic recall through MemWal's hosted relayer.

Tool What it does
memory_remember Persist one trade lesson to durable memory; waits until written.
memory_recall Recall past memories by meaning (semantic top-K).
memory_health Relayer + Walrus liveness, and whether memory is configured.

Enable it by pointing at a MemWal creds file:

"env": { "MEMWAL_CREDS": "/Users/you/.yosuku/memory.json" }

With MEMWAL_CREDS unset, the memory tools are simply disabled and nothing else is affected. MemWal is an early hosted service, expect occasional maintenance windows.

Predict tools run on Sui mainnet; duels on testnet. MIT.