Tools for the Libre blockchain — a no-fee orderbook DEX and permissionless BTC-collateralized borrowing — for AI agents and any HTTP client. This server holds no keys and signs nothing.
Over MCP (Claude Desktop, or any MCP client):
{ "mcpServers": { "libre": {
"type": "streamable-http",
"url": "https://mcp.libre.org/mcp"
} } }
Or over plain HTTP — one path per tool, arguments as a JSON body:
curl -X POST https://mcp.libre.org/v1/tools/get_btc_price \
-H 'content-type: application/json' -d '{}'
curl -X POST https://mcp.libre.org/v1/tools/get_orderbook \
-H 'content-type: application/json' -d '{"pair":"btcusdt"}'
Machine-readable: OpenAPI 3.1 · llms.txt · health
Libre is an Antelope chain with two things an autonomous agent can use directly, with keys it controls.
dex.libre
charges nothing per trade — its entire config is a pause flag. No listing process, no KYC,
no whitelist. Blocks are 0.5s, so orders land sub-second. (Full irreversibility takes about
three minutes — that matters for settlement claims, not for quoting.)Collateral and execution live on the same chain, so borrowing and trading compose inside a single agent.
get_orderbook → place_order both sides →
get_orders → cancel_order as the oracle price moves.get_loans plus get_btc_price gives you every position's LTV.
Liquidation starts at 80% and clears only below 70%, so an agent that tops up collateral or
repays before the 72-hour timer expires is doing real work.get_orderbook first: a wide book can cost more per loop than
the borrow rate does.get_pool_stats). Cheap
to borrow when the pool is idle; lending pays best when it's busy.All of it is read tools + compose tools + your own signature. The server holds no key, so an agent here operates its own account — not one somebody custodies for it.
BTC/USD comes from the on-chain oracle contract: the
average of a round of at least three independent feeders that agree within 10% (otherwise
the round is skipped and the last price stands). It is the same price the loan contract
uses for LTV and liquidation. Call get_btc_price.
Do not quote an external exchange price for Libre collateral
math, and do not use a feed the tool marks stale — the loan contract itself
rejects anything older than 5 minutes.
A bot signs locally with its own key; this server never sees it. Compose here, sign there, relay back:
npm i @wharfkit/session @wharfkit/wallet-plugin-privatekey
import { Session } from '@wharfkit/session';
import { WalletPluginPrivateKey } from '@wharfkit/wallet-plugin-privatekey';
const info = await (await fetch('https://api.libre.cryptobloks.io/v1/chain/get_info',
{ method: 'POST', body: '{}' })).json();
const session = new Session({
chain: { id: info.chain_id, url: 'https://api.libre.cryptobloks.io' },
actor: 'mybot',
permission: 'agent', // the restricted permission, not active
walletPlugin: new WalletPluginPrivateKey(process.env.AGENT_KEY),
});
// 1. compose — unsigned, no key involved
const res = await fetch('https://mcp.libre.org/v1/tools/place_order', {
method: 'POST', headers: { 'content-type': 'application/json' },
body: JSON.stringify({ account: 'mybot', pair: 'btcusdt', side: 'buy',
price: '80000', amount: '0.0001', permission: 'agent' }),
});
const { actions } = await res.json();
// 2. sign and push — WharfKit fetches the ref block and ABIs and serializes for you
const result = await session.transact({ actions });
That is the whole loop: read, compose, transact, repeat. Get the key onto a restricted permission first at tools.libre.org/bot-account.
Two things that will bite you. The permission you pass
to a compose tool must match the one your session signs with, or the chain rejects the
transaction. And a signature is bound to one chain id — a mainnet signature is meaningless
on testnet, so pass network explicitly rather than relying on the default.
Prefer to build the transaction yourself? push_transaction
takes a packed transaction directly, and scripts/e2e-testnet.mjs in the repo is a
worked example using @wharfkit/antelope. You don't need it to write a bot.
Compose tools return an unsigned {actions, esr, expires} proposal. You then
either:
actions with your own key (WharfKit) and relay
with push_transaction. Use a linkauth-restricted child permission
scoped to the actions your bot needs — never the account's owner or active key.esr link in Bitcoin Libre or Anchor,
review it there, and sign.Every tool takes an optional network: "mainnet" (default, real
funds) or "testnet".
Per source IP: read tools 300/min, compose tools 60/min, push_transaction and
request_account 10/min. Over the limit returns 429.
Free, no key, no signature.
get_btc_priceget_orderbookget_tradesget_ordersget_pool_statsAccount state, vaults, and loan positions.
get_accountget_vaultget_loansget_redemption_queueget_deposit_addressget_chain_infoget_table_rowsReturn unsigned actions plus an ESR link. Nothing is signed or sent.
place_ordercancel_ordertransferwithdraw_btcAlso unsigned. Testnet only until the oracle-cutover loan build ships to mainnet.
setup_vaultborrowrepaywithdraw_collaterallendredeemcancel_redeemcancel_loan_requestRelay a transaction you signed yourself; request a new account.
push_transactionrequest_accountget_account_request