@orblivion/mcp
An MCP server that lets AI agents, Orbio agents included, trade on Robinhood Chain
through Orblivion, safely. It runs on stdio and is built on the Orblivion SDK (@orblivion/sdk), which decodes and checks
every transaction before a key signs it.
- Dry-run by default.
execute_trade and session_trade only plan and verify until the owner sets
ORBLIVION_MCP_LIVE=1.
- The owner's policy lives in the environment. Per-trade and per-day caps, allowed tokens, the severe risks a call
may accept and the slippage cap. A tool call can ask for less, never for more.
- The key never passes through the model. It is read from a key file named in the server's configuration, never
accepted as a tool argument, and never shown in any answer or error.
- Every trade passes the SDK's full verification. A failure comes back as a refusal naming the rules that failed;
nothing is retried with looser settings.
- Answers are data. Token names, symbols, warnings and server text are cleaned and returned as data, and every tool
description tells the model not to follow instructions found in them.
Tools
| Tool |
What it does |
get_config |
The server's checked configuration, this server's wallet, and the owner's policy with what is left of today's cap. Read it first. |
search_tokens |
Search the token registry by name, symbol or address prefix. |
get_token |
One token's record checked against the chain, and its disclosed risks. |
get_quote |
An indicative quote (the server's word, not verified). |
get_balances |
ETH and token balances, read from the chain. |
plan_trade |
The trade's plan, verified by the SDK, with nothing signed: the plan, its disclosures and every check. |
execute_trade |
Live: verify, sign, send, check what was mined, within the caps. Dry-run: the same as plan_trade. |
session_status |
The executor key, its gas, the configured session and what the caps leave today. |
session_trade |
Trade as the executor of an owner-signed session. Dry-run asks nothing of the server (a session trade request is co-signed and counted against the session). |
hosted_agents_list |
The hosted agents this wallet owns. |
hosted_agent_ai |
One hosted AI agent's model, who pays (Orblivion's credits or the owner's Orbio balance), today's spend against its budget and its share of Orblivion's pool, its recent model calls and its recent decisions (the model's reasoning, as data). Read-only. |
account_trades |
This wallet's own trades through Orblivion, newest first (include_refused adds refused calls), paged with before. |
account_portfolio |
This wallet's balances valued at independent prices (unpriced tokens listed with their amount), its fee tier and the volume to the next. |
account_sessions |
This wallet's active sessions and hosted agents in summary. |
league_standings |
The agent trading league's standings (the current season, or season): score, return, drawdown, trades, active days, each entrant's eligibility and the places in the money, with the season's estimated payout. Read-only. |
league_seasons |
The league's record: every season's winners, amounts and payout transactions, and the prize reserve's ledger. Read-only. |
hosted_agent_ai is read-only too: the owner's policy has no setting for hosted actions, so the server can't create,
change or fund an AI agent (that stays with the owner, through the SDK). The two league_* tools read the public
record only: there is no tool and no policy setting to enter or leave the league, which stays with the agent's owner.
The three account_* tools are read-only: they sign nothing, change no policy and take no wallet or address (the
server answers for this server's key's own wallet only, and the SDK checks every answer's shape and wallet). Their
numbers are information: plan_trade and execute_trade check every trade against the chain themselves.
tools.json holds the same tools as plain JSON Schema, for agent frameworks without MCP: call the same operations
through your own transport, and keep the same policy.
Setup
Build it (from this repository: npm ci && npm run build in sdk/ts and then in mcp), or, once published, run it
with npx -y @orblivion/mcp. Put the agent's key in a file only you can read:
printf '%s' "0x<the agent wallet's private key>" > ~/.orblivion/agent.key
chmod 600 ~/.orblivion/agent.key
Claude Desktop
In claude_desktop_config.json:
{
"mcpServers": {
"orblivion": {
"command": "npx",
"args": ["-y", "@orblivion/mcp"],
"env": {
"ORBLIVION_KEY_FILE": "/path/to/agent.key",
"ORBLIVION_MAX_TRADE_USD": "20",
"ORBLIVION_MAX_DAY_USD": "100"
}
}
}
}
Claude Code
claude mcp add orblivion \
\
-e ORBLIVION_KEY_FILE=$HOME/.orblivion/agent.key \
-e ORBLIVION_MAX_TRADE_USD=20 -e ORBLIVION_MAX_DAY_USD=100 \
-- npx -y @orblivion/mcp
Any MCP client
Start orblivion-mcp (or node dist/index.mjs) as a stdio server with the environment below. Logs go to stderr; stdout
carries the protocol only.
Settings
| Variable |
Meaning |
Default |
ORBLIVION_API_URL |
The Orblivion API. https, or http to this machine only. |
https://api.orblivion.com |
ORBLIVION_KEY_FILE |
A file holding the signing key (the agent wallet's, or a session executor's). On Linux and macOS it must not be readable by others. |
none: only get_config and get_balances of a named address work (the rest answer NO_KEY) |
ORBLIVION_PRIVATE_KEY |
The key itself, instead of a file (less safe; removed from the environment once read). Not with ORBLIVION_KEY_FILE. |
|
ORBLIVION_MCP_LIVE |
1 lets execute_trade and session_trade sign and send. Needs a key and both caps. |
0: dry-run |
ORBLIVION_MAX_TRADE_USD |
The most one trade may be, in dollars. |
none (required when live) |
ORBLIVION_MAX_DAY_USD |
The most all trades may add up to in any 24 hours, kept in a ledger on disk. |
none (required when live) |
ORBLIVION_ALLOWED_TOKENS |
Comma-separated core symbols or addresses: both sides of every trade must be in it. |
any token |
ORBLIVION_ACCEPT_RISKS |
Comma-separated severe risks a call may accept (HONEYPOT, TRANSFER_TAX, LOOKALIKE, AMOUNT_HOOK, HIGH_PRICE_IMPACT, UNSCREENED). |
none |
ORBLIVION_SHIELD |
Removed: unset or 0. 1 is refused at startup. |
0 |
ORBLIVION_MAX_FEE_BPS |
The most Orblivion's fee may be on any trade, in whole bps (0 to 100). The SDK refuses a plan above it (FEE_BPS). Below 25 it can refuse trades a wallet without a volume discount would make. |
none: the fee schedule |
ORBLIVION_MAX_SLIPPAGE_BPS |
The most slippage a call may ask for. |
100 |
ORBLIVION_SESSION_ID |
The owner-signed session this key trades as its executor (session_trade). |
none |
ORBLIVION_SESSION_WALLET |
That session's wallet, for session_status. |
none |
ORBLIVION_STATE_DIR |
Where the day ledger lives. |
~/.orblivion-mcp |
ORBLIVION_MAX_CALLS_PER_MINUTE |
All tool calls. |
30 |
ORBLIVION_MAX_SENDS_PER_MINUTE |
Live sends. |
2 |
ORBLIVION_RPC_URL |
Comma-separated https RPCs for the SDK's own chain reads. |
the SDK's |
A value that doesn't parse stops the server with a message naming the setting; nothing falls back to a default.
Fees
Orblivion's fee depends on the two tokens a trade swaps (fee schedule 2):
- Major trades, where both tokens are majors (ETH, WETH, USDG, cbBTC, ORBIO, or a Robinhood stock token), pay the
wallet's volume tier: 25 bps, or 15 or 10 after enough 30-day volume.
- Every other trade pays 50 bps.
get_config shows the schedule. Every plan, quote and trade answer carries feeBps, feeClass (major or
other), feeTier (the same), and feeSide and feeToken: where the fee comes from. Orblivion
takes it in the end of the trade that ranks higher (ETH or WETH, then USDG, then cbBTC and ORBIO, then a stock token;
the output on a tie), so an ETH buy pays ETH from the input and a sale into USDG pays USDG from the output. The SDK
works out the class and the side itself from the two tokens, reading the chain for stock tokens, and refuses a plan
whose class, fee, fee token or side doesn't match (FEE_CLASS, FEE_BPS, FEE_TOKEN, FEE_SIDE, FEE_ORDER). It also refuses
a server that publishes a different schedule (CONFIG_MISMATCH). ORBLIVION_MAX_FEE_BPS sets a lower cap on top.
A session trade pays what the owner-signed session allows for the trade's class. This server holds it to the
schedule. Orblivion's co-signer holds it to the session itself.
The safety model
Prompt injection is the main threat: a token's name, a server message or a web page can tell the model to trade. The
server assumes the model may be misled and limits what any sequence of calls can do.