Metadata-Version: 2.4
Name: x402-mcp
Version: 0.1.0
Summary: MCP client for AI agents — web utilities via x402 micropayments
Project-URL: Homepage, https://github.com/dsr-restyn/x402-tools
Project-URL: Repository, https://github.com/dsr-restyn/x402-tools
Project-URL: Issues, https://github.com/dsr-restyn/x402-tools/issues
Author-email: Dakota Restyn <dakota@restyn.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.11
Requires-Dist: eth-account>=0.13.0
Requires-Dist: fastmcp>=2.0.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: qrcode>=8.2
Requires-Dist: x402[evm,httpx]>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.8.0; extra == 'dev'
Description-Content-Type: text/markdown

# x402-tools

MCP client for AI agents — web utilities via [x402](https://www.x402.org/) micropayments.

No API keys. No accounts. No billing setup. Your wallet pays per call automatically.

## Tools

| Tool | Price | Description |
|---|---|---|
| `fetch_url` | $0.001 | Convert a URL to clean markdown |
| `screenshot_url` | $0.002 | Screenshot a URL as PNG (base64) |

## Setup

```bash
# 1. Generate a wallet and get your MCP config
uvx x402-tools-setup

# 2. Fund your wallet with testnet USDC (free)
#    Follow the instructions from the setup wizard

# 3. Add the MCP config to Claude Code or Cursor
```

### MCP Config

Add to `~/.claude/mcp.json` (Claude Code) or Cursor MCP settings:

```json
{
  "mcpServers": {
    "x402-tools": {
      "command": "uvx",
      "args": ["x402-tools-mcp"],
      "env": {
        "X402_TOOLS_API_URL": "https://your-agora-server.com",
        "EVM_PRIVATE_KEY": "0xYourWalletPrivateKey"
      }
    }
  }
}
```

Your agent gets two tools: `fetch_url` and `screenshot_url`. Payments happen automatically via x402.

## Server

This package is the **client only**. For the API server, see [Agora](https://github.com/dsr-restyn/agora).

## E2E Testing

With a running Agora server and a funded wallet:

```bash
EVM_PRIVATE_KEY=0x... X402_TOOLS_API_URL=http://localhost:4021 \
  uv run python scripts/test_e2e.py
```
