# swarm-x402-mcp [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/swarm-agent-operator/swarm-x402-mcp  
**GitHub Stars:** 0  
**npm Downloads (last month):** 373  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/swarm-x402-mcp

## Description
Pay-per-call x402 services from SWARM: repo scans, web research. USDC on Base.

## Tools
Capabilities this server exposes over MCP:

- **code_health** — $0.05
- **summary** — $0.75
- **report** — $0.99
- **utilities** — $0.02
- **site_check** — $0.002
- **read_page** — $0.002

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "swarm-x402-mcp": {
    "command": "npx",
    "args": ["-y","swarm-x402-mcp"],
    "env": {
      "SWARM_WALLET_KEY": "",
      "SWARM_MAX_USD": ""
    }
  }
}
```

**Requires environment variables:** `SWARM_WALLET_KEY`, `SWARM_MAX_USD` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What swarm-x402-mcp does

swarm-x402-mcp exposes six paid SWARM services through MCP. The tools cover several small, focused tasks:

- `code_health` scans a public GitHub repository for TODO/FIXME debt, oversized files, possible secrets, and general repository hygiene. It costs $0.05 per call.
- `summary` researches a topic on the live web and returns a one-page brief with linked sources for $0.75.
- `report` produces a longer Markdown research report with linked sources for $0.99.
- `utilities` handles operations such as UUID generation, hashing, Base64 conversion, URL encoding, password generation, and timestamps for $0.02.
- `site_check` checks a URL's HTTP status, redirect destination, response time, and TLS errors for $0.002.
- `read_page` retrieves readable page text after removing menus, scripts, and markup for $0.002.

Each tool performs a network request to SWARM's shop. These are paid operations rather than local, read-only MCP resources.

## How it works

For every call, the server first obtains SWARM's x402 quote and verifies that the payment network is Base mainnet and that the amount stays within the configured maximum. When a wallet key is available, the official `@x402/fetch` client signs and sends the USDC payment. SWARM verifies the payment, performs the requested work, and settles it only after the work succeeds.

The server returns failed calls as normal tool results with `isError: true`. The result identifies whether the payment was not charged, was charged, or has an unknown status. The server does not retry automatically. A settled payment includes a transaction hash; an uncertain payment status should be checked against the wallet before another call. Signed x402 payments use an EIP-3009 nonce and cannot be settled twice.

Without `SWARM_WALLET_KEY`, the tools can still list and quote services, but they do not pay for or complete paid calls.

## Setup and configuration

Node.js 20 or newer is required. Install the package through `npx` and configure it as a stdio MCP server. Claude Code can use a command such as:

```bash
claude mcp add --transport stdio swarm --env SWARM_WALLET_KEY=0x… --env SWARM_MAX_USD=1 -- npx -y swarm-x402-mcp
```

Cursor and Claude Desktop use an MCP configuration with `npx -y swarm-x402-mcp` as the command and the wallet settings in `env`.

`SWARM_WALLET_KEY` holds the private key for the wallet paying on Base. Use a dedicated wallet containing only a small USDC balance. `SWARM_MAX_USD` sets the highest price the server will accept before signing; its default is `1`. Calls priced above that threshold are rejected before payment authorization.

AgentCash can also add the service with `npx agentcash add https://swarm-agent.net`.

## Tools and capabilities

The research tools use the live web and include source links in their results. URL-oriented tools separate availability checks from content extraction: `site_check` reports connection details, while `read_page` returns cleaned text. Repository analysis accepts a public GitHub URL rather than local files. The utility endpoint groups several encoding, identifier, hashing, credential, and time-related operations behind an operation parameter.

Prices are attached to individual calls: $0.05 for `code_health`, $0.75 for `summary`, $0.99 for `report`, $0.02 for `utilities`, and $0.002 each for `site_check` and `read_page`.

## Limitations and notes

The wallet key is payment authority, so it should not be placed in a broadly funded wallet. A retry after `charged: no` signs a new payment. If the result says `charged: yes`, do not pay again; use the receipt transaction hash when contacting SWARM. If it says `charged: unknown`, inspect the wallet before retrying.

The server targets Base mainnet for x402 payments. Its services depend on the SWARM shop and network access, and the research and page-reading tools operate against live web content.

_Full upstream README: https://allmcps.com/mcp/swarm-x402-mcp/readme_

