Bacon Services

io.github.afmontoya由 GitHub 账号 afmontoya 发布v0.4.0更新于 Nov 6, 2026

Pay-per-call tools (USDC, x402): background removal, WebP, palette, brand, SEO, WCAG, SVG + cleanup.

概览

AI 生成的概览

让助手按次购买 Bacon Services 的图像与网页分析服务,用你自己钱包中的 Base 链 USDC 付款,并受消费限额约束。

可以做什么
  • 查询与报价:浏览实时服务目录、获取免费报价,并查看钱包与限额状态
  • 处理图像:去背景、缩放并转为 WebP、提取配色、把图像描摹为 SVG、清理并简化 SVG
  • 分析网页:提取品牌信息、SEO 与链接预览元数据,并运行自动化 WCAG 无障碍检查
  • 保存结果:直接返回 JSON,或用 save_to 写入磁盘
适用场景
适合助手偶尔需要图像处理或公开网页分析、又不想注册账号或申请 API 密钥的场景,前提是你愿意用专用钱包按次支付少量 USDC。
运行要求
需要 Node.js 20 或更高版本,通过 npx 在本地运行。需要一个仅存 USDC(Base 链)的专用钱包,通过 BACON_WALLET_KEY_FILE 或 BACON_WALLET_PRIVATE_KEY 提供。用 BACON_MAX_PER_CALL、BACON_MAX_PER_SESSION、BACON_MAX_PER_DAY 设置限额,BACON_CONFIRM 控制付款确认。需要访问 Bacon 与 Base RPC 的网络连接。
安装前请注意
每个付费工具都会从你的钱包支出真实 USDC;BACON_WALLET_PRIVATE_KEY 或密钥文件中的私钥必须妥善保管,建议使用余额有限的专用钱包。付款在本地签名,只发送签名。若付款结果不明,该金额仍计入限额。图像地址与网页地址会发送到 Bacon 的托管服务。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

baconservices-mcp

An MCP server that lets an AI agent buy image work from Bacon Services, one call at a time, paid in USDC on Base over x402 from your own wallet, within spending limits you set. There's no account and no API key: the agent calls a tool, the server checks the price against your limits, signs a USDC payment for exactly that price, and returns the result.

Also listed in the MCP Registry as io.github.afmontoya/baconservices-mcp.

Wallet safety

Your wallet private key stays on your machine. Bacon Services never receives or stores it. Payments are signed locally and are subject to configurable per-call, session, and daily spending limits.

What it sells

ToolDoesPrice (2026-10-17)
remove_backgroundRemoves the background from one photo; returns a transparent PNG at the photo's size0.05 USDC
optimize_imageResizes so the longest side ≤ max_width (64–4096, default 1600) and encodes WebP at quality (40–95, default 80)0.01 USDC
image_paletteThe colours one image is mostly made of, as JSON: up to count (1–12, default 6) hex colours with their share, include_neutrals (default true)0.01 USDC
brand_from_urlReads one public web page (url) and returns its brand as JSON: name, description, logo URLs, colours, fonts, social profiles. No JavaScript runs; robots.txt is respected0.03 USDC
page_metadataReads one public web page (url) and returns its SEO and link-preview metadata as JSON: title and description with lengths, canonical, redirects, robots rules, Open Graph and Twitter cards, headings, JSON-LD types, and a list of issues. Nothing it links to is fetched; robots.txt is respected0.01 USDC
accessibility_checkAn automated WCAG check of one public web page (url) with axe-core: standard (wcag22aa default, or wcag21aa), viewport (desktop default, or mobile). JSON: failing rules with WCAG criteria, element counts and examples, what needs review, and the criteria a person must test. The page's own scripts don't run. Not a certification of WCAG or ADA conformance0.05 USDC
vectorize_imageTraces one image into an SVG of flat-colour paths: colors (2–32, default 16), detail (smooth, balanced or detailed, default balanced). Best for logos and icons0.05 USDC

Image tools take PNG, JPEG or WebP up to 8 MB, as image_url (public https) or image_path (a local file). remove_background, optimize_image and vectorize_image return a signed download link (valid 24 hours); image_palette, brand_from_url, page_metadata and accessibility_check return their JSON result in the tool result. Add save_to to write either kind to disk. Prices come from Bacon's live catalog, and each paid tool states its current price in its description.

image_palette, brand_from_url, page_metadata, accessibility_check and vectorize_image appear once Bacon's catalog publishes them with contract versions. A service the installed package doesn't understand is listed by list_services but can't be called until you update the package.

Free tools:

  • list_services: everything Bacon sells right now, with prices, limits, and whether this version of the package can run it.
  • quote: Bacon's current price for one service, and whether your limits and wallet allow it. Nothing is signed.
  • wallet_status: network, whether a wallet is configured, your limits and what's left of them, and whether you can afford each service (yes/no).

Before you start

  1. Node.js 20 or newer.
  2. A dedicated wallet holding only what you're willing to spend. Fund it with USDC on Base. You don't need ETH: x402 payments are signed authorizations (EIP-3009), and the facilitator pays the gas.
  3. Put the private key in a file that only you can read, for example ~/.bacon/buyer.key. Pointing BACON_WALLET_KEY_FILE at that file keeps the key out of MCP host configs, which are often synced or shared. BACON_WALLET_PRIVATE_KEY also works.

The key never leaves your machine. Only signatures are sent, and only to Bacon. The key is never logged, never written to the spend ledger, and never accepted as a tool argument.

Install

Claude Code

bash
claude mcp add bacon -e BACON_WALLET_KEY_FILE=/home/you/.bacon/buyer.key -- npx -y baconservices-mcp

Add more -e NAME=value pairs for the limits below. Check it with claude mcp list.

Claude Desktop

Settings → Developer → Edit Config (claude_desktop_config.json):

json
{  "mcpServers": {    "bacon": {      "command": "npx",      "args": ["-y", "baconservices-mcp"],      "env": {        "BACON_WALLET_KEY_FILE": "/Users/you/.bacon/buyer.key",        "BACON_MAX_PER_CALL": "0.50",        "BACON_MAX_PER_SESSION": "1.00",        "BACON_MAX_PER_DAY": "5.00"      }    }  }}

On Windows, if npx isn't found, use "command": "cmd" with "args": ["/c", "npx", "-y", "baconservices-mcp"], and write paths as "C:\\Users\\you\\.bacon\\buyer.key". Restart Claude Desktop afterwards.

Cursor, Windsurf and other clients with an mcpServers file

Use the same command / args / env block as Claude Desktop (for Cursor: ~/.cursor/mcp.json or .cursor/mcp.json in a project).

VS Code (.vscode/mcp.json)

VS Code can prompt for the key once and store it securely:

json
{  "inputs": [    { "type": "promptString", "id": "bacon-key", "description": "Bacon buyer wallet private key", "password": true }  ],  "servers": {    "bacon": {      "type": "stdio",      "command": "npx",      "args": ["-y", "baconservices-mcp"],      "env": { "BACON_WALLET_PRIVATE_KEY": "${input:bacon-key}" }    }  }}

Any other MCP client

It's a stdio server: run npx -y baconservices-mcp with the environment below.

Configuration

VariableDefaultMeaning
BACON_WALLET_KEY_FILE—Path to a file containing the buyer wallet's private key.
BACON_WALLET_PRIVATE_KEY—The key itself (set only one of the two). Without either, the free tools still work.
BACON_MAX_PER_CALL0.50Largest single payment, in USDC.
BACON_MAX_PER_SESSION1.00Most this server process may spend.
BACON_MAX_PER_DAY5.00Most spent in any rolling 24 hours, across all processes and restarts.
BACON_CONFIRMautoauto: ask before each payment when the host can; always: refuse to pay when it can't; never: don't ask (for unattended agents; the limits still apply).
BACON_NETWORKbasebase (real USDC, baconservices.com) or base-sepolia (test USDC, a test copy of Bacon).
BACON_API_URL—Only with base-sepolia: the test copy's address.
BACON_PAY_TO—Only with base-sepolia: the test copy's receiving address.
BACON_RPC_URLhttps://mainnet.base.orgRPC used to check your USDC balance before paying.
BACON_LEDGER_DIR~/.baconservices-mcpWhere the spend ledger lives.
BACON_DISCLOSE_BALANCEfalsetrue adds the exact balance and the wallet address to wallet_status.

How your money is protected

All of these checks happen before anything is signed:

  • The price is Bacon's own. Bacon answers each request with an x402 402 that names the price. The server pays only if that price equals Bacon's live catalog price, for that exact endpoint, in Base USDC, to Bacon's receiving address (which is pinned in the package). If any of these can't be verified, it doesn't pay.
  • Your limits. It checks the per-call limit, an optional max_price_usdc on the call, the per-session limit, and the 24-hour limit. The 24-hour total is kept in a local ledger file shared by every process, so restarting the MCP server or running it twice doesn't open a new budget. If the ledger can't be read, nothing is paid. The x402 library's own per-payment cap is set to your per-call limit as a second lock.
  • Funds. It reads your USDC balance first. If it's too low, or the balance can't be read, you get a plain message and nothing is signed.
  • Your approval, where possible. If the MCP host supports it, you're asked "Pay 0.05 USDC on Base to Bacon Services to run remove_background?" Not every host can ask, so the limits are the real boundary.
  • No double payments. Each purchase signs one payment for one request. If the connection drops, the server resends that same signed payment once (Bacon answers a repeat with the same result) and never signs a new one. Asking for the same thing again within 10 minutes returns the earlier result for free, unless you pass allow_repeat: true.
  • Only known services run. New services in Bacon's catalog show up in list_services. They become callable tools only once a version of this package that understands their contract (inputs, outputs, version) is installed.

If Bacon refuses a payment before taking it, the result says "You have not been charged" and the amount goes back to your limits. If the outcome is unknown (for example the connection was lost twice), the result says so and gives Bacon's request id. That amount keeps counting against your limits.

Test money

Production Bacon sells only for real USDC. To try things without real money, run against a local or test copy of Bacon that sells on Base Sepolia:

bash
BACON_NETWORK=base-sepolia BACON_API_URL=http://127.0.0.1:8000 BACON_PAY_TO=0xYourTestPayTo npx -y baconservices-mcp

The package refuses mismatched setups and pays nothing in each case: test money pointed at baconservices.com, real money pointed anywhere else, or a Bacon whose catalog is on a different network.

Develop

bash
npm installnpm test

The tests run against a fake Bacon that checks every payment signature for real. Nothing reaches a network.

Hosted services

This MCP client is open source under the MIT License. Bacon Services' hosted APIs, Agent Commerce services, x402-paid capabilities, infrastructure, and backend implementations are separate services and are not licensed under the MIT License. Use of Bacon Services' hosted APIs and x402 services is governed by the Bacon Services terms.

Support

For MCP, x402, or Agent Commerce support, contact Bacon Services: https://baconservices.com/contact?topic=mcp. Please never send a wallet private key. Bugs in this package can also be reported as issues on its repository.

Trademark notice

The MIT License applies to the source code in this repository only. "Bacon Services," the Bacon Services name, logos, and associated branding are not licensed under the MIT License. No permission is granted to use Bacon Services trademarks, logos, or branding in a way that suggests endorsement, sponsorship, or affiliation. See TRADEMARKS.md.

License

MIT. See LICENSE.

来源:README.md,提交 446b0fb

工具

11

list_services

Lists what Bacon Services sells to agents right now, from its live catalog: each service's price in USDC, network, output, input limits, and whether this installed package can run it (and as which tool). Free.

无需输入参数。

quote

Gets Bacon's current price for one service without paying, and says whether your spending limits and wallet allow it. Free; nothing is signed.

输入参数service必填

wallet_status

Shows the payment network, whether a wallet is configured, your spending limits and what is left of them, and whether the wallet can afford each service (yes/no). Free. The exact balance is shown only if the buyer enabled BACON_DISCLOSE_BALANCE.

输入参数service

remove_background

Remove background

Removes the background from one photo and returns the subject on a transparent background as a PNG, at the photo's own size. Costs 0.05 USDC per call (real money) on Base, paid from the buyer's wallet over x402 after the buyer's spending limits are checked. Input: PNG, JPEG, WEBP, up to 8 MB, at most 4096 px. Give exactly one of image_url or image_path. Output: image/png, as a download link (and a file with save_to).

输入参数save_toimage_urloverwriteimage_pathallow_repeatmax_price_usdc

optimize_image

Optimize image for the web

Resizes one image so its longest side is at most max_width pixels (never enlarging it) and encodes it as WebP at the given quality. Transparency is kept; metadata is not carried over. Costs 0.01 USDC per call (real money) on Base, paid from the buyer's wallet over x402 after the buyer's spending limits are checked. Input: PNG, JPEG, WEBP, up to 8 MB, at most 8000 px. Give exactly one of image_url or image_path. Output: image/webp, as a download link (and a file with save_to).

输入参数qualitysave_toimage_urlmax_widthoverwriteimage_pathallow_repeatmax_price_usdc

image_palette

Image palette

Returns the colours one image is mostly made of, as JSON: up to count colours, most common first, each a hex value with its share of the image and whether it is a neutral. Costs 0.01 USDC per call (real money) on Base, paid from the buyer's wallet over x402 after the buyer's spending limits are checked. Input: PNG, JPEG, WEBP, up to 8 MB, at most 4096 px. Give exactly one of image_url or image_path. Output: JSON, returned in the tool result.

输入参数countsave_toimage_urloverwriteimage_pathallow_repeatmax_price_usdcinclude_neutrals

brand_from_url

Brand from URL

Reads one public web page and returns the brand it publishes about itself, as JSON: name, description, logo image URLs, colours, fonts and social profiles. No JavaScript runs; robots.txt is respected. Costs 0.03 USDC per call (real money) on Base, paid from the buyer's wallet over x402 after the buyer's spending limits are checked. Give url: one public web page (http or https, standard ports). Output: JSON, returned in the tool result.

输入参数urlsave_tooverwriteallow_repeatmax_price_usdc

page_metadata

Page metadata

Reads one public web page and returns what it tells search engines and link previews, as JSON: title and description with lengths, canonical, redirects, robots rules, Open Graph and Twitter cards, headings, JSON-LD types and a list of SEO issues. No JavaScript runs; robots.txt is respected. Costs 0.01 USDC per call (real money) on Base, paid from the buyer's wallet over x402 after the buyer's spending limits are checked. Give url: one public web page (http or https, standard ports). Output: JSON, returned in the tool result.

输入参数urlsave_tooverwriteallow_repeatmax_price_usdc

accessibility_check

Accessibility check

An automated WCAG check of one public web page (axe-core), as JSON: each failing rule with its impact, WCAG criteria, element count and examples; what needs review; and the criteria a person must test. Not a certification of WCAG or ADA conformance. Scripts on the page do not run; robots.txt is respected. Costs 0.05 USDC per call (real money) on Base, paid from the buyer's wallet over x402 after the buyer's spending limits are checked. Give url: one public web page (http or https, standard ports). Output: JSON, returned in the tool result. A result over 256 KB is not shown; pass save_to to keep it.

输入参数urlsave_tostandardviewportoverwriteallow_repeatmax_price_usdc

vectorize_image

Vectorize image

Traces one PNG, JPEG or WebP image into an SVG of filled paths with up to colors flat colours. Best for logos, icons and flat artwork; a photo comes back as a stylised poster, and its SVG is larger than the photo (often two to three times a PNG of it at 16 colours; colors sets the size). The SVG keeps the image's width and height (capped at 4096). Costs 0.05 USDC per call (real money) on Base, paid from the buyer's wallet over x402 after the buyer's spending limits are checked. Input: PNG, JPEG, WEBP, up to 8 MB, at most 8000 px. Give exactly one of image_url or image_path. Output: image/svg+xml, as a download link (and a file with save_to).

输入参数colorsdetailsave_toimage_urloverwriteimage_pathallow_repeatmax_price_usdc

clean_svg

Clean SVG

Cleans and simplifies one SVG and returns it as JSON, with a report (bytes saved, what was removed, warnings). The SVG is rebuilt from an allowlist: scripts, event handlers, animation, links and references outside the file are removed; editor data, unused definitions, hidden and empty elements go; numbers are rounded and path data rewritten short. It looks the same unless simplify is light or strong. The cleaned SVG is result.svg. Costs 0.01 USDC per call (real money) on Base, paid from the buyer's wallet over x402 after the buyer's spending limits are checked. Input: one SVG, up to 1 MB. Give exactly one of svg, svg_url or svg_path. Output: JSON, returned in the tool result. A result over 256 KB is not shown; pass save_to to keep it.

输入参数svgsave_tosvg_urlkeep_idssimplifysvg_pathoverwriteprecisionallow_repeatmax_price_usdc

版本历史

5
  1. v0.4.0最新Nov 6, 2026
  2. v0.3.0Nov 3, 2026
  3. v0.2.0Oct 29, 2026
  4. v0.1.2Oct 18, 2026
  5. v0.1.1Oct 18, 2026

评分

已满足适用检查项的 90%

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

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

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

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分