# playbook-mcp-publish

> Playbook: build and publish an MCP server to the official registry. A concise guide from Forge Agent Hub's own publish: the official Go mcp-publisher CLI (not the npm namesake), server.json (100-character description, io.github namespace), GitHub-token login, remotes versus stdio, and version bumps. ?demo=1 returns the table of contents and an excerpt, unpaid.

- URL: https://forge-tools.dentreprise.workers.dev/api/playbook-mcp-publish (GET or POST)
- Price: 3 USDC on Base (3000000 atomic USDC)
- MCP tool: playbook_mcp_publish
- Docs: https://agent-hub.dentreprise.workers.dev/tools/playbook-mcp-publish/

## Parameters

(none)

## Unpaid example

```bash
curl -sS -D - "https://forge-tools.dentreprise.workers.dev/api/playbook-mcp-publish?"
```

## Example 402 challenge

```json
{
  "x402Version": 2,
  "error": "Payment required",
  "resource": {
    "url": "https://forge-tools.dentreprise.workers.dev/api/playbook-mcp-publish",
    "description": "Playbook: build and publish an MCP server to the official registry. A concise guide from Forge Agent Hub's own publish: the official Go mcp-publisher CLI (not the npm namesake), server.json (100-character description, io.github namespace), GitHub-token login, remotes versus stdio, and version bumps. ?demo=1 returns the table of contents and an excerpt, unpaid.",
    "mimeType": "application/json"
  },
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "amount": "3000000",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "payTo": "0x7B8bf45ac6AcbA6D4CFB626b57D3f5fF3C9C89F7",
      "maxTimeoutSeconds": 120,
      "extra": {
        "name": "USD Coin",
        "version": "2"
      }
    }
  ]
}
```

## Example response

```json
{
  "title": "Build and publish an MCP server to the official registry",
  "toc": [
    "1. What you are publishing",
    "2. The official publisher is a Go CLI, not the npm name",
    "3. A valid server.json",
    "4. Login with a GitHub token (no browser required)",
    "5. Stdio package versus the hosted remote",
    "6. Version bumps and expired tokens",
    "7. Check that the version is live"
  ],
  "body": "Full playbook after payment."
}
```

## Free demo / sample

This tool accepts `?demo=1` on the wave-1 worker (labelled sample, HTTP 200, not live data). The first 3 successful real calls per IP per UTC day are also free.

```bash
curl -sS "https://forge-tools.dentreprise.workers.dev/api/playbook-mcp-publish?demo=1"
```

```json
{
  "demo": true,
  "demo_label": "DEMO / SAMPLE — not live data. This is a labelled example response and was not charged.",
  "charged": false,
  "tool": "/api/playbook-mcp-publish",
  "docs": "https://agent-hub.dentreprise.workers.dev/tools/playbook-mcp-publish/",
  "how_to_get_live_data": "Call the same URL without demo=1. The first 3 successful real calls per IP per UTC day are free; after that attach an x402 v2 PAYMENT-SIGNATURE (USDC on Base).",
  "sample": {
    "title": "Build and publish an MCP server to the official registry",
    "toc": [
      "1. What you are publishing",
      "2. The official publisher is a Go CLI, not the npm name",
      "3. A valid server.json",
      "4. Login with a GitHub token (no browser required)",
      "5. Stdio package versus the hosted remote",
      "6. Version bumps and expired tokens",
      "7. Check that the version is live"
    ],
    "excerpt": "The official publisher is the Go CLI mcp-publisher from the modelcontextprotocol/registry GitHub releases, not the npm package that happens to be named mcp-publisher (that one starts an MCP stdio server). You write a server.json that validates against the official 2025-12-11 schema, log in with mcp-publisher login github --token and a GitHub PAT (this works without a browser), then mcp-publisher publish. Names use the io.github.<org>/<server> namespace; the description field is capped at 100 characters. The rest of this playbook covers remotes versus a stdio package, version bumps, and the expired-token error we had to fix.",
    "demo": true,
    "demo_label": "DEMO / excerpt — not the full playbook."
  }
}
```

## Clients

- JS (x402 v2): `@x402/fetch` + `@x402/evm` (`wrapFetchWithPaymentFromConfig`, `ExactEvmScheme`). The older package `x402-fetch` is deprecated v1.
- Python: PyPI package `x402` (`x402HttpxClient` or `x402_requests`, `register_exact_evm_client`, `EthAccountSigner`).
- MCP: stdio `node src/server.mjs` in [forge-agent-mcp](https://github.com/forge-agent-hub/forge-agent-mcp); hosted Streamable HTTP at https://x402-gateway.forge-x402.workers.dev/mcp (original gateway tools).
- LangChain: wrap those clients with `DynamicStructuredTool` (`@langchain/core`) or `@tool` (`langchain_core`).
- Copy-paste snippets: https://agent-hub.dentreprise.workers.dev/tools/playbook-mcp-publish/ and https://agent-hub.dentreprise.workers.dev/quickstart/
