nanoodle-mcp
Build a multi-model media pipeline visually at nanoodle.com — then hand the whole pipeline to your agent as ONE typed tool.
Skill or MCP? Running (or designing) a single workflow? The
nanoodle skill is one
command and no setup. This server is for when you've built up a folder
of saved graphs and want each one exposed to your agent as its own tool.
Point this MCP server at a folder of noodle-graph.json saves from the
nanoodle editor and every graph becomes a callable tool with a derived input
schema — in Claude Code, Grok, Claude Desktop, Cursor, VS Code, Windsurf, or
anything else that speaks the Model Context Protocol.
It speaks stdio to your own agent by default, or HTTP to everyone with
serve mode — including
charging per call in Nano, so strangers'
agents can pay to run your noodles with no account anywhere — or
selling runs for native NEAR, custom workflows included.
No middleman server, no telemetry — and with wallet mode,
no account either. The MCP implementation here is hand-rolled (stdio +
streamable HTTP, JSON-RPC 2.0 — small enough to read). Two runtime dependencies:
nanoodle (MIT), the zero-dep
workflow executor that does all the heavy lifting, and
nanocurrency (GPL-3.0) for
signing Nano blocks — loaded only on the x402 paths, see
Licensing. Your NanoGPT API key goes straight from your
machine to nano-gpt.com; it is never logged and never
appears on stdout.
NEAR HACKATHON entry
Built at NEAR HACKATHON (2026-11-01 to 2026-11-14), track
agents (Agent Economy). Only the NEAR integration described here is the entry; the rest
of this README documents the product it was added to.
What it is. nanoodle-mcp is an MCP server that runs nanoodle workflow graphs
(multi-step pipelines of NanoGPT text, image, video, audio and 3D models) as tools. In the
hackathon it gained a NEAR payment rail: an AI agent composes its own workflow, gets an
itemized price for free, pays with one native NEAR transfer, receives the result, and gets
the unused part of its deposit back on chain. A second piece, a worker for
NEAR Agent Market, sells the same workflow runs as market jobs.
Problem. An agent that wants to run a paid multi-model pipeline needs an account and
an API key at the provider, and cannot tell what a multi-step run will cost before it
starts. A fixed price per call means the buyer overpays or the seller loses money on
expensive runs.
How NEAR fits. NEAR carries the payment and the refund. The quote comes back inside
the MCP tool answer: a payment id, the receiving account, an exact yoctoNEAR amount and a
30-minute expiry. The agent sends one native Transfer. The server reads that transaction
from NEAR RPC at FINAL finality, checks the receiver, the exact amount, the single action,
the timing and that the hash was not used before, runs the workflow once, and signs a
refund transfer of the deposit minus the actual cost. Finality in 2–3 seconds and gas of
about 0.000045 NEAR per transfer make a deposit and refund per call practical. This is not
x402: there is no HTTP 402 and no facilitator, only an in-band MCP quote paid by a plain
transfer. Design and threat model: docs/near-payments.md.
Status.
- Offline: the whole payment flow passes against a local NEAR chain stand-in and a local
NanoGPT stand-in (35 checks), and the market worker passes against a local market
stand-in that checks every request and answer against the market's OpenAPI file
(30 checks).
- Real testnet, read-only: the transaction checker and the server's own payment verifier
read a real testnet transfer from public RPC and pass (step 4 below).
- Live mainnet, verified 2026-11-13: connect to https://near.nanoodle.com/mcp.
Quotes pay
nanoodle.near; the server detects the transfer, runs the workflow using
the shared Nano funding pool, and sends unused NEAR back to the payer. A real
0.003192 NEAR payment
was detected without submitting its hash, a text workflow succeeded, and
0.00318950963855421686747 NEAR was refunded
at FINAL finality. All 13 payment/receipt/refund checks passed. Custom and saved workflows paid in NEAR and USDC also passed automatic
discovery, execution, same-asset refund and replay;
USDC verification includes the
payment and refund transactions. The primary endpoint
at mcp.nanoodle.com continues to default to Nano.
- Market: workers poll the live marketplace for five configured listings. Song, Image,
Character and Clip are publicly visible; the custom-workflow profile is not verified
published. Owner access is needed to finish that listing. No paid production hire
has been verified in this check.
- NEAR mode first ships in npm version 0.7.0. Until
npm view nanoodle-mcp version shows
0.7.0 or later, run it from a clone as below.
Try it: do X, see Y. Node 22.23.5+, 24.22.3+ or 26.13.1+. Steps 1–3 need no network
after npm ci, and no keys or funds.
git clone -b near-hackathon https://github.com/nanoodlecom/nanoodle-mcp && cd nanoodle-mcp && npm ci
| Do |
See |
1. npm run simulate:near |
The real server binary starts in NEAR mode against local stand-ins. An agent prices a custom text → llm → image graph, gets a quote, pays one transfer, receives the image and a receipt, and the rest of the deposit is refunded. Then replay, a reused transaction, an unsafe node, an unpriceable model, underpayment, a late payment, a failed run and a server killed mid-run and mid-refund. Ends PASS: all 35 checks passed. |
2. npm run simulate:market |
The Agent Market worker runs as a child process against a local market stand-in: a normal job, an unsafe graph, an over-budget graph, a malformed brief, a kill and restart mid-run, and a lost submit answer. Ends 30/30 checks passed. |
3. npm test |
The full offline test suite. Ends with ℹ fail 0 (705 tests when this was written). |
4. node scripts/near-check-tx.mjs --network testnet --rpc https://archival-rpc.testnet.fastnear.com --merchant tx-bench-buddy.testnet --tx 7wg9AhBTJvKoLCTvdwACzxjLdoPACFXV9hKD12aAxYZp --sender tx-bench.testnet --amount-yocto 1 |
Read-only, no keys. The payment rules the server applies (final, succeeded, receiver, one Transfer, exact amount) and the server's own verifier, run on a real public testnet transfer of 1 yoctoNEAR between two accounts unrelated to this project. Ends PASS — 7/7 rules passed. The archival RPC is used because public RPC nodes drop transactions after a few days. |
| 5. Real testnet payment and refund (maintainer-run; moves testnet NEAR, needs two funded testnet accounts and, for the last variant, a NanoGPT key) |
Prove it on testnet: two scripts create the accounts, pay a quote, check the refund on chain and print explorer links. --dry-run stops before the first transfer. |
Built in the hackathon window, and before. The diff of the entry is
compare/pre-hackathon...near-hackathon
(branch near-hackathon). The pre-hackathon tag is the last commit on main before the
NEAR work (2026-11-06). Commits on main between the hackathon announcement (2026-10-19)
and that tag are Nano-payment and maintenance work; they are counted as baseline and not
claimed.
- Before: the nanoodle workflow engine (
nanoodle)
and this server: saved graphs as typed MCP tools, BYOK, pay per call in Nano (x402),
serve mode, the hosted server, and run_noodle for share links.
- In the window:
src/near/: NEAR RPC client, payment verification, refund signing (ed25519 with
node:crypto, transactions serialized by hand), exact yoctoNEAR math, NEAR/USD rate,
durable payment ledger.
src/custom-workflow.mjs: the safety allowlist and itemized pricing for workflows an
agent composes.
src/near-gate.mjs: the NEAR payment gate, run_noodle with an inline graph, the
free price_noodle and noodle_guide tools.
src/market/ and scripts/market-*: the NEAR Agent Market worker, its listing catalog
and price check (docs/near-agent-market.md).
scripts/near-simulate.mjs, scripts/near-check-tx.mjs, scripts/near-pay.mjs,
scripts/near-testnet-*.mjs, the tests for all of the above, and the docs.
src/near/rates.mjs: NEAR/USD, XNO/USD and the NEAR→XNO swap rate derived from
them, an optional swap margin, background and forced refresh, GET /rates; receipts
with three money legs (caller payment, model payment, refund) and per-call operator
accounting in the ledger.
src/rail-router.mjs and scripts/dual-simulate.mjs: one server that accepts Nano or
NEAR per call (--charge-usd together with --near-merchant).
Declarations.
- Baseline (own, pre-hackathon, MIT): the nanoodle engine and the nanoodle-mcp server.
- Libraries: the two Node runtime dependencies predate the hackathon:
nanoodle (MIT, own) and nanocurrency (GPL-3.0, Nano signing; see
Licensing). Server-side NEAR verification and signing use Node built-ins.
The wallet payment page bundles NEAR Connect 0.12.0 (MIT, HOT Labs), with esbuild
as a build tool; both are pinned development dependencies. See assets/README.md.
- AI-generated code: most of the code, tests and documentation in the hackathon diff were
written with AI coding assistants, directed by the maintainer.
- Other chains: the pre-existing product accepts payment in Nano (XNO) through x402. That
is not part of the entry.
- External services the NEAR code calls: public NEAR RPC (fastnear by default), CoinGecko
for the NEAR/USD rate (can be pinned with
--near-usd), NanoGPT for the models, and, in
the testnet scripts only, the NEAR testnet account helper.
Example: a description becomes a playable fighter
Play Iron Verdict: a furnace knight
with heavy jumps, punches, ground slams and punishing arena combat. A coding
agent built the game using the
character-sprites skill.
The character-sprites graph turns a humanoid description into a character
reference and a matching parts sheet. The skill's local rig script turns those
parts into transparent idle, walk, punch and jump frames with an atlas and
timing metadata. The coding agent then implements physics, combat and game
rules. The finished game demonstrates that combination; one MCP call returns
the reference and parts images, not the complete game.
Mount the character-sprites graph
in your server's graph folder to expose it as a tool. Use tools/list to check
whether a given server has it mounted and read its input schema before calling.
For the published graph, the generation step is:
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"character-sprites","arguments":{"Character":"A compact furnace knight with an ivory helmet, amber visor, navy armor and brass gauntlets. Outlined 2D platformer art. No weapon or wings."}}}
Install the skill for local extraction and animation (Node 22.23.5+, 24.22.3+, or 26.13.1+ and ffmpeg/ffprobe
required). A useful agent request is: “Use character-sprites to make an animated
fighter from my description, inspect the joints and alpha edges, then build a
small playable arena with heavy gravity and impactful combat.”
Install
You need: Node 22.23.5+, 24.22.3+, or 26.13.1+, a folder of saved graphs (say ~/noodles — see
Making graphs), and a nano-gpt.com
API key in NANOGPT_API_KEY (or passed via --key / --env-file) — or no
key at all with a Nano wallet, see
wallet mode.
Optional: ffmpeg on PATH. Tools whose graphs include a local-media node
(resize, video frames, combine, audio trim/extract) use a pure-JS path for the
common case but fall back to ffmpeg/ffprobe for formats it can't handle —
JPEG/WebP resize, reading video frames, compressed audio. Without ffmpeg those
runs fail (and auto-refund in charge mode); the server prints a warning at
startup naming the affected tools. Pure image/LLM/vision tools don't need it.
Install with apt install ffmpeg (Debian/Ubuntu) / brew install ffmpeg.
Claude Code
claude mcp add nanoodle --env NANOGPT_API_KEY=your-key-here -- npx -y nanoodle-mcp --graphs ~/noodles
Or install it as a plugin — Claude Code prompts for your noodles folder and
API key, and also learns what a noodle is (this repo doubles as a plugin
marketplace):
/plugin marketplace add nanoodlecom/nanoodle-mcp
/plugin install nanoodle@nanoodle
Grok
grok mcp add nanoodle -e NANOGPT_API_KEY=your-key-here -- npx -y nanoodle-mcp --graphs ~/noodles
Or, for a remote/serve endpoint (no local process, no API key on your machine):
grok mcp add --transport http noodles https://mcp.nanoodle.com/mcp