# Agent discovery (0.4.0)

Select **Browse only** or **Shopping enabled** in **WooCommerce → Agentomise**. Native purchases require **Shopping enabled** and a compatible, tested gateway. The plugin advertises a public connection document at `rest_url('wacc/v1/server')` (normally `/wp-json/wacc/v1/server`). It uses the [official registry schema](https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json) and includes the store's canonical Streamable HTTP MCP URL, title, reverse-domain name and plugin version. It contains no customer data or secrets.

Normal theme pages advertise the document with an HTML `link rel="alternate"` and an HTTP `Link` header. The `/mcp-server.json` alias is relative to the WordPress home and requires server routing to WordPress; the REST URL works with plain permalinks too. The alias and link convention are not a universal MCP web-discovery standard. Crawlers must choose to follow them, and chat products may require a user-approved connection. Disabling shopper access removes advertisements and prevents public document access. Cached pages may retain old links, but cannot bypass endpoint access checks.

An agent that follows a link reads `remotes[0].url`, connects using Streamable HTTP, discovers tools, searches products, creates a private cart, obtains an exact quote and requests customer/payment approval before checkout. Neither discovery nor registry publication supplies payment authorisation or bypasses customer authentication. Existing WooCommerce payment extensions remain responsible for payment processing.

## MCP protocol paths

Legacy clients retain the MCP `2025-06-18` initialize handshake. Modern clients use `2026-07-28` with no handshake, following the [versioning specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/versioning) and [HTTP binding](https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-http).

Example modern discovery POST to the MCP endpoint:

```http
Content-Type: application/json
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
Mcp-Method: server/discover
```

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "server/discover",
  "params": {
    "_meta": {
      "io.modelcontextprotocol/protocolVersion": "2026-07-28",
      "io.modelcontextprotocol/clientCapabilities": {}
    }
  }
}
```

Every modern request repeats version/capabilities metadata and matching version/method headers. `tools/call` also requires `Mcp-Name` matching `params.name`. Discovery returns supported versions, tools capability, server identity and shopping instructions. Modern results carry `resultType: complete` and server identity metadata. Unsupported versions return HTTP 400 / -32022; header mismatches return HTTP 400 / -32020. Unknown modern methods return HTTP 404 / -32601. No server-initiated operations, SSE subscriptions or administrator tools are advertised.

## Merchant-controlled registry publication

1. Test the public HTTPS endpoint, including your gateway's approved flow.
2. Download **registry server.json** from WooCommerce → Agentomise. Export is capability checked, POST-only and nonce protected. Review the generated name, domain, endpoint and version. Separate WordPress homes under a domain receive a path-derived suffix to avoid collisions. Local and IP-based names are development previews; use your real domain before publishing.
3. Install `mcp-publisher` from the [official quickstart](https://modelcontextprotocol.io/registry/quickstart).
4. Follow the official [DNS or HTTP authentication instructions](https://modelcontextprotocol.io/registry/authentication) for the domain namespace in your document. Generate and keep registry signing keys on your own machine, outside WordPress. The plugin does not collect keys or change DNS.
5. In the directory containing the reviewed `server.json`, run `mcp-publisher publish`. Confirm the resulting listing. Republish whenever endpoint metadata/version changes. Registry publication is a separate operation, not performed by downloading the document or enabling the plugin.

Registry discovery depends on the buyer's software consulting the registry. Publication does not automatically install a connection in ChatGPT, Copilot or every MCP agent. The registry is currently described as a preview by its maintainers.
