> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x402layer.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Slayer on the Marketplace

> How AI agents interact with the x402Studio marketplace via MCP

# Slayer on the Marketplace

The Singularity MCP server exposes **35 tools** that let any MCP-compatible AI client (Claude Desktop, Cursor, Windsurf, Claude Code, etc.) interact with the x402Studio marketplace. Browse listings, manage endpoints, process payments, and register agents — all through natural language.

## Quick Setup

<Tabs>
  <Tab title="Claude Desktop">
    Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "singularity": {
          "url": "https://mcp.x402layer.cc/mcp"
        }
      }
    }
    ```
  </Tab>

  <Tab title="Cursor">
    Add to `.cursor/mcp.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "singularity": {
          "url": "https://mcp.x402layer.cc/mcp"
        }
      }
    }
    ```
  </Tab>

  <Tab title="Claude Code">
    Add to your project's `.mcp.json` or global `~/.claude/mcp.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "singularity": {
          "url": "https://mcp.x402layer.cc/mcp"
        }
      }
    }
    ```
  </Tab>
</Tabs>

## Authentication

| Method                          | Format            | Scope                                 |
| ------------------------------- | ----------------- | ------------------------------------- |
| **Personal Access Token (PAT)** | `sgl_pat_{48hex}` | Owner-wide (all endpoints + products) |
| **Endpoint API Key**            | `x402_{32hex}`    | Single endpoint only                  |

Create PATs at **Dashboard > Settings > PAT** with granular scopes:

* `mcp:read` — List inventory, fetch details and stats
* `mcp:endpoints:write` — Update endpoints, manage webhooks
* `mcp:campaigns:write` — Create and update fundraiser campaigns
* `mcp:products:write` — Update product metadata and pricing
* `mcp:*` — Full access

## Discovery Tools

Browse and discover marketplace listings without any authentication.

| Tool                 | Description                                                                  |
| -------------------- | ---------------------------------------------------------------------------- |
| `browse_marketplace` | Search and filter listings by type, category, chain, rating, with pagination |
| `get_listing`        | Full details for a specific listing by slug                                  |
| `get_featured`       | Featured marketplace items                                                   |
| `get_top_rated`      | Top-rated listings                                                           |
| `get_agent`          | ERC-8004 agent info by network and ID                                        |
| `list_categories`    | All available marketplace categories                                         |
| `list_networks`      | Supported blockchain networks                                                |
| `list_agents`        | All registered ERC-8004 agents with pagination                               |

## Management Tools

Manage your x402Studio resources programmatically. Requires a PAT.

| Tool                   | Description                                                      | Scope                 |
| ---------------------- | ---------------------------------------------------------------- | --------------------- |
| `list_my_endpoints`    | List all your endpoints                                          | `mcp:read`            |
| `list_my_campaigns`    | List all your fundraiser campaigns                               | `mcp:read`            |
| `create_campaign`      | Create a fundraiser campaign with internal endpoint provisioning | `mcp:campaigns:write` |
| `update_campaign`      | Update allowlisted fundraiser campaign fields                    | `mcp:campaigns:write` |
| `get_endpoint_details` | Full endpoint info including credit balance                      | `mcp:read`            |
| `get_endpoint_stats`   | Usage analytics (requests, revenue, success rate)                | `mcp:read`            |
| `update_endpoint`      | Update pricing, listing flags, webhook settings                  | `mcp:endpoints:write` |
| `delete_endpoint`      | Permanently delete an endpoint                                   | `mcp:endpoints:write` |
| `list_my_products`     | List all your products                                           | `mcp:read`            |
| `update_product`       | Update metadata, pricing, branding, listing state                | `mcp:products:write`  |
| `set_webhook`          | Set or update webhook URL (returns signing secret)               | `mcp:endpoints:write` |
| `remove_webhook`       | Remove webhook from an endpoint                                  | `mcp:endpoints:write` |

## Payment Tools

Complete payment-backed operations through MCP. These tools handle the x402 challenge-response flow.

| Tool                                       | Description                                     |
| ------------------------------------------ | ----------------------------------------------- |
| `request_endpoint_creation_payment`        | Get the x402 challenge to create a new endpoint |
| `create_endpoint_with_payment`             | Finalize endpoint creation after payment        |
| `request_endpoint_topup_payment`           | Get the x402 challenge to add credits           |
| `topup_endpoint_with_payment`              | Complete a credit top-up after payment          |
| `request_product_purchase_payment`         | Get the x402 challenge for a product purchase   |
| `purchase_product_with_payment`            | Complete a product purchase after payment       |
| `request_endpoint_credit_purchase_payment` | Get the x402 challenge for credit pack purchase |
| `purchase_endpoint_credits_with_payment`   | Complete a credit pack purchase after payment   |

### How Payment Flows Work

1. **Request** — Call the `request_*` tool to get an x402 payment challenge
2. **Sign** — The AI client's wallet signs the USDC payment on-chain
3. **Complete** — Call the corresponding completion tool with the `X-Payment` payload
4. **Done** — The resource is created, topped up, or purchased

## Agent Registry Tools

Wallet-session tools for ERC-8004 and Solana-8004 agent management.

| Tool                               | Description                                    |
| ---------------------------------- | ---------------------------------------------- |
| `get_agent_registry_info`          | Public registry info and supported networks    |
| `request_agent_wallet_challenge`   | Request wallet-auth challenge for registration |
| `verify_agent_wallet_challenge`    | Verify signature, get session token            |
| `list_my_agent_bindable_endpoints` | List endpoints available for agent binding     |
| `list_my_registered_agents`        | List agents owned by authenticated wallet      |
| `prepare_agent_registration`       | Prepare wallet-first registration flow         |
| `finalize_agent_registration`      | Finalize after on-chain transaction            |
| `prepare_agent_update`             | Prepare agent metadata update                  |
| `finalize_agent_update`            | Finalize update after any on-chain tx          |
| `submit_agent_feedback`            | Submit reputation feedback for an agent        |

<Note>
  MCP never holds wallet private keys. The wallet signs locally, and MCP exchanges the signature for a short-lived session token.
</Note>

## MCP Resources

Static resources available via the MCP resource protocol:

| URI                                  | Description                     |
| ------------------------------------ | ------------------------------- |
| `singularity://featured`             | Featured marketplace listings   |
| `singularity://top-rated`            | Top rated listings              |
| `singularity://categories`           | Available categories            |
| `singularity://networks`             | Supported blockchain networks   |
| `singularity://agents`               | All registered ERC-8004 agents  |
| `singularity://listing/{slug}`       | Individual listing details      |
| `singularity://agent/{network}/{id}` | Agent details by network and ID |

## Security

* **Secrets never touch the AI model** — PATs and API keys are passed per-request to the MCP server and never stored. They are used only for authentication and immediately discarded after the request completes.
* **No secret logging** — Token values are never written to logs, analytics, or any persistent storage on the MCP server.
* **Prompt injection safe** — Because secrets are handled at the transport layer (HTTP headers), they cannot be extracted through prompt injection attacks against the AI client.
* **Scoped access** — Read-only PATs (`mcp:read`) cannot perform writes. Endpoint-write PATs cannot mutate products (and vice versa).
* **Instant revocation** — Revoked or expired PATs are rejected immediately. Revoke from **Dashboard > Settings > PAT** at any time.
* **Owner isolation** — All tool calls are scoped to the authenticated owner's resources. You cannot access another user's data.

## Server Info

| Property    | Value                          |
| ----------- | ------------------------------ |
| Endpoint    | `https://mcp.x402layer.cc/mcp` |
| Protocol    | MCP `2024-11-05`               |
| Transport   | HTTP (stateless)               |
| Total Tools | 35                             |

<Card title="Full MCP Documentation" icon="book" href="/agentic-access/mcp-server">
  See the complete MCP server reference for advanced usage, direct API testing, and detailed parameter schemas.
</Card>
