@aioum/mcp
Mirrored from
packages/mcp/README.mdin the repository — edit that file, not this page.
An MCP server that exposes AIOUM marketplace services as tools to any MCP client — Claude Desktop, an agent framework, the OpenAI/Anthropic tool loop. When the client calls a tool, this server pays for and invokes the underlying AIOUM service through a budget-capped agent (@aioum/sdk): pay-per-call, no API keys, and the agent can never spend past its budget.
It also serves the management tools (aioum_status, aioum_agents, aioum_stake_delegate, …):
everything the app can do, driven from Claude. They follow the same contract as the aioum CLI (the
AIOUMControl layer in @aioum/sdk) and read the same AIOUM_* environment. See Management tools.
How it works
tools/list→ discovers the network's services and maps each to an MCP tool (aioum_<id>__<tool>), with price + reputation in the description. No on-chain setup needed to list.tools/call→ lazily authorizes a budget-capped session key (once), then opens a session, signs a per-call voucher, invokes the tool, and settles on-chain — returning the result plus the amount paid and budget remaining.
Use with Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"aioum": {
"command": "npx",
"args": ["-y", "@aioum/mcp"],
"env": {
"OWNER_KEY": "0x<owner private key>",
"AIOUM_BUDGET": "10 USDC",
"DEPLOYMENTS": "/abs/path/to/deployments.json",
"AIOUM_PRIVATE_KEY": "0x<your wallet key, for staking and the jury>",
"AIOUM_OWNER": "claude",
"AIOUM_INDEXER_URL": "http://127.0.0.1:8549",
"AIOUM_AGENTS_URL": "http://127.0.0.1:8770/runner",
"AIOUM_MULTINODE_URL": "http://127.0.0.1:8556",
"AIOUM_PRIVATE_NODE_URL": "http://127.0.0.1:8770"
}
}
}
}
Claude can now call AIOUM services as tools; each call is paid automatically, capped by AIOUM_BUDGET.
Every AIOUM_*_URL above is its default, so on a local stack only the keys and DEPLOYMENTS are needed;
leave DEPLOYMENTS out and the server still starts, with the management tools that need no chain.
Use with Claude Code
claude mcp add aioum \
-e OWNER_KEY=0x… -e AIOUM_BUDGET="10 USDC" -e DEPLOYMENTS=/abs/path/to/deployments.json \
-e AIOUM_PRIVATE_KEY=0x… -e AIOUM_OWNER=claude \
-- npx -y @aioum/mcp
or, checked into a project as .mcp.json:
{
"mcpServers": {
"aioum": {
"command": "npx",
"args": ["-y", "@aioum/mcp"],
"env": { "DEPLOYMENTS": "./offchain/deployments.json", "AIOUM_OWNER": "claude" }
}
}
}
(keys go in your shell environment, not the file: OWNER_KEY, AIOUM_PRIVATE_KEY and
AIOUM_PRIVATE_NODE_TOKEN are read from the server's environment too.)
Configuration (env)
| Var | Purpose |
|---|---|
OWNER_KEY | Owner EOA private key (funds + authorizes the budget-capped session key). Required for paid calls unless a session key is supplied. |
SESSION_KEY + SMART_ACCOUNT | Session mode: a session key already authorized on a smart account (from the app's Deploy Agents page, or createAgent elsewhere). The server then needs no owner key and can spend at most the key's remaining cap until it expires; renewal happens in the owner wallet, not here. |
AIOUM_BUDGET | Budget cap, e.g. "10 USDC". Default 10 USDC. The server can never spend more. |
AIOUM_EXPIRES | Session-key lifetime, e.g. "24h". Default 24h. |
AIOUM_AUTO_RENEW | 1 (default) auto-re-authorizes a fresh session key when the current one expires; 0 fails paid calls loudly instead. |
AIOUM_RENEW_SKEW_SECONDS | Re-authorize this many seconds before expiry so a call never lands on a just-lapsed key. Default 60. |
DEPLOYMENTS | Path to a deployments.json (the network's, or your local development network's). Otherwise set AIOUM_CHAIN_ID, AIOUM_RPC_URL, AIOUM_NODE_URL, AIOUM_BUNDLER_URL, and the AIOUM_* contract addresses. |
NODE_TOKEN | Bearer token for a token-gated node, if any. |
AIOUM_MINT | Local development network: 1 to mint mock USDC to the owner before setup. |
Session-key expiry
A session key is deliberately short-lived (AIOUM_EXPIRES). Past expiry, every paid call would fail
until the owner re-authorizes. This server handles that automatically: before each call it re-authorizes
a fresh budget-capped key if the current one is within AIOUM_RENEW_SKEW_SECONDS of expiry, and it
retries once if a key lapses mid-flight. Set AIOUM_AUTO_RENEW=0 to opt out and surface expiry as an
error (e.g. if a human should re-approve the budget each period).
Management tools
One tool per AIOUMControl method, all prefixed aioum_. Each returns a short summary line and a
```json block with the structured payload; a failure comes back as an MCP error with one
readable line. Tools marked signs send a transaction from AIOUM_PRIVATE_KEY; tools marked
spends cost money on the runner's or the node's side. The environment each group needs is in the
heading (every URL has a local default, listed under Environment).
Monitor (indexer, agent runner, node URLs; AIOUM_DEPLOYMENTS for balances)
| Tool | What it does |
|---|---|
aioum_status | Probe every part of the stack (including the deposit service: its mode, chain and fee) and report who can plan assistants. |
aioum_planners | The planner listings on the marketplace (any node can run one; paid per planning turn), whether the runner has a key or local model of its own, and the model catalogue: every model a person could plan with, available now or with why not (catalogue[]: model, family, tier, via, available, why). |
aioum_activity | The runner's totals and its latest runs (limit). |
aioum_wallet | Balances of the runner's wallet and, with AIOUM_PRIVATE_KEY, yours. |
Deposits (AIOUM_DEPOSITS_URL; AIOUM_DEPLOYMENTS + AIOUM_PRIVATE_KEY derive the AI wallet, or pass wallet; the key signs a send)
Fund the AI wallet from any chain: whatever is sent to its deposit address, in any asset, arrives
here as USDC and is swept to the wallet, less the fee the quote states. amount is in the asset's own
units ("0.5" ETH); the token's decimals come from aioum_deposit_tokens (18 when unknown).
| Tool | What it does |
|---|---|
aioum_deposit_address | The deposit address, the AI wallet, the chain, the fee, whether the forwarder is deployed, and the service's mode: route where the route provider delivers, direct elsewhere (the local development network among them), where USDC sent to the address is swept to the wallet and nothing else is offered (wallet). |
aioum_deposit_chains | Chains a deposit can route from. On a direct network the service answers 501 with one sentence: "Routes from other chains deliver to Base; on this network send USDC to your deposit address and it is swept to your AI wallet"; aioum_deposit_tokens and aioum_deposit_quote say the same there. |
aioum_deposit_tokens | Assets on a chain, with addresses and decimals (chain, q, limit). |
aioum_deposit_quote | What an amount arrives as: USDC out, the fee, the credit, the route and its time; nothing sent (chain, token, amount, wallet, fromAddress). |
aioum_deposit_send | Quote, then send from your wallet on the source chain (an approval for a token, then the route transaction) and record the deposit (chain, token, amount, wallet). Signs on the source chain and spends the asset. |
aioum_deposit_list | The wallet's deposits with refreshed statuses (wallet). |
aioum_deposit_status | One deposit (id). |
aioum_deposit_sweep | Forward the USDC that has arrived at the deposit address to the wallet now, less the fee; the service's sweeper sends it. The path that works on every network (wallet). |
aioum_deposit_card_partners | Pay by card: the on-ramp partners the deposit service has keys for, how each reports delivery, its fee, and whether this network can take a card payment (partners deliver USDC on Base). |
aioum_deposit_card | Pay by card: a partner's link that delivers USDC to the deposit address, tracked as a deposit (partner, wallet); the person pays on the partner's page. |
Market (AIOUM_INDEXER_URL, AIOUM_AGENTS_URL)
| Tool | What it does |
|---|---|
aioum_services | Search services by words, category and liveness (q, category, liveOnly, limit). |
aioum_service | One service in full (serviceId). |
aioum_operator | An operator's stake, reputation and listings (address). |
aioum_review_request | Ask the runner to review a listing (serviceId, or nodeUrl and key): each tool called with its sample input, the result judged; waits for the end by default (wait, timeoutSeconds); budgetUsdc: a budget of your own, signed by your wallet. One request per listing per day. |
aioum_review_status | A listing's latest review (serviceId): the line, the scores by tool, latency, the price charged, the judge's reasons, when and by whom, what to fix. |
aioum_tools | The tools an agent can pay for right now, with their arguments (q, refresh). |
aioum_refresh_index | Make the indexer re-read the chain and re-probe the nodes. |
Agents (AIOUM_AGENTS_URL, AIOUM_OWNER)
| Tool | What it does |
|---|---|
aioum_agents | List your agents (owner). |
aioum_agent_get | One agent in full (id). |
aioum_super | Prompt first: prompt and budgetUsdc (the budget you are willing to spend) become a Super Agent, fully loose on services, skills and data, pay in any token, the best live planner (said back with why), with a project whose stages that planner proposes; started unless start is false; planner picks one yourself. Spends from that budget. |
aioum_agent_create | Create an agent from a spec, optionally copying a starter first (spec.budget with both caps is required; a starter carries none). The spec's fields: name, description, instructions, mode, planner, plannerService, plannerModel (with anthropic or openai: the model the runner's key or local endpoint plans with), tools, access, deny, skills, skillsAccess, data (memory, files), dataAccess, steps, outputTemplate, budget, schedule, payAcross (pay in any token, default true). |
aioum_agent_update | Change an agent's fields (id, spec). |
aioum_agent_delete | Delete an agent (id). |
aioum_agent_run | Run an agent and wait for the result, spend and receipts (id, input, timeoutSeconds, default 300). Spends from the agent's budget. |
aioum_agent_schedule | Put an agent on a timer or switch it off (id, everyMinutes, input, enabled). |
aioum_agent_publish | List an agent as a paid service (id, priceUsdc, stakeZai). The runner stakes ZAI. |
aioum_agent_unpublish | Take that listing down (id). |
aioum_runs | Recent runs (agentId, limit). |
aioum_run_get | A run's full log: steps, paid calls, receipts, output (runId). |
aioum_run_stop | Stop a run (runId). |
aioum_run_watch | Watch a run as it happens: every step with what the agent is doing, which service, what it cost and the media it made, then how it ended and its spend per service (runId, timeoutSeconds default 300, from to skip steps already seen). |
aioum_spend | What a run, an agent or a project spent per service: runId, or agentId / projectId with period (24h default, 7d, all; a per-day line too). |
aioum_starters | The ready-made agents and pipelines you can start from (kind: agent, pipeline or all), each resolved against what is live, with what it still needs. |
aioum_pipeline_create | Create a pipeline (id) with the budgets you set (budgetUsdc, the project's cap; agentBudgetsUsdc, a cap per agent key): its agents in hiring order (the hired ones published as listings), its project on the lead; input is the brief, start runs it now and turns on the lead's schedule (spends). Refused with the missing parts named. |
aioum_skills | The skills an agent can load: the open-source index (repo, commit, licence) and skills listed on nodes, per use or one-time (q, category, tag, limit); give the ids to aioum_agent_create as skills. |
Projects (AIOUM_AGENTS_URL, AIOUM_OWNER): a brief that outlives one run. One brief, one budget and stages
in order; each stage is a run of the same agent that gets the stage's instruction plus what every earlier stage
produced, and may spend what is left of the project's budget. Links and workspace paths its tools returned are
collected as the stage's artifacts. A failed stage pauses the project; change the stages still to run and resume.
| Tool | What it does |
|---|---|
aioum_project_list | Your projects, or one agent's (owner, agentId). |
aioum_project_get | One project in full: every stage, its run, spend, output and links (id). |
aioum_project_create | Create a project as a draft (agentId, brief, budgetUsdc (required, yours), title, stages: a list of { title?, instruction } or plain strings, or "auto" to let the agent's planner propose 3 to 8; a planner listing is paid one turn, a run of kind plan on the agent). |
aioum_project_start | Run the stages not done yet and wait until it stops (id, wait default true, timeoutSeconds default 600). Spends from the project's budget. |
aioum_project_pause | Let the running stage finish, then stop before the next (id). |
aioum_project_resume | Continue from the first stage not done; a failed stage runs again (id, wait, timeoutSeconds). Spends. |
aioum_project_stages | Replace the stages still to run and/or the budget; done stages stay (id, stages, budgetUsdc). |
aioum_project_optimize | The workflow optimizer: the profile, the planned changes with gain and evidence, the measured and predicted time and cost; apply writes the safe ones to the stages that are not done, again makes a draft copy with them written in (id, apply, again). |
aioum_project_delete | Delete a project; a running stage is stopped, its runs stay (id). |
Sell (AIOUM_MULTINODE_URL, AIOUM_NODE_TOKEN when the node's admin API is token-gated)
| Tool | What it does |
|---|---|
aioum_sell_templates | Browse the service templates (q). |
aioum_sell_config | Assemble a services.json from templates, with the env it needs (names). |
aioum_sell_preview | Try a spec's tool on your node before listing it (spec, tool, args, env). |
aioum_sell_add | List a service from a spec or a template with price, stake and env overrides; pricingMax lets the node raise the price with demand up to that and lower it back. The node stakes ZAI. |
aioum_sell_skill | Sell a skill: the folder with SKILL.md goes on your node and is listed, per use (every load is a paid call) or one-time (an agent pays once and keeps it); dir (a folder here, uploaded), files or nodeDir; mode, price; name, description, category, key, stake. The node stakes ZAI. |
aioum_sell_list | What your node serves now. |
aioum_sell_remove | Delist a service (key). |
aioum_sell_verify_domain | Prove a listing is first-party (domain): the DNS TXT record or /.well-known/aioum.json to add for your node's operator, and whether it is there now. |
Stake (AIOUM_DEPLOYMENTS, AIOUM_RPC_URL; AIOUM_PRIVATE_KEY to sign)
| Tool | What it does |
|---|---|
aioum_stake_operators | Operators you could back, with stake, listings and liveness. |
aioum_stake_positions | What you delegated to each operator and what is claimable. |
aioum_stake_delegate | Back an operator with ZAI (operator, amountZai). Signs. |
aioum_stake_claim | Claim the USDC an operator earned for you (operator). Signs. |
aioum_stake_unstake | Start taking ZAI back (operator, amountZai). Signs. |
aioum_stake_withdraw | Withdraw ZAI after the unbonding period (operator). Signs. |
aioum_stake_request | Ask the network's staking node to review a listing and put the network's ZAI behind it so it goes live (serviceId; wait, timeoutSeconds). Returns the final state, live, rejected or failed, with the reasons. The node's pool signs, not you. |
aioum_stake_requests | Backing requests on the staking node, newest first (operator, serviceId, state, limit). |
Jury (AIOUM_DEPLOYMENTS, AIOUM_RPC_URL; AIOUM_PRIVATE_KEY to sign; salts in ~/.aioum/jury-salts.json)
| Tool | What it does |
|---|---|
aioum_jury_status | The jury's rules and your seat. |
aioum_jury_join | Take a seat by staking ZAI (amountZai). Signs. |
aioum_jury_cases | Disputes with deadlines, votes and your commit/reveal state (limit). |
aioum_jury_commit | Seal a vote; the salt is saved locally (disputeId, nodeAtFault). Signs. |
aioum_jury_reveal | Reveal a sealed vote with its saved salt (disputeId). Signs. |
aioum_jury_finalize | Close a dispute after the reveal period (disputeId). Signs. |
aioum_jury_escalate | Escalate a dispute that missed quorum (disputeId, nodeAtFault). Signs. |
aioum_jury_reward | Claim a juror reward (disputeId). Signs. |
aioum_jury_leave | Start unstaking from the jury (amountZai). Signs. |
aioum_jury_withdraw | Withdraw unlocked jury stake. Signs. |
Private node (AIOUM_PRIVATE_NODE_URL; AIOUM_PRIVATE_NODE_TOKEN or the node's token file)
| Tool | What it does |
|---|---|
aioum_node_status | The node's health and connected providers. |
aioum_node_connect | Connect a provider with an API key, or get an OAuth sign-in link (provider, apiKey, baseUrl, header, prefix). |
aioum_node_disconnect | Disconnect a provider (provider). |
aioum_node_tools | The node's tools. |
aioum_node_call | Call one of them (tool, args). |
aioum_node_memory_add | Remember something on the node (text, kind, tags). |
aioum_node_memory_list | What the node remembers. |
aioum_node_memory_delete | Forget one memory (id). |
aioum_node_memory_forget_all | Wipe every memory. |
aioum_node_schedules | The node's timed jobs. |
aioum_node_schedule_create | Create a job (job: name, steps, intervalSeconds, budgetUsd). |
aioum_node_schedule_run | Run a job now and wait (id). Spends up to the job's budget. |
aioum_node_schedule_toggle | Pause or resume a job (id). |
aioum_node_schedule_delete | Delete a job (id). |
aioum_node_backup_export | Write an encrypted backup to a file (path, passphrase). |
aioum_node_backup_restore | Restore from that file (path, passphrase). |
Amounts are decimal strings ("12000" ZAI, "0.05" USDC); every write returns its tx hash(es). The
server never returns a private key or token.
Environment for the management tools
| Var | Purpose | Default |
|---|---|---|
AIOUM_DEPLOYMENTS | The network's deployments.json (addresses, chain id): needed for staking, the jury and balances. DEPLOYMENTS is accepted too; without either, the server looks for ./deployments.json, ./offchain/deployments.json, ../offchain/deployments.json. | none (no chain tools) |
AIOUM_RPC_URL | Chain RPC. | from deployments, else http://127.0.0.1:8545 |
AIOUM_PRIVATE_KEY | Your wallet, for staking, the jury and balances (OWNER_KEY is used when unset). | none (read-only) |
AIOUM_OWNER | Groups the agents you create. | cli |
AIOUM_INDEXER_URL | The indexer. | http://127.0.0.1:8549 |
AIOUM_AGENTS_URL | Your runner: your own inside your private node, or a shared one. | http://127.0.0.1:8770/runner |
AIOUM_NODE_URL | The demo node. | http://127.0.0.1:8546 |
AIOUM_MULTINODE_URL | The catalogue node whose admin API lists your services. | http://127.0.0.1:8556 |
AIOUM_NODE_TOKEN | Bearer token for that admin API, if the node has one. | none |
AIOUM_FACILITATOR_URL, AIOUM_BUNDLER_URL | Probed by aioum_status. | 8547, 8548 |
AIOUM_PRIVATE_NODE_URL | Your private node. | http://127.0.0.1:8770 |
AIOUM_PRIVATE_NODE_TOKEN | Its bearer token; else the file $PRIVATE_NODE_DIR/token (default ~/.aioum-private/token). | the token file |
AIOUM_DEPOSITS_URL | The deposit service (aioum_deposit_*): deposits from any chain, credited as USDC. | http://127.0.0.1:8551 |
AIOUM_BACKER_URL | The network's staking node (aioum_stake_request, aioum_stake_requests): reviews a listing and backs it with the network's ZAI. | http://127.0.0.1:8552 |
AIOUM_DEBUG | 1 logs the resolved config (secrets masked) to stderr at start. | off |
Run locally
npm install && npm run build
OWNER_KEY=0x... AIOUM_BUDGET="5 USDC" DEPLOYMENTS=../../offchain/deployments.json npm start
# or exercise it as a client:
npm run smoke
License
MIT