Four02 MCP Server
# Four02 MCP Server
Give any AI agent the ability to discover and pay merchants through the [Four02](https://four02.ai) network.
Four02 is the universal commerce layer for AI agents — search, browse, and pay any merchant regardless of which payment protocol they use (x402, ACP, UCP, or none at all).
## Install
### Option A: npx (recommended)
No clone needed. Works with any MCP-compatible client:
```bash
npx four02-mcp-server
```
### Option B: Clone & build
```bash
git clone https://github.com/four02/mcp-server.git
cd mcp-server
npm install
npm run build
```
## Tools
When installed, your AI agent gets five tools:
| Tool | Description |
|------|-------------|
| `four02_search` | Find businesses, services, and APIs by keyword, category, city, or tags |
| `four02_browse_catalog` | Browse a merchant's product/service menu with prices |
| `four02_buy_product` | Purchase from a merchant's catalog (initiates x402 payment) |
| `four02_call_api` | Call a merchant's API endpoint through Four02's payment proxy |
| `four02_merchant_info` | Get detailed merchant info (endpoints, pricing, location, ratings) |
## Configuration
### Claude Desktop
Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
```json
{
"mcpServers": {
"four02": {
"command": "npx",
"args": ["-y", "four02-mcp-server"],
"env": {
"FOUR02_URL": "https://api.four02.ai"
}
}
}
}
```
### Cursor
Add to `.cursor/mcp.json` in your project:
```json
{
"mcpServers": {
"four02": {
"command": "npx",
"args": ["-y", "four02-mcp-server"],
"env": {
"FOUR02_URL": "https://api.four02.ai"
}
}
}
}
```
### Windsurf
Add to `~/.codeium/windsurf/mcp_config.json`:
```json
{
"mcpServers": {
"four02": {
"command": "npx",
"args": ["-y", "four02-mcp-server"],
"env": {
"FOUR02_URL": "https://api.four02.ai"
}
}
}
}
```
### OpenClaw
Add to `~/.openclaw/openclaw.json` under `mcp.servers`:
```json
{
"four02": {
"command": "npx",
"args": ["-y", "four02-mcp-server"],
"env": {
"FOUR02_URL": "https://api.four02.ai"
}
}
}
```
## Environment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| `FOUR02_URL` | `http://localhost:3402` | Four02 facilitator URL |
## Example Usage
Once installed, just talk to your AI agent naturally:
- *"Find me a coffee shop in Charlotte"*
- *"What does Joe's Coffee sell?"*
- *"Order me a latte from Joe's Coffee"*
- *"Find a weather API I can use"*
- *"Call the weather API for New York"*
The agent handles discovery, browsing, and payment — all through natural conversation.
## How It Works
```
Your Agent ──► Four02 MCP Server ──► Four02 Network ──► Merchant
(this package) (facilitator) (any protocol)
```
1. Agent calls `four02_search` to find what it needs
2. Agent browses catalog or checks endpoints with `four02_browse_catalog` / `four02_merchant_info`
3. Agent purchases via `four02_buy_product` or `four02_call_api`
4. Four02 handles the payment (USDC on Base) and proxies the request
5. Agent gets the goods/data/service
## License
MIT
TDQS
Scored across 5 tools
Search, catalog browsing, purchasing, API calling, and merchant info each target a distinct step in the marketplace workflow. Slight overlap exists between four02_merchant_info (returns endpoints, pricing, catalog availability) and four02_browse_catalog (returns catalog items with prices), and buy_product vs call_api both touch payment flows, but descriptions clarify when to use each.
All tools share the four02_ snake_case prefix and are mostly verb_noun (search, browse_catalog, buy_product, call_api). The one deviation is four02_merchant_info, which is noun-based, but it remains readable and unambiguous.
Five tools map cleanly onto the discovery-to-purchase lifecycle: search, inspect merchant, browse catalog, buy, and call API. Each tool earns its place with no redundancy, well within the healthy 3-15 range.
The discovery and purchase-initiation surface is solid, but the payment lifecycle is a dead end: buy_product only initiates payment and there is no tool to verify payment status, confirm an order, or retrieve purchase history. Agents may need to infer completion by re-calling endpoints, which is fragile.