Xpersona
W

WebMCP Adapter Creator

CLAWHUB · Unverified

Create fallback site adapters for websites that do not expose native WebMCP. Use when a site needs a new adapter module, tool schema design, browser-side req...

62
Rank
84
Safety
1.0k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s1769rm50f8wvzw550m22hg10x83gkem:webmcp-adapter-creator
  1. Install using `clawhub skill install s1769rm50f8wvzw550m22hg10x83gkem:webmcp-adapter-creator` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/jolestar/webmcp-adapter-creator before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-jolestar-webmcp-adapter-creator/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

31,777 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: webmcp-adapter-creator
description: Create fallback site adapters for websites that do not expose native WebMCP. Use when a site needs a new adapter module, tool schema design, browser-side request execution, or request-template extraction from observed page behavior.
---

# WebMCP Adapter Creator

Use this skill to create or update a fallback `SiteAdapter` for `@webmcp-bridge/local-mcp`.

## When To Use

Use this skill when:

- the target site does not expose native `navigator.modelContext`
- an existing adapter does not exist yet
- an existing adapter needs new tools, pagination, or request-template refresh
- a site requires browser-side request execution instead of DOM-only scraping

If the user only needs to connect to an existing site through the bridge, use `$webmcp-bridge` instead.

## Prerequisites

- The target site URL is known.
- The user can authenticate in the browser profile if the site requires login.
- `pnpm` is installed for local package work.
- `npx playwright install` has already been run in the current environment when Playwright browsers are not present.

## Core Workflow

1. Confirm the site really needs a fallback adapter:
   - check whether native `navigator.modelContext` already exists
   - if native WebMCP exists, stop and use `$webmcp-bridge` instead of writing an adapter
2. Scaffold a new adapter package when starting from scratch:
   - `skills/webmcp-adapter-creator/scripts/scaffold-adapter.sh --name <site> --host <host> --url <url>`
3. Fix the contract first:
   - implement `manifest`
   - implement `createAdapter()`
   - keep all payloads JSON-serializable
4. Design the tool surface before coding extraction logic:
   - use stable product names such as `tweet.get`, `timeline.home.list`, `user.get`
   - put parameter details in schema field descriptions, not only in tool descriptions
5. Prefer browser-side request execution over server-side credential replay:
   - run requests in the page context so the site's own auth/session state is reused
   - do not move cookies or bearer tokens into local-mcp
6. Discover stable request templates from real page behavior:
   - trigger the target action in the page
   - observe the network request shape
   - extract a reusable request template with placeholders for ids, cursors, queries, or feature flags
7. Implement fallback layers explicitly:
   - first try browser-side network/template execution
   - for assistant/chat products, prefer intercepting the product's real request/response path over reading rendered text
   - if network execution is unavailable or the template is missing, fall back to DOM extraction when safe
   - include `source` and `reason` fields so callers can see which path ran
   - when a helper is cross-site and not product-specific, prefer putting it in a shared adapter utility package instead of copying it into one adapter
   - for long prompts, prefer one-shot DOM insertion into the real composer and use incremental `type()` or `fill()` only as a

_meta.json

{
  "ownerId": "kn76v1w3vse2yfx3k4dkkbn9bd81xemv",
  "slug": "webmcp-adapter-creator",
  "version": "0.1.1",
  "publishedAt": 1774368637399
}

references/adapter-runtime-patterns.md

# Adapter Runtime Patterns

These patterns come from real adapter work where a site's UI was not stable enough to support a DOM-first implementation.

Use them when a fallback adapter needs authenticated reads or writes that are driven by browser-side requests.

## 1. Prefer Real Request Interception Over Reconstructed Fetch

If the page already knows how to make the request, intercept that real request before trying to reconstruct it yourself.

Why:

- manually replaying auth-heavy requests often fails even when URL and body look correct
- dynamic headers, transaction ids, and internal conversation state are easy to miss
- the page's own request shape is usually the most reliable source of truth

Recommended order:

1. intercept the real browser request
2. inspect whether the intercepted response already contains the data you need
3. only fall back to manual in-page replay if interception cannot expose the response body

## 2. `route.fetch()` Is Better Than DOM Guessing For Streamed Responses

For some sites, the request is normal HTTP but the response is streamed or chunked.

In this case:

- CDP `getResponseBody` may return nothing useful
- DOM extraction often captures intermediate UI text instead of the final answer
- `page.route(..., route => route.fetch())` can still read the real response text

Recommended pattern:

1. intercept the real request with `page.route`
2. skip preflight `OPTIONS`
3. call `route.fetch()`
4. read the response text
5. parse the stream format
6. `route.fulfill({ response })` so the page still behaves normally

This lets the adapter observe the site's real response while preserving the page's normal execution path.

## 3. Treat Sessions As First-Class Tool Inputs

If the upstream product has a session or conversation concept, the adapter should expose it explicitly.

Do not rely on "whatever page is currently open" as the conversation source.

Recommended tool contract:

- default behavior creates a new session
- optional `conversationId` continues an existing session
- return `conversationId` in successful results

This makes agent behavior reproducible and avoids hidden context leaks between calls.

## 4. New Session Must Be Explicit, Not Implicit

If the tool should start a fresh session when no session id is supplied, make that an explicit browser action.

Example pattern:

1. open the product landing route
2. detect the current session id from the URL or page state
3. click `New Chat` or equivalent
4. wait until the previous session id disappears or changes
5. only then send the new request

Do not assume that navigating to the same route automatically starts a new session.

## 5. Parse The Protocol, Not The Rendered Text

For assistant-like products, the DOM often exposes:

- thinking text
- partial tokens
- button labels
- suggestion chips
- replay artifacts

If the response stream contains structured events, parse those instead of reading visible text.

Look for fields such as:

- event type
- message tag
- 

references/network-discovery.md

# Network Discovery

Discover the site's real read or write interface by observing actual browser behavior.

## Goal

Capture the request that the page already knows how to make, then reuse that shape from the page context.

This is usually more stable than trying to reconstruct auth headers or cookies outside the browser.

## Discovery Procedure

1. Open the target page in a real logged-in browser session.
2. Trigger one concrete action that matches the tool you want.
3. Observe network traffic and identify the request that produced the result.
4. Record the stable parts:
   - URL path
   - method
   - request body or query structure
   - variables payload
   - feature flags or toggles
   - cursor location for pagination
5. Record the variable parts separately:
   - item id
   - user id or screen name
   - query string
   - cursor
   - limit or count
6. Check whether the same request shape works across several examples.

## What To Look For

Look for a request shape that is:

- initiated by page code, not by a browser extension
- repeatable across multiple actions
- parameterized in obvious places
- valid inside `page.evaluate()` or in-page fetch

## Good Signals

Good candidates usually have:

- one stable endpoint path
- one stable request method
- a JSON variable payload that changes only in a few fields
- cursors embedded in response entries or metadata

## Bad Signals

Avoid anchoring the adapter on:

- volatile DOM class names alone
- one-off bootstrap responses that are not repeatable
- requests that only appear once during initial hydration and cannot be replayed in-page
- headers or tokens captured outside the browser and replayed from local-mcp

## Browser-Side Principle

The goal is not to emulate the site's auth model in Node.js.
The goal is to let the page execute the request while the browser session already holds the necessary auth state.

references/request-template-patterns.md

# Request Template Patterns

Turn one successful observed request into a reusable template.

## Template Shape

A practical template usually needs:

- `url`
- `method`
- a sanitized header subset when required by in-page fetch
- stable query parameters or body sections
- placeholders for variable fields

For pagination-capable reads, also define:

- where the incoming cursor goes
- where the next cursor is extracted from the response

## Extraction Strategy

1. Capture one successful request.
2. Remove values that should not be hard-coded forever.
3. Keep only the minimal stable request shape.
4. Replace changeable values with adapter-level variables.

Typical variable fields:

- `tweetId`
- `userId`
- `screenName`
- `query`
- `cursor`
- `count`

## Execution Pattern

Inside the adapter, execute the request from the page context:

- build the next request URL or body from the template
- inject variable fields
- call `fetch()` in the page context
- parse the JSON response
- extract `items` and optional `nextCursor`

## Fallback Pattern

When there is no captured template yet, or the request fails after an upstream site change:

- return `source: "dom"`
- include a concrete `reason`, such as `no_template` or `request_failed`
- fall back to DOM extraction only if the DOM path is still meaningful

## Cache Scope

Template caching should be explicit.

Reasonable cache scopes:

- page lifetime cache for one navigation session
- process-level cache for repeated reads in one bridge process

Refresh the template when:

- the page navigates to a materially different route
- the request starts failing in a way that suggests upstream changes
- response parsing no longer matches the previous shape

Sponsored

Ads related to WebMCP Adapter Creator and adjacent AI workflows.