🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

xfuel-mcp

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xfuel-mcp

First-party Model Context Protocol (MCP) server for the XFuel Protocol — submit AI inference, quote/price tasks, fetch ZK proofs, and verify them from any MCP client. Runs over stdio or streamable HTTP.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

xfuel-mcp

First-party Model Context Protocol (MCP) server for the XFuel Protocol — the ZK settlement + orchestration layer for AI compute across decentralized GPU networks (DePIN).

It exposes XFuel's core capabilities as MCP tools so any MCP client (Claude Desktop, Cursor, your own agent) can submit AI inference, price tasks, and fetch/verify ZK settlement proofs. Runs over stdio (local) or streamable HTTP (remote/shared).

Zero config: with no env set it talks to XFuel's hosted testnet demo (https://api-testnet.xfuel.app) using the shared, rate-limited public demo key — so npx xfuel-mcp just works.

Install

Add to Cursor npm

  • Cursor — click the badge above (or Settings → MCP → Add), which installs the npx -y xfuel-mcp stdio server.
  • Claude Desktop / Claude Code / other MCP clients — add the JSON under Claude Desktop / Cursor (stdio) below.
  • MCP Registry — published as io.github.xfuel-lab/xfuel-mcp (discoverable in the official registry and aggregators like Glama / mcp.so / PulseMCP).

Tools

ToolPurpose
list_modelsList routable model ids (OpenAI-compatible) — call first for discovery
submit_inferenceSubmit an AI inference task (routed to a GPU provider, settled with a ZK proof)
pay_with_usdcSubmit and pay for inference with USDC over x402 — opt-in (needs a payer key)
get_task_statusPoll a task's status, proof outcome, and fee breakdown
get_proofFetch the SP1 ZK settlement proof for a settled task
verify_proofVerify a proof client-side: integrity + x402 payment-binding re-derivation (+ optional on-chain nullifier read)
quote_taskPreview per-rail pricing (USDC via x402 / TFUEL) — no side effects
get_healthXFuel API health, fee config, supported chains (discovery/diagnostics)

The proof attests settlement metadata + a commitment to the output hash — not inference correctness. verify_proof reports exactly what was checked.

submit_inference settles with the server's default (unpaid/TFUEL) rail and needs no key. pay_with_usdc is the only tool that moves funds — it is inert unless the server is started with XFUEL_PAYER_PRIVATE_KEY, so the default experience stays zero-config.

Quick start

# stdio (default) — talks to the hosted testnet demo with the public demo key
npx xfuel-mcp

# streamable HTTP on :3033
npx xfuel-mcp --http --port 3033

# bring your own key / endpoint
XFUEL_API_KEY=your-key XFUEL_API_URL=https://your-host npx xfuel-mcp

Claude Desktop / Cursor (stdio)

Add to your MCP client config (e.g. claude_desktop_config.json or Cursor's mcp.json):

{
  "mcpServers": {
    "xfuel": {
      "command": "npx",
      "args": ["-y", "xfuel-mcp"],
      "env": {
        "XFUEL_API_KEY": "xfuel-demo"
      }
    }
  }
}

Remote / shared (streamable HTTP)

XFUEL_API_KEY=your-key npx xfuel-mcp --http --port 3033
# → MCP endpoint at http://localhost:3033/mcp  (POST)
# → liveness at http://localhost:3033/health

Point a streamable-HTTP MCP client at http://<host>:3033/mcp. Optionally require a bearer token by setting XFUEL_MCP_AUTH_TOKEN (clients then send Authorization: Bearer <token>).

Configuration

All optional. CLI flags take precedence over environment variables.

EnvCLIDefaultDescription
XFUEL_API_URL--api-urlhttps://api-testnet.xfuel.appXFuel API base URL
XFUEL_API_KEY--api-keyxfuel-demoAPI key (sent as X-API-Key)
XFUEL_MCP_TRANSPORT--stdio / --httpstdioTransport
XFUEL_MCP_PORT--port3033HTTP port (http only)
XFUEL_MCP_AUTH_TOKEN(none)Optional bearer token for the HTTP endpoint
XFUEL_RPC_URL(none)Theta RPC for verify_proof's on-chain nullifier read
ZK_VERIFIER_ADDRESS(none)ZKVerifierSP1 address (paired with XFUEL_RPC_URL)
XFUEL_PAYER_PRIVATE_KEY(none)Enables pay_with_usdc. Env only (never a CLI flag).

See .env.example.

Paying with USDC (x402) — pay_with_usdc

By default the server holds no keys and pay_with_usdc is inert. To let it settle tasks in USDC, start the server with a funded payer wallet:

XFUEL_PAYER_PRIVATE_KEY=0xabc... npx xfuel-mcp

The tool signs an EIP-3009 transferWithAuthorization (USDC) for whatever network the server's x402 challenge specifies (e.g. Base or Base Sepolia) via the SDK's createEip3009Payer — the key never leaves the process. If the server has x402 disabled, the call transparently falls back to the TFUEL rail (no payment is made) and the result reports payment_rail: "tfuel".

Security: this key can spend USDC. Scope it to a low-balance wallet, keep it out of shell history (env/secret store only), and prefer running the server on a trusted host. For agent-held keys, use the xfuel-sdk directly with your own payer instead.

Typical flow

  • list_models → discover valid model ids. quote_task → preview cost.
  • submit_inference (TFUEL, zero-config) or pay_with_usdc (USDC/x402, needs a payer key) → get a task_id.
  • get_task_status → poll until proof_outcome: "valid".
  • get_proof → fetch the proof.
  • verify_proof → confirm integrity + payment binding (set check_nullifier: true with XFUEL_RPC_URL + ZK_VERIFIER_ADDRESS to also read on-chain replay state).

Development

npm install       # installs deps + the local xfuel-sdk (file:../sdk/js)
npm run build     # tsc → dist/
npm start         # node dist/index.js
npm run dev       # tsx watch
npm run inspect   # @modelcontextprotocol/inspector against the built server

Built on the official xfuel-sdk — MCP tools are thin wrappers so behaviour matches the SDK and examples exactly.

Publishing

The xfuel-sdk dependency is pinned to the published range ^0.2.0 (which includes the helpers this server uses: verifyProof, createEip3009Payer, listModels). For local development against the in-repo SDK, temporarily npm install ../sdk/js (or restore file:../sdk/js) — the committed ^0.2.0 is what consumers resolve from npm.

Publish order (npm auth required — npm login):

# 1. Publish the SDK first (the MCP depends on xfuel-sdk@^0.2.0)
cd ../sdk/js && npm publish        # runs build + tests via prepublishOnly

# 2. Publish the MCP
cd ../../xfuel-mcp && npm run build && npm publish

# 3. List in the MCP registry (matches server.json "name" ↔ package.json "mcpName")
#    brew install mcp-publisher   (or grab a release binary)
mcp-publisher login github
mcp-publisher publish             # validates + publishes ./server.json

License

Apache-2.0

Keywords

xfuel

FAQs

Package last updated on 09 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts