# utilsforagents-mcp

MCP server for https://utilsforagents.com. It exposes eight paid utility tools via x402 plus one free feedback tool for feature requests and usability issues. Paid calls can be signed with either a Base EVM wallet or a Solana wallet.

## Available Tools

| Tool | Endpoint | Cost | Description |
|---|---|---|---|
| `json-diff` | `POST /v1/diff` | `$0.003` | Compare two JSON values and return a structured diff |
| `exif-summary` | `POST /v1/image/exif-summary` | `$0.003` | Extract EXIF metadata from a base64-encoded JPEG image |
| `scrub-metadata` | `POST /v1/image/scrub-metadata` | `$0.003` | Strip metadata from a base64-encoded JPEG or PNG image |
| `html-to-markdown` | `POST /v1/html/to-markdown` | `$0.003` | Convert an HTML string to clean Markdown |
| `fetch-markdown` | `POST /v1/html/fetch-markdown` | `$0.003` | Fetch a public URL and convert its HTML to Markdown |
| `fetch-content` | `POST /v1/text/fetch-content` | `$0.003` | Fetch a public URL and extract readable text |
| `url-metadata` | `POST /v1/url/metadata` | `$0.003` | Extract title, Open Graph, Twitter Card, favicon, feeds, and canonical metadata |
| `count-tokens` | `POST /v1/utilities/count-tokens` | `$0.003` | Count tokens for LLM input using exact BPE or estimation |
| `submit-feedback` | `POST /v1/feedback` | `free` | Submit short product or feature feedback without x402 payment |

## Payment Model

Paid utility tools use the x402 protocol with USDC. On a paid call, the MCP server signs the payment challenge using the configured wallet and retries automatically. The API currently advertises payment requirements on Base and Solana mainnet. The `submit-feedback` tool is free and does not trigger x402 payment.

Because this package includes paid tools, you must provide at least one payer key: `EVM_PRIVATE_KEY` or `SOLANA_PRIVATE_KEY`.

## Quick Start

```bash
npx utilsforagents-mcp
```

## Configuration

| Variable | Required | Description |
|---|---|---|
| `EVM_PRIVATE_KEY` | Conditionally | EVM private key for a wallet holding USDC on Base. `0x` prefix is optional. Provide this or `SOLANA_PRIVATE_KEY`. |
| `SOLANA_PRIVATE_KEY` | Conditionally | Solana private key for a wallet holding USDC on Solana mainnet. Accepts base58, `0x` hex, or a JSON byte array such as the contents of `~/.config/solana/id.json`. Provide this or `EVM_PRIVATE_KEY`. |
| `RESOURCE_SERVER_URL` | No | Override the API base URL. Defaults to `https://utilsforagents.com`. |

If both payer keys are present, the MCP server registers both payment schemes and lets the x402 client select the matching requirement returned by the API.

## Claude Desktop

```json
{
  "mcpServers": {
    "utilsforagents": {
      "command": "npx",
      "args": ["-y", "utilsforagents-mcp"],
      "env": {
        "EVM_PRIVATE_KEY": "your_wallet_private_key_here"
      }
    }
  }
}
```

Config path:
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
- Windows: `%APPDATA%\\Claude\\claude_desktop_config.json`
- Linux: `~/.config/Claude/claude_desktop_config.json`

To use Solana instead, replace `EVM_PRIVATE_KEY` with `SOLANA_PRIVATE_KEY` in the `env` block.

## Wallet Setup

1. Create or dedicate a low-balance wallet on Base or Solana.
2. Fund it with a small amount of USDC on the matching network.
3. Export the private key in a supported format.
4. Set `EVM_PRIVATE_KEY` or `SOLANA_PRIVATE_KEY` before starting the MCP server.

Use a dedicated low-balance wallet for this package. Do not use a wallet that holds significant funds.

## Links

- Website: https://utilsforagents.com
- OpenAPI: https://utilsforagents.com/openapi.json
- MCP Registry: https://registry.modelcontextprotocol.io
- Smithery: https://smithery.ai/servers/utilsforagents/utilsforagents-mcp

## License

MIT
