PetaSats

io.github.BSVanon由 GitHub 账号 BSVanon 发布v0.2.16更新于 Nov 7, 2026

Buy BSV with USDC on Base through a local non-custodial MCP server.

已验证STDIO仅桌面金融AI 与机器学习

概览

AI 生成的概览

本地非托管的 MCP 服务器,让 AI 助手在 Base 上用 USDC 报价并兑换 BSV,密钥始终留在你自己的机器上。

可以做什么
  • 报价与查看钱包:get_quote、wallet_info、list_liquidity、fund_wallet(仅报价)。
  • 执行与跟踪兑换:swap_asset_to_bsv、wait_for_swap、swap_status。
  • 转出资金:withdraw_bsv 与 withdraw_base。
  • 控制支出:stop_spending 立即停止新的兑换与提现,需在命令行恢复。
  • 读取你自建的限额文件,限制收款地址与每日兑换金额。
适用场景
当你希望 AI 助手用 Base 上的 USDC 买入 BSV 并发送到指定地址,同时密钥与签名都留在本地时使用。适合在你自设限额下的小额兑换(约 5 至 100 美元),不适合大额或高频交易。
运行要求
需要 Node.js 22 或更高版本,通过 npx 以 stdio 在本地运行。首次启动会在 ~/.petasats 生成密钥(可用 PETASATS_HOME 更改位置)。需向 wallet_info 显示的 Base 地址转入 Base 上的 USDC 和少量 ETH 作手续费。未声明需要 API 密钥或账户。
安装前请注意
涉及真实资金:swap_asset_to_bsv、withdraw_bsv、withdraw_base 会转出资金,且兑换一旦开始不会再请求确认。请备份 keys.json,它是唯一副本,同一 kit 目录只运行一份。可选的快速结算若做市商双花,可能损失兑换金额。限额文件只能约束无法编辑文件或执行命令的 AI。兑换期间保持服务器运行,一次只做一笔兑换。

安装

在 SourceWeft 中

  1. 打开 控制台中的 PetaSats,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[PetaSats]

PetaSats MCP

Buy BSV with USDC on Base from your AI app through a local, non-custodial MCP server.

What it does

PetaSats supports USDC on Base to BSV only. Keys are made and kept on your machine.

  1. You lock USDC in the swap contract on Base.
  2. The market maker locks BSV.
  3. The kit verifies the lock against a merkle proof and block headers, then claims BSV and reveals the secret.
  4. The market maker uses that secret to claim USDC.

Swaps are about $5 to $100. Each buyer may make three swaps and $200 per day; a shared daily total also applies. Standard speed is the default and waits for one BSV confirmation. An explicit speed: "fast" request can reduce that wait for at most $25 only when both sides agree.

Install and connect

Use Node.js 22 or newer. Every command here runs this release, [email protected]. Use one version in your client's entry and in terminal commands; to move to a later release, change it while no swap is running and restart the client.

sh
claude mcp add petasats -- npx -y [email protected]

Claude Desktop (claude_desktop_config.json), Cursor (~/.cursor/mcp.json):

json
{"mcpServers":{"petasats":{"command":"npx","args":["-y","[email protected]"]}}}

VS Code (.vscode/mcp.json):

json
{"servers":{"petasats":{"type":"stdio","command":"npx","args":["-y","[email protected]"]}}}

Codex (CLI, IDE extension, or app):

sh
codex mcp add petasats -- npx -y [email protected]

Any client that starts local stdio servers can use command npx and args -y [email protected]. First start creates keys in ~/.petasats; PETASATS_HOME changes that location. Back up keys.json: it is the only copy. Run only one copy of a kit home, because two copies of the same keys can each sign Base payments the other cannot see.

Fund the kit

wallet_info shows the Base address. Send it USDC on Base and a little ETH for gas; 0.0002 ETH covers many swaps.

Use it

Ask: “Buy $20 of BSV and send it to 1...”

ToolMoves funds
get_quoteNo
swap_asset_to_bsvYes
wait_for_swapNo
swap_statusNo
wallet_infoNo
stop_spendingNo
withdraw_bsvYes
withdraw_baseYes
fund_walletNo — it only plans a USDC-to-BSV swap and returns a quote
list_liquidityNo

Limits you control

You can create ~/.petasats/limits.json to restrict where an AI may send funds and how much it may swap per UTC day:

json
{  "format": "petasats.limits/1",  "bsvDestinations": ["1BoatSLRHtKNngkdXEeobR76b53LETtpyT"],  "baseDestinations": ["0x1111111111111111111111111111111111111111"],  "maxSwapUsdPerDay": 50,  "allowFastSettlement": false}

Keep this file private to your user account: chmod 600 ~/.petasats/limits.json. The kit refuses a limits file that other users can read or write. It rereads the file before every money operation. A refusal says that it was refused by your limits file and that nothing was sent. Use npx [email protected] limits to inspect it.

stop_spending stops new swaps and withdrawals immediately. Only you can resume with npx [email protected] resume; recovery for swaps already started keeps working.

allowFastSettlement: false forbids fast settlement for new swaps. If the field is missing, an explicitly requested fast swap is permitted to negotiate it; standard remains the default.

These controls protect against an AI that can only use the kit's tools. An AI app that can run shell commands or edit files as you can also edit limits.json or STOP.

Progress and reporting

The server gives the AI an operating guide. With a person watching, it reports one line per stage and a final summary with transaction IDs. For a program it returns only the result. Reporting never holds up a swap, and nothing asks for confirmation after a swap starts.

Safety model

Funds can go only to the swap contract on Base, the kit’s own addresses, or an address you provide. The kit verifies before reveal. The standard Base gate is 60 confirmations (about 12 seconds). The market maker’s BSV can return about four hours (24 blocks) after lock; your USDC refunds after about 16 hours (288,000 Base blocks) if the swap does not finish. Recovery resumes after restart. Run one swap at a time and keep the server running during a swap.

Fast mode makes the kit reveal its secret against an unconfirmed BSV lock. If the market maker double-spends that lock, you can lose the swap amount. It is available only when both sides agree and the amount is at most $25; otherwise the swap waits for one BSV confirmation. Fast is the buyer’s explicit choice; omitting speed uses standard settlement.

Costs

get_quote shows the rate and comparison with market mid. You pay Base gas in ETH, the BSV claim fee, and a small extra BSV fee with deliver_to. See get_quote for protocol fees.

Verify what you run

The npm package is built by GitHub Actions from a tagged commit and published with npm provenance. Run npm audit signatures; the npm page links the build to its commit and workflow run. dist/petasats-mcp.mjs is not minified. Source under src/ is exported from the development repository for each release with internal development comments removed and internal names replaced by neutral ones; apart from that it is identical.

Files, status, and recovery

The kit uses ~/.petasats. Run npx [email protected] status for status and npx [email protected] recover after interruption.

A Base withdrawal left pending (for example after a fee rise) is re-sent unchanged; new swaps and Base withdrawals wait until it confirms. Run npx [email protected] withdrawals to list pending withdrawals. If a finalized nonce was consumed but its receipt cannot be found, check the transaction in a Base explorer, then explicitly record the outcome with npx [email protected] withdrawal <hash> sent or npx [email protected] withdrawal <hash> not-sent.

Repeating the same Base withdrawal (same asset, amount, and address) within an hour is refused as a likely retry. Do not run two AI apps using the kit on the same folder at the same time.

A swap started with version 0.2.0 or 0.2.1 whose USDC lock never landed can stay at "Waiting for BSV lock" and block new swaps and withdrawals. If no other copy of the kit used the same folder while that swap ran, set PETASATS_RESOLVE_OLD_STUCK_SWAPS=1 in the kit's environment (for example "env":{"PETASATS_RESOLVE_OLD_STUCK_SWAPS":"1"} in your client's server entry) and restart the kit. It then sends a zero-value transaction to its own Base address so the old lock can never land, and marks the swap failed once that transaction is final, usually within 30 minutes. Swaps started with 0.2.2 or later resolve without this setting.

Troubleshooting

busy, limit, rate_limited, unavailable, and declined mean nothing was locked. If keys-file permissions are wrong, restore owner-only access. For RPC trouble, check your network connection and retry.

Security, license, and disclaimer

See SECURITY.md. PetaSats uses the Open BSV License v4; third-party notices are in THIRD_PARTY_NOTICES.md. This is experimental software: use small amounts and there is no warranty.

来源:README.md,提交 a7c22ce

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

12
  1. v0.2.16最新Nov 7, 2026
  2. v0.2.15Nov 5, 2026
  3. v0.2.14Nov 5, 2026
  4. v0.2.12Nov 4, 2026
  5. v0.2.11Nov 4, 2026
  6. v0.2.10Nov 4, 2026
  7. v0.2.9Nov 3, 2026
  8. v0.2.5Oct 31, 2026
  9. v0.2.4Oct 31, 2026
  10. v0.2.3Oct 30, 2026
  11. v0.2.2Oct 30, 2026
  12. v0.2.1Oct 29, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。