@gblin-protocol/mcp-server
Use it as an agent-facing GBLIN toolkit on Base mainnet to inspect live protocol state, assess risk and treasury, simulate and prepare unsigned transactions, and handle gasless payments and verifiable receipts.
Read vault state: NAV, ETH price, basket weights, fees, Crash Shield status, NAV reliability, and auction status.
Read the BTC/ETH market risk regime and posture: calm, elevated, or crash.
Quote minting or redemption with safe minimum outputs and dynamic slippage/fees.
Prepare unsigned calldata for vault actions: mint with ETH/WETH/USDC, redeem in kind, exit to ETH/USDC, and bid in the rebalancing auction.
Prepare just-in-time GBLIN→USDC and USDC→GBLIN conversion steps.
Simulate transaction steps before signing, check gas sufficiency, and decode reverts.
Check sent transaction status, fees, confirmations, and net token movements.
Read NAV history versus ETH and BTC, including drawdown.
Analyze an agent wallet’s balances, gas health, cooldown, runway, and allocation posture.
Plan what to do with idle USDC: operating cash, surplus, simulated mint/exit, blockers, and next tools.
Verify governance state, timelock roles, pending ownership, and scheduled operations.
Read auction rows, gaps, premium, and bid calldata.
Prepare, verify, and relay gasless EIP-3009 GBLIN payments; relay actually moves signed funds.
Verify Risk Attestations offline and compare attested vs live regime.
Seal demo AI action receipts into a transparency log, fetch/verify receipts, and learn about paid unlimited sealing.
Generate a portable skill seed to share GBLIN onboarding with another agent.
GBLIN MCP Server
Model Context Protocol server for the GBLIN protocol on Base mainnet: an on-chain index of cbBTC, WETH and USDC whose shares are minted at NAV and redeemed pro rata in kind. The server reads live state, verifies governance and risk attestations, and returns unsigned calldata to enter, leave and bid. It never holds keys, signs or broadcasts.
Published on npm as @gblin-protocol/mcp-server.
Documentation and quick start: gblin.digital/agents. Starter examples: examples/.
Features
Market risk regime (
calm/elevated/crash) read from the vault's on-chain Crash Shield, with a severity score and a risk postureQuotes at NAV for minting and redeeming, with a dynamic slippage buffer
One tool that prepares any operation on the vault (mint with ETH, WETH or USDC, redeem in kind, exit to ETH or USDC, bid in the auction), each step with its gas limit
Simulation of those steps before signing, in sequence against the latest block, with decoded revert reasons and the gas limit each vault step really needs
The outcome of a sent transaction, and the NAV per share over time beside ETH and BTC
Treasury health of an agent wallet: balances, gas runway, cooldown, allocation advice
Governance verification: owner, pending owner, timelock roles and scheduled operations, computed from the chain
The state of the rebalancing auction, row by row, with the bid to send
Gasless payments in GBLIN (EIP-3009): prepare the authorization to sign, check it against the chain before anyone spends gas, and, when nobody else will carry it, have GBLIN's relay settle it with the fee in GBLIN, in one atomic transaction
Offline verification of Risk Attestations (EIP-712) and of AI Action Receipts (RFC 6962)
A portable skill seed to onboard a peer agent
Four prompts (ready-made workflows) and four resources (deployment, payments, keys, limits)
An
outputSchemaon every tool that returns an object, so a client can validate results and generate types
Every tool is free. The server never charges: revenue comes from the on-chain protocol fee when an agent actually uses GBLIN. Verifiable pay-per-call lives on the HTTP endpoints listed under x402 endpoints.
Related MCP server: mcp-server
Contracts (Base mainnet, chain id 8453)
Component | Address | Role |
Vault | The ERC-20 share and the basket. Mints at NAV, redeems in kind, rebalances by Dutch auction, accepts payments by signature (EIP-3009). Never swaps. | |
Lens | Read-only views beside the vault: quotes, configuration, basket rows, auction state. | |
Zap | The only contract that swaps: mints with any token, exits to ETH by redeeming in kind and selling every leg, all or nothing. | |
Timelock | 48-hour minimum delay, 14-day grace period, open executor. Proposer and canceller roles are held by a 2-of-3 Safe ( |
Previous deployments (0x36C81d7E1966310F305eA637e761Cf77F90852f0, 0x38DcDB3A381677239BBc652aed9811F2f8496345) are superseded. Nothing is read from them; holders migrate through the web app.
Fees: 0.10% on every mint with ETH or WETH (0.05% stays in the vault and lifts the NAV of every share, 0.05% is minted as shares to the fee recipient); in-kind deposits pay a 0.50% floor plus a deviation tax; a 0.50% yearly management fee accrues as shares; redemption in kind and transfers carry no fee.
Hosted variant
A stateless Streamable HTTP server runs at https://mcp.gblin.digital/mcp — no install, no auth, no session, 60 requests per minute per IP. It serves the vault, action and payment tools of this package under two-level names (treasury.*, actions.*, payments.*, governance.state, auction.state, attestation.verify), built from the same source, plus the risk, receipts and coherence tools; the snake_case names below are accepted there as aliases. It also serves search and fetch, the two read-only tools research clients expect (ChatGPT deep research among them): search returns matching documents (the protocol's documentation, one card per tool, the live vault state) and fetch returns one document's full text. Every step returned by the action tools carries both spellings, target/calldata and to/data/chainId, so it maps one to one onto wallet batch APIs such as send_calls. GET-only audit surfaces: /meta, /tools.json, /resources.json, /conformance. A second surface, https://mcp.gblin.digital/mcp/directory, serves the same tools except payments.relay, the one tool that submits a signed transfer on the caller's behalf; it exists for connector directories that accept software which reads, simulates, verifies and prepares unsigned calldata but not software that executes transfers. /meta reports it under directory_surface.
Agent treasury (library and CLI)
packages/agent-treasury — npm @gblin-protocol/agent-treasury. Operating cash stays in USDC, the surplus above a
reserve is parked in GBLIN, and USDC is pulled back from GBLIN just in time when an x402 invoice arrives. The x402 client is
Coinbase's reference x402Client with the refill attached to its onBeforePaymentCreation hook, so a 402 for USDC on Base
triggers the refill before the authorization is signed and a price above the cap is refused before anything is signed.
Self-custody, no key leaves the process. Verified end to end on a fork of Base (24 checks: park, refill, cooldown, a
mock invoice with the challenge bytes of gblin.digital and a verified EIP-712 signature, the cap).
export GBLIN_AGENT_PRIVATE_KEY=0x...
npx @gblin-protocol/agent-treasury status --json
npx @gblin-protocol/agent-treasury park --json
npx @gblin-protocol/agent-treasury pay https://gblin.digital/api/x402/attestation --max-amount 3000 --jsonThe matching agent skill is skills/gblin-agent-treasury (npx skills add gblinproject/gblin-treasury-risk-regime).
Details: packages/agent-treasury/README.md.
API
Tools
get_market_risk_regime
The BTC/ETH risk regime derived from the vault's Crash Shield:
calm,elevatedorcrash, withseverity_pct, arisk_posture(risk_on/reduce/risk_off), the defensive cash weight and one entry per risk assetInputs: none
Call it before any action that deploys capital; a
crashreading means stand down
get_treasury_state
NAV in USD, ETH price, whether the vault can price itself (
nav_reliable), the yearly management fee, whether an auction is open, Crash Shield status and the basket rows with base and dynamic weightsInputs: none
quote_safe_swap
Previews a mint (ETH→GBLIN) or a redemption (GBLIN→ETH) through the Lens, with a safe minimum output under the dynamic slippage buffer (2.5% normally, 4% while the Crash Shield is active) and the fee breakdown
Inputs:
direction(string):buyorsellamount_in(string): decimal amount of ETH (buy) or GBLIN (sell)
swap_gblin_to_usdc_jit
Unsigned calldata to turn GBLIN into a given amount of USDC just in time: approve the shares to the Zap, the Zap's
sellGBLINForEth(redeem in kind and sell every leg, all or nothing), then a WETH→USDC swap. Three transactions; ERC-4337 and EIP-7702 wallets batch them into oneInputs:
usdc_needed(string): decimal USDC amountwallet_address(string): the agent's address, for the cooldown check and as receiver
Every step carries a minimum output; the last step's input is the guaranteed minimum of the previous one
invest_usdc_to_gblin
Unsigned calldata to mint GBLIN with USDC through the Zap: approve USDC, then one call that swaps to WETH and mints at NAV. Two transactions
Inputs:
usdc_amount(string): decimal USDC amountwallet_address(string): receiver of the shares
Both bounds travel with the call: the minimum WETH from the swap and the minimum shares from the mint
analyze_treasury_health
GBLIN, USDC and ETH balances of a wallet, gas health, the vault's cooldown for that wallet, and an allocation recommendation with the runway in days when a burn rate is given
Inputs:
wallet_address(string)daily_burn_usd(number, optional): average daily spend, enables the runway estimate
plan_treasury
Idle USDC to a reviewable plan in one call: the operating cash to keep liquid (
max(reserve_usd, daily_burn_usd × days)), the surplus above it, a simulation of minting that surplus at NAV with every fee read live and the estimated value of exiting the same position today (round-trip cost included), the same simulation for a trial amount, the blockers (crash shield, cooldown, ETH for the exit) and the tools to call after a human confirms. Reads only; nothing is executed and nothing is advisedInputs:
wallet_address(string)daily_burn_usd(number, optional): average daily spend in USDdays(number, optional): days of spend to keep liquid, default 7reserve_usd(number, optional): USD to keep liquid regardless of the burn rate; one ofdaily_burn_usdorreserve_usdis requiredtrial_usdc(number, optional): trial amount to simulate beside the surplus, default 100
The same plan is served over HTTP at
https://gblin.digital/api/x402/plan
get_governance_state
Owner and pending owner of the vault, the fee recipient, the timelock's minimum delay and roles, and, when the pending owner is the timelock, the deterministic id and state of the scheduled
acceptOwnershipoperationInputs:
operation_id(string, optional): a timelock operation id (bytes32) to inspect
share_skill_with_peer
A portable JSON seed another agent can use to install this server and start: install instructions, the tool list, contract addresses, a worked example and the caller's ERC-8021 builder code for attribution
Inputs:
caller_wallet(string)peer_context(string, optional): what the peer does, to tailor the exampleexample_amount_usdc(number, optional)
get_auction_state
The rebalancing auction: whether it is open, the current premium over the oracle price and its curve, and one entry per basket row with the side the vault takes, the gap in ETH, the token and amount the bidder hands over, and unsigned calldata for the approval and the bid.
bestis the row with the largest gapInputs: none
The premium is the whole reward; nothing is paid out of the vault. The input is reduced to what closes the gap
prepare_gblin_payment
Builds a gasless GBLIN payment. The share token implements EIP-3009, the same mechanism USDC uses: the holder signs an authorization and anybody can carry it on chain, so the payer needs no ETH. Returns the EIP-712 message to sign, the amount in shares and atomic units, the payer's balance, the x402 "exact" payload for paying an HTTP endpoint in GBLIN, and the accepts block a seller publishes to be paid in GBLIN
Inputs:
from(string): the payer, the wallet that will signto(string): the recipientamount_gblin(string) oramount_usd(string): the amount, converted at the live NAV when given in USDmethod(string, optional):receive(default) can be submitted only by the recipient, so nobody can front-run it;transfercan be submitted by anyone, which is what an x402 facilitator doesvalid_for_seconds(number, optional): default 600, maximum 86,400
The EIP-712 domain is read from the token through EIP-5267, never assumed. No private key is requested, held or transmitted
verify_gblin_authorization
Checks a signed authorization against the chain before anyone spends gas on it: recovers the signer from the digest, or asks the wallet itself through ERC-1271 when the payer is a contract, then checks the validity window against on-chain time, whether the nonce has been used or cancelled, and whether the payer still holds the amount. Returns a verdict, the failing reasons, and the ready calldata when it would settle
Inputs:
authorization(object): from, to, value, validAfter, validBefore, noncesignature(string): produced by the payer's walletmethod(string, optional):receive(default) ortransfer
These are the checks an x402 facilitator runs, so a
would_settleverdict means the payment is good to carry
relay_gblin_payment
Hands a signed payment and a signed relay fee to GBLIN's relay (
https://gblin.digital/api/relay/gblin), which checks both against the chain, simulates them and submits them in one transaction through Multicall3: both settle or neither does. For a payer that holds no ETH and has nobody to carry the paymentInputs:
payment(object):{ authorization, signature }, methodtransferfee(object):{ authorization, signature }from therelayblock ofprepare_gblin_paymentcalled withrelay: true
The fee is quoted live by the relay, in GBLIN at the NAV. This tool moves funds: it is marked destructive so clients ask before running it
prepare_action
Builds the unsigned steps for any operation on the vault, in order, each through the vault or the Zap carrying its gas limit
Inputs:
action(string):mint_with_eth,mint_with_weth,mint_with_usdc,redeem_in_kind,exit_to_eth,exit_to_usdcorbidwallet_address(string): the wallet that will sign and receiveamount(string): in ETH, WETH or USDC for mints, in shares for redemptions and the ETH exit, the USDC needed for the USDC exit; not used bybidrow(integer, optional):bidonly, the basket row; default the largest gap
Returns the steps, what they should deliver with the minimums applied, and warnings such as an active cooldown or an amount above the balance
preview_steps
Simulates a list of transactions in sequence against the latest block with
eth_simulateV1, each seeing the state the previous ones left. Returns, per step, success, gas used, whether the given limit is enough, the recommended limit and the decoded revert reason with a hint; and the net token and ETH movements for the walletInputs:
from(string): the wallet that will send the stepssteps(array): the steps as the tools return them:target,calldata, optionalvalueandgas
For steps into the vault or the Zap the recommended limit is the smallest one that passes, found by bisection: the vault reserves gas for its capped transfers, so the gas a call uses is below the limit it needs
gas_limit_enoughistruewhen the step passes with the limit it carries,falseonly when that limit is what makes it fail, andnullwhen it fails for another reason (a slippage bound, a cooldown), whicherrorandhintname
get_transaction_status
What a sent transaction did: pending, success, reverted or not found; block, confirmations, fee, net token movements for the sender, and the decoded reason when it reverted
Inputs:
hash(string)
get_nav_history
NAV per share over time, read at past blocks, beside the ETH/USD and BTC/USD feeds the vault uses, with the change of each over the window and the NAV's largest drawdown. History starts at the deployment of the vault in service
Inputs:
interval(hourorday, defaultday),points(2 to 90, default 30)Historical reads use public endpoints that serve them; set
GBLIN_ARCHIVE_RPC_URLto use your own
verify_risk_attestation
Verifies a Risk Attestation offline: recomputes the EIP-712 id, recovers the signer and checks it against the published attestor, checks freshness, and reports the live drift of the regime since issuance
Inputs:
attestation(object): the object returned byGET https://gblin.digital/api/x402/attestationexpected_attestor(string, optional): the attestor address to pin
Accepts EIP-712 domain version 2 (verifying contract = the vault in service) and version 1 (the previous deployment); the version the attestation declares selects the domain
seal_action_demo
Seals the hashes of an AI action into the public transparency log (demo: 5 per day per IP, receipt marked
demo: true) and returns the portable receiptInputs:
action(string): a short labelinput_hash(string): SHA-256 of the inputoutput_hash(string, optional)agent_id,tool,meta(string, optional): identifiers, published in clear
Unlimited seals are a paid x402 HTTP endpoint; see
how_to_seal_paid
get_receipt
A sealed receipt by index: canonical payload, Ed25519 signature, RFC 6962 inclusion proof and the signed checkpoint
Inputs:
index(integer)
how_to_seal_paid
How to seal without limits: endpoint, body schema, payment flow and offline verification
Inputs: none
Tool annotations (MCP hints)
Every tool sets MCP tool annotations:
Tool | readOnlyHint | idempotentHint | destructiveHint | openWorldHint |
all except the three below |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Calldata builders are read-only: they return bytes, they do not send them. prepare_gblin_payment is not idempotent because every call draws a fresh nonce. Sealing appends to a public log and is never destructive. relay_gblin_payment moves the payer's funds on chain, so it is marked destructive and clients should confirm before calling it. Every tool also carries a human-readable title.
Output schemas
Every tool except seal_action_demo declares an outputSchema. A successful result carries the same object as structuredContent and as JSON text. The required list of each schema is the contract: fields a successful call always returns. Other fields are described but optional, and the schemas accept additional fields, so adding one is not a breaking change. Errors carry isError: true and no structured content.
Prompts
Prompt | What it does |
| Reads the regime and applies a rule stated before looking: proceed, halve, or stand down |
| Prepare, sign in the payer's wallet, verify, then hand on a gasless GBLIN payment |
| Exit just enough GBLIN to USDC to settle an invoice, after checking cooldown and gas |
| Seal an action, read the receipt back, and state what it does and does not prove |
Resources
URI | Content |
| Every contract in service with its role, and the deprecated deployments not to use |
| The EIP-712 domain read live from the token, the x402 payload, and the accepts block a seller publishes |
| The attestor address to pin, and where the log and witness keys are published |
| Price (free by default), the metering switch, and where the limits come from |
Usage
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"gblin": {
"command": "npx",
"args": ["-y", "@gblin-protocol/mcp-server"]
}
}
}Cursor, Windsurf and other MCP clients
{
"mcpServers": {
"gblin": {
"command": "npx",
"args": ["-y", "@gblin-protocol/mcp-server"],
"env": { "GBLIN_RPC_URL": "https://base-rpc.publicnode.com" }
}
}
}Programmatic (TypeScript)
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
const transport = new StdioClientTransport({ command: "npx", args: ["-y", "@gblin-protocol/mcp-server"] });
const client = new Client({ name: "my-agent", version: "1.0.0" });
await client.connect(transport);
const jit = await client.callTool({
name: "swap_gblin_to_usdc_jit",
arguments: { usdc_needed: "0.50", wallet_address: "0xYourAgent..." },
});AGENTS.md for coding assistants
npx -p @gblin-protocol/mcp-server gblin-initCreates an AGENTS.md from the template at gblin.digital/AGENTS.template.md, or appends a delimited block to an existing one. Idempotent; --dry-run previews, --force refreshes the block. No files are written at install time; set GBLIN_SKIP_HINT=1 to silence the post-install hint.
Configuration
GBLIN_RPC_URL selects the Base RPC endpoint; the default is https://base-rpc.publicnode.com. For sustained load use a dedicated provider:
export GBLIN_RPC_URL="https://base-mainnet.g.alchemy.com/v2/YOUR_KEY"
npx @gblin-protocol/mcp-serverGBLIN_ATTESTOR_ADDRESS overrides the published attestor address used by verify_risk_attestation.
x402 endpoints
Pay-per-call data lives on HTTP, settled in USDC on Base through the Coinbase CDP facilitator with gasless EIP-3009 transferWithAuthorization. Clients such as @x402/fetch handle the 402 challenge, the signature and the retry.
Endpoint | Price | Returns |
| free | NAV, basket weights, Crash Shield status |
| free | Mint or redemption preview with the dynamic slippage buffer |
| free | Owner, timelock, pending operations |
| free | Wallet balances, gas runway, allocation advice |
| free | Unsigned calldata: USDC → GBLIN |
| free | Unsigned calldata: GBLIN → USDC just in time |
| $0.003 | Signed EIP-712 Risk Attestation, valid ten minutes |
| $0.0045 | A sealed AI Action Receipt |
Machine-readable manifest: https://gblin.digital/.well-known/x402. Payment recipient: 0x0ebA5d314F4f5Dcb7A094953Fa9311a45172dd1B.
Risk Attestation
GET https://gblin.digital/api/x402/attestation returns a ten-minute, verifiable snapshot of the BTC/ETH risk regime, signed under the EIP-712 domain GBLIN Risk Attestation, version 2, chain 8453, verifying contract = the vault in service. The response embeds its domain, types and message under eip712; a verifier recovers the signer and checks it against the published attestor address, which it should pin. verify_risk_attestation does this offline and also accepts attestations issued under domain version 1.
AI Action Receipts
A public, append-only RFC 6962 transparency log for AI actions. Input and output go in as hashes only; the short action, agent_id, tool and meta strings are published in clear, so put identifiers there, never secrets. Each seal returns a portable receipt:
receipt = canonical payload
+ Ed25519 signature (key: gblin.digital/receipts-log)
+ RFC 6962 inclusion proof (leaf → Merkle root)
+ C2SP signed checkpoint (origin, tree size, root)Canonicalization is frozen as gblin-canonical-json/1: object keys sorted by UTF-16 code unit, no whitespace, JSON.stringify semantics for primitives, recursion for objects and arrays. Test vector: payload {"b":1,"a":null} → canonical {"a":null,"b":1} → leaf = SHA256(0x00 || canonical_bytes). The receipt signature is Ed25519 over "gblin-receipt/v1\n" + canonical.
Seal (paid, unlimited):
POST https://gblin.digital/api/x402/seal, $0.0045 USDC via x402Seal (demo, 5 per day per IP):
POST <worker>/v1/seal-demo, or the toolseal_action_demoRead, free:
<worker>/v1/receipt/:index,/log,/log/checkpoint,/log/proof/:index,/log/consistency,/log/leaves, and the page/receipt/:indexDaily anchor of the tree root on Base as an EAS attestation (schema
0x9f433a96…)Offline verifier with no dependencies:
verify-receipt.mjs—node verify-receipt.mjs receipt.json
The checkpoint is signed by the log operator and cosigned by an independent witness (Markovian Protocol). A cosignature attests that the log stayed append-only between the sizes the witness saw; it does not attest that a receipt's content is true. A seal proves existence and time; it is not a compliance certificate and not an endorsement. <worker> = https://gblin-mcp.gblin-mcp-worker.workers.dev.
Coherence Proof
GBLIN pre-registers hash-pinned promises and runs an automaton that probes them every ten minutes and seals each closed day as an EAS attestation on Base. Free report: /coherence. Live promises: uptime of the paid attestation endpoint, and honesty of the public agent-economy counters, with the protocol's own wallets disclosed. GBLIN is a registered ERC-8004 agent (#59286).
Architecture notes
Mint at NAV, redeem in kind. The vault prices every mint from Chainlink feeds and issues shares against the deposit; redemption pays the exact pro-rata slice of every basket row, reads no price feed and cannot be paused. The vault never swaps.
The Zap swaps. Entering with a token other than ETH or WETH, and leaving to ETH or USDC, go through the Zap, which swaps on a venue and mints or redeems on the vault in the same call. Exits are all or nothing: a leg that cannot be sold reverts the whole transaction instead of paying out less.
Rebalancing is a Dutch auction. When a row drifts past its band the vault opens an auction; the counterparty trades toward the target weights at the oracle price adjusted by a premium that starts at a discount and rises to a cap over one ramp.
get_auction_stateexposes it.Dynamic slippage. Minimum outputs are quoted from the Lens and buffered by 2.5%, or 4% while the Crash Shield is active. No calldata leaves this server with a zero minimum on a swap.
Cooldown. The vault refuses a redemption for a short window after the same address minted; the window is read live and reported by
analyze_treasury_health.Payments by signature. The vault implements EIP-3009 (
transferWithAuthorization,receiveWithAuthorization,cancelAuthorization), so an agent can settle in GBLIN the way it settles in USDC. Transfers carry no fee.
Security notes
The server is read-only: it never holds, signs or broadcasts. Calldata is plain ABI-encoded bytes for the agent's own wallet to review and send.
Every quote comes from on-chain calls and Chainlink feeds. A stale or non-positive ETH/USD answer aborts the tool with an explicit error rather than a bad number; the vault's own
isNavReliableis reported alongside.No telemetry, no analytics, no remote dependencies beyond the configured RPC.
Development
git clone https://github.com/gblinproject/gblin-treasury-risk-regime
cd gblin-treasury-risk-regime
npm install
npm run build
npm test # handler smoke test against Base mainnet, read-only
npm run test:protocol # speaks MCP over stdio: capabilities, instructions, prompts, resources
npm run test:schemas # every tool through the official MCP client, which validates outputSchema
npx tsx scripts/test-hosted.ts <url> # the hosted server over Streamable HTTP, with the same validation
npm start # run the compiled serverTwo tests run against a local fork of Base and send transactions there, never on mainnet:
anvil --fork-url <base rpc> --port 8555 &
export GBLIN_RPC_URL=http://127.0.0.1:8555
npm run test:payments # gasless payment: signed, verified, carried by a third party; replay and front-run refused
npm run test:calldata # sends the exit and investment steps exactly as the tools return them
npm run test:actions # every prepare_action, simulated then sent; preview agrees with the chain; gas limits found by bisectionsrc/
config.ts # addresses, slippage and cache settings
abi.ts # vault, Lens, Zap, timelock, Chainlink and ERC-20 ABIs
client.ts # viem public client and on-chain timestamp
helpers.ts # NAV, basket state, slippage, cooldown, reverse quote
auction.ts # auction state and bid sizing
tools.ts # the treasury, auction and risk tools, and the tool list
payments.ts # gasless payments (EIP-3009): prepare, verify, relay
actions.ts # prepare_action, preview_steps, get_transaction_status, get_nav_history
shared.ts # result envelopes, builder code, Zap routing data and gas limit
version.ts # generated from package.json by scripts/write-version.mjs
receipts.ts # the three receipt tools
output-schemas.ts # the outputSchema of every tool
prompts.ts # the four prompts
resources.ts # the four resources
index.ts # MCP stdio server entry and initialize instructions
init.ts # the gblin-init command
worker/ # the hosted Streamable HTTP server (Cloudflare Workers)
scripts/ # test.ts, test-protocol.ts, test-output-schemas.ts, test-payments-fork.ts, test-calldata-fork.tsLinks
Protocol site and agent docs: gblin.digital · gblin.digital/agents
Protocol sources and specification: github.com/gblinproject/GBLIN-Protocol
ElizaOS plugin:
plugin-gblinIssues: github.com/gblinproject/gblin-treasury-risk-regime/issues
MIT © GBLIN Protocol
Available Tools
21 toolsanalyze_treasury_healthARead-onlyIdempotentInspect
Analyzes an agent wallet's treasury: GBLIN, USDC and ETH balances, whether the ETH covers an exit at the live gas price, and the redemption cooldown. When daily_burn_usd is given it adds days of USDC runway and a split that keeps seven days of spend in USDC and treats only the surplus as a candidate for GBLIN. Free by default; a 0.003 USDC charge applies only when the server operator sets MCP_PAYWALL=true.
Inputs: wallet_address (required), _payment, daily_burn_usd. Returns: ratios, wallet, balances, cooldown, +2 more
get_auction_stateARead-onlyIdempotentInspect
Read the GBLIN rebalancing auction on Base. The vault does not rebalance itself and pays nobody to do it: when a basket row drifts past its band it holds a Dutch auction, and whoever trades with it toward the target weights is the counterparty, at the oracle price adjusted by a premium that starts at a discount and rises to a cap over one ramp. Returns, per row, the side the vault takes, the gap in ETH, the token and amount the bidder hands over, and unsigned calldata (approval + bid). The premium is the whole reward; nothing is paid out of the vault.
Inputs: no named parameters. Returns: best, lens, note, rows, +9 more
get_governance_stateARead-onlyIdempotentInspect
Reads GBLIN protocol governance: whether the GBLIN vault is owned by the 48-hour timelock, the timelock's minimum delay and grace period, role member counts, and any pending asset-addition proposal on the vault. With an operation_id it also reports the status of that timelock operation. Read-only.
Inputs: operation_id. Returns: lens, owner, vault, timelock, +7 more
get_market_risk_regimeARead-onlyIdempotentInspect
Returns the current BTC/ETH risk regime (calm | elevated | crash), a severity score and the matching risk posture (risk_on | reduce | risk_off), derived from GBLIN's on-chain Crash Shield against Chainlink oracle peaks on Base. Independent of holding GBLIN. Free by default; a 0.002 USDC charge applies only when the server operator sets MCP_PAYWALL=true.
Inputs: _payment. Returns: meta, assets, regime, source, +5 more
get_receiptARead-onlyIdempotentInspect
Fetch a sealed AI Action Receipt by index from GBLIN's public transparency log (free forever). Returns the full portable receipt — canonical payload, Ed25519 signature, RFC 6962 Merkle inclusion proof against the current tree, operator-signed C2SP checkpoint — which any third party can verify offline with verify-receipt.mjs (zero dependencies).
Inputs: index (required). Returns: leaf, note, root, index, +14 more
get_transaction_statusARead-onlyIdempotentInspect
Reports what a sent Base transaction did: pending, succeeded, reverted or not found; its block and confirmations; the fee paid; the net token movements for the sender (GBLIN shares minted or redeemed, USDC, basket tokens); and, when it reverted, the decoded reason.
Inputs: hash (required). Returns: to, from, hash, note, +9 more
get_treasury_stateARead-onlyIdempotentInspect
Reads the current GBLIN protocol state on Base mainnet: NAV in USD, basket composition with dynamic weights, Crash Shield status and whether the NAV is reliable.
Inputs: no named parameters. Returns: meta, basket, nav_usd, auction_open, +6 more
how_to_seal_paidARead-onlyIdempotentInspect
Returns the reference for unlimited paid seals (0.0045 USDC per seal via x402 on Base) in GBLIN's AI Action Receipts transparency log: endpoint, body schema, payment flow, and offline verification of receipts. The free demo allows 5 seals per day per IP.
Inputs: no named parameters. Returns: flow, note, price, receipt, +4 more
invest_usdc_to_gblinARead-onlyIdempotentInspect
Returns calldata that converts a USDC amount into GBLIN, a basket of cbBTC, WETH and USDC minted at NAV and redeemable at any time. Two steps: (1) approve USDC to the GBLIN Zap, (2) GBLINZap.buyGBLINWithToken, which swaps the USDC to WETH on Uniswap V3 and mints at NAV with a non-zero minimum output. Free. The mint fee and the yearly management fee are governance parameters read live from the vault, not fixed in this text.
Inputs: usdc_amount (required), wallet_address (required). Returns: steps, action, expected, gas_hint, +2 more
plan_treasuryARead-onlyIdempotentInspect
Turns idle USDC into a reviewable plan in one call: operating cash = max(reserve_usd, daily_burn_usd x days), the surplus above it, a simulation of minting that surplus into GBLIN at NAV (fees read live from the vault, estimated exit value today, round-trip cost), the same simulation for a trial amount (100 USDC by default), and the blockers (Crash Shield, redemption cooldown, ETH for the exit). Read-only: nothing is executed and nothing is advised. GBLIN is crypto exposure (cbBTC, WETH, USDC), not cash and not yield.
Inputs: wallet_address (required), days, trial_usdc, reserve_usd, +1 more. Returns: next, as_of, notes, trial, +9 more
prepare_actionARead-onlyIdempotentInspect
Builds the unsigned transactions for an operation on the GBLIN vault, in the order they are sent. Actions: mint_with_eth (amount in ETH), mint_with_weth (amount in WETH), mint_with_usdc (amount in USDC, through the Zap), redeem_in_kind (amount in shares; pro rata basket tokens, no fee, no price feed), exit_to_eth (amount in shares, through the Zap, all or nothing), exit_to_usdc (amount = the USDC needed), bid (trade with the rebalancing auction; row optional, the largest gap by default). Every output bound is non-zero and every step through the vault or the Zap carries its gas limit. Nothing is signed or sent: the steps are returned to the caller.
Inputs: action (required), wallet_address (required), row, amount. Returns: next, steps, action, wallet, +2 more
prepare_gblin_paymentARead-onlyInspect
Builds a gasless GBLIN payment. The vault's share token implements EIP-3009, so the holder signs an authorization and anybody can carry it on chain: the payer needs no ETH. Returns the EIP-712 message to sign (its domain is read from the token, not assumed), the calldata that carries the signed authorization, and the x402 'exact' payload for paying an HTTP endpoint in GBLIN. Method 'receive' lets only the named recipient submit the authorization, so nobody can front-run the transfer; method 'transfer' suits an x402 facilitator, which submits on the seller's behalf. With relay: true it also returns a second authorization that pays a relayer's fee in GBLIN. No private key is requested, held or transmitted: the signature is produced by the caller's own wallet.
Inputs: to (required), from (required), relay, method, +3 more. Returns: relay, amount, digest, method, +8 more
preview_stepsARead-onlyIdempotentInspect
Simulates a list of transactions in sequence against the latest Base block, as if the wallet sent them one after the other, before anything is signed. Each step sees the state the previous ones left (an approval before a mint works). Accepts steps with target or to, calldata or data, and optional value and gas. Returns, per step, whether it would succeed, the gas it uses, whether the gas limit it carries is enough, and the decoded revert reason when it fails; and the net token and ETH movements for the wallet. State can change before transactions land: a successful preview is evidence, not a guarantee.
Inputs: from (required), steps (required). Returns: from, note, block, steps, +3 more
quote_safe_swapARead-onlyIdempotentInspect
Preview a buy (ETH→GBLIN) or sell (GBLIN→ETH) without executing. Returns expected output, safe minOut with dynamic slippage buffer (2.5% normal / 4% during Crash Shield), and fee breakdown. Read-only.
Inputs: amount_in (required), direction (required). Returns: fees, direction, next_step, amount_in_eth, +9 more
relay_gblin_paymentADestructiveIdempotentInspect
GBLIN's relay carries a signed GBLIN payment on chain for a payer that holds no ETH. Takes the payment and the relay fee, each as { authorization, signature }, both signed by the payer's wallet. The relay checks both against the chain, simulates them and submits them in one transaction through Multicall3: either both settle or neither does. The fee is paid in GBLIN at the live NAV. Returns the transaction hash and its outcome. This tool moves funds: it carries the authorizations exactly as signed.
Inputs: fee (required), payment (required). Returns: fee, note, block, relay, +4 more
seal_action_demoAInspect
Seals the hashes of an AI action into GBLIN's public append-only RFC 6962 transparency log (free demo, 5 per day per IP, receipt marked demo: true). Returns a portable receipt: Ed25519 signature, Merkle inclusion proof and operator-signed C2SP checkpoint, verifiable offline with the zero-dependency verify-receipt.mjs. Input and output go in as sha256 hashes only; the action label and metadata are published in the public log. Unlimited sealing is a separate paid x402 HTTP endpoint (0.0045 USDC per seal).
Inputs: action (required), input_hash (required), meta, tool, +2 more.
swap_gblin_to_usdc_jitARead-onlyIdempotentInspect
Returns ready-to-broadcast calldata that redeems exactly the USDC requested from a GBLIN position, just in time for an x402 invoice or any other USDC obligation. Three sequential transactions: (1) approve the shares to the GBLIN Zap, (2) GBLINZap.sellGBLINForEth, which redeems in kind and sells every leg for ETH, all or nothing, (3) a Uniswap WETH->USDC swap that spends only the guaranteed ETH minimum and still returns at least the requested USDC. EOAs sign three times; ERC-4337 and EIP-7702 wallets can batch them into one operation. Every step carries a non-zero minimum; ETH above the minimum stays in the wallet. Free. A redemption carries no protocol fee; the costs are the Zap's swaps and gas.
Inputs: usdc_needed (required), wallet_address (required). Returns: steps, action, params, expected, +3 more
verify_gblin_authorizationARead-onlyIdempotentInspect
Checks a signed GBLIN authorization against the chain before any gas is spent on it. Recovers the signer from the EIP-712 digest (and asks the wallet itself through ERC-1271 when the payer is a contract), then checks the validity window against on-chain time, whether the nonce has already been used or cancelled, and whether the payer still holds the amount. Returns a verdict and the ready calldata when it would settle, the failing reason when it would not. These are the checks an x402 facilitator runs, so a 'would_settle' verdict means the payment can be carried.
Inputs: signature (required), authorization (required), method. Returns: amount, checks, digest, method, +4 more
verify_risk_attestationARead-onlyIdempotentInspect
Verifies a GBLIN Risk Attestation, the object returned by GBLIN's /api/x402/attestation, or a proof-of-diligence attached by a peer agent. Free. Runs four checks: (1) integrity, by recomputing the EIP-712 attestation_id; (2) authenticity, by recovering the signer when a signature is present and comparing it with GBLIN's published attestor; (3) freshness, against on-chain time (10-minute validity); (4) live drift, by comparing the attested regime with the current on-chain regime.
Inputs: attestation (required), expected_attestor. Returns: live, valid, checks, source, +3 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 21 tools
The core read/prepare/simulate/verify split is clear, but several tools overlap: invest_usdc_to_gblin and swap_gblin_to_usdc_jit are essentially special cases of prepare_action's mint_with_usdc and exit_to_usdc, and quote_safe_swap overlaps both preview_steps and the mint/redeem previews. analyze_treasury_health and plan_treasury also both compute runway/surplus/blockers, so an agent can plausibly pick either for the same question. Descriptions do help disambiguate intent (convenience calldata vs. generic builder), which keeps this from scoring lower.
Nearly all tools are snake_case and verb-led (get_*, prepare_*, verify_*, analyze_*, plan_*), with a readable get_/prepare_/verify_ role split. Deviations exist: how_to_seal_paid is a question rather than an action, and quote_safe_swap / swap_gblin_to_usdc_jit / relay_gblin_payment mix different verb-noun shapes. Still broadly predictable.
21 tools sits in the heavy band for a protocol SDK surface, and a few earn their place only marginally: how_to_seal_paid is pure documentation, share_skill_with_peer is a referral helper, and the two convenience swap tools duplicate prepare_action paths. The domain genuinely spans vault ops, x402 payments, receipts, risk and governance, so the breadth is defensible, but the set could shed 3-5 tools without loss.
Coverage is strong end-to-end: state/history/governance reads, quotes, plan and prepare, step simulation, relay execution, and post-hoc transaction status, plus receipt sealing and offline-verifiable attestations. Gaps are minor: governance is read-only (no propose/execute/cancel timelock operations), receipts are fetch-by-index only with no enumeration, and signed authorizations can be verified but not cancelled. These are workaroundable rather than dead ends.
Maintenance
Related MCP Connectors
Pay-per-call AI infra for agents: DeFi market data, LLM inference, STT/TTS. x402 v2, USDC on Base.
Pay-per-call crypto market intelligence for AI agents. USDC on Base via x402.
USDC/x402 agent marketplace. Verified Base mainnet pilot, testnet and public enrollment.
DeFi pool yield+security intelligence & token/contract risk scanner. USDC on Base via x402.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that provides real-time access to Chainlink's decentralized on-chain price feeds, optimized for seamless integration into AI agents and autonomous systems.57MIT
- AlicenseAqualityAmaintenanceManage Uniswap and Aerodrome liquidity positions with leverage, automated rebalancing, and yield optimization on Base and Unichain.37497 npm5AGPL 3.0
- AlicenseAqualityBmaintenanceEight crypto and DeFi data tools for AI agents: prices, gas, one ParaSwap route quote, GoPlus token security and top-holder samples, DefiLlama yields, Hyperliquid/dYdX funding, and observed wallet balances. Inspect prices free; pay 0.001–0.008 USDC per call on Base through x402. No API key or subscription.8107 npmMIT
- AlicenseNot gradedqualityDmaintenanceOnchain agent-to-agent commerce protocol using x402 and ERC-8004. Enables AI agents to buy/sell services, manage vendor catalogs, and process payments on Base.MIT