Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,14 @@ node packages/local-mcp/dist/cli.js --url https://board.holon.run --headless
Built-in fallback adapter mode:

```bash
webmcp-local-mcp --site x --headless
webmcp-local-mcp --site x --headless --user-data-dir ~/.uxc/webmcp-profile/x
```

For auth-sensitive sites such as `x` and `google`, the recommended first step is a headed
session with a managed profile so local-mcp can bootstrap a normal browser for manual sign-in:

```bash
webmcp-local-mcp --site x --no-headless --user-data-dir ~/.uxc/webmcp-profile/x
```

Deterministic fixture mode:
Expand Down
15 changes: 15 additions & 0 deletions docs/adapters/x.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

`@webmcp-bridge/adapter-x` provides the real fallback adapter for X/Twitter flows when a page does not expose native `navigator.modelContext`.

## Local-mcp session model

When X is used through `@webmcp-bridge/local-mcp`, it is treated as an auth-sensitive site.
The recommended startup path is:

1. start `local-mcp` with `--site x --user-data-dir <profile>` in headed mode
2. let `bridge.session.bootstrap` open a normal browser for manual sign-in when needed
3. let local-mcp reattach to the authenticated profile for page automation

Example:

```bash
webmcp-local-mcp --site x --no-headless --user-data-dir ~/.uxc/webmcp-profile/x
```

## Tools

- `auth.get`: detect `authenticated`, `auth_required`, or `challenge_required`.
Expand Down
3 changes: 2 additions & 1 deletion docs/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- Start local-mcp via CLI:

```bash
node packages/local-mcp/dist/cli.js --site x
node packages/local-mcp/dist/cli.js --site x --no-headless --user-data-dir ~/.uxc/webmcp-profile/x
```

- Use `createWebMcpPageGateway` directly when integrating Playwright manually.
Expand All @@ -20,4 +20,5 @@ node packages/local-mcp/dist/cli.js --site x

- Native WebMCP is preferred automatically.
- If native is unavailable, shim + fallback adapter is used automatically.
- Auth-sensitive adapters such as `x` and `google` now use managed profile bootstrap/attach lifecycle instead of Playwright-driven login startup.
- local-mcp stdio transport now reuses `@modelcontextprotocol/sdk` (`Server` + `StdioServerTransport`) instead of custom framing code.
5 changes: 3 additions & 2 deletions packages/adapter-x/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import { createXAdapter } from "./adapter.js";
export const manifest: AdapterManifest = {
id: "x.com",
displayName: "X",
version: "0.4.0",
version: "0.5.0",
bridgeApiVersion: "1.0.0",
defaultUrl: "https://x.com/home",
hostPatterns: ["x.com", "www.x.com", "*.x.com"],
authPolicy: {
mode: "none",
mode: "bootstrap_then_attach",
authProbeTool: "auth.get",
allowAnonymousTools: true,
Comment on lines 15 to +19
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@webmcp-bridge/adapter-x’s manifest reports version: "0.4.0", but the package.json version is 0.5.0. If consumers rely on manifest.version for diagnostics or compatibility checks, this mismatch can be misleading; consider keeping manifest.version in sync with the package version.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aligned manifest.version with packages/adapter-x/package.json in follow-up commit 6a697be.

},
};

Expand Down
5 changes: 5 additions & 0 deletions packages/local-mcp/test/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ describe("resolveSiteDefinition", () => {
const site = resolveSiteDefinition("x");
expect(site.manifest.defaultUrl).toContain("x.com");
expect(site.manifest.hostPatterns).toContain("x.com");
expect(site.manifest.authPolicy).toEqual({
mode: "bootstrap_then_attach",
authProbeTool: "auth.get",
allowAnonymousTools: true,
});
});

it("resolves fixture site preset", () => {
Expand Down
5 changes: 5 additions & 0 deletions packages/local-mcp/test/sites.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ describe("resolveSiteSource", () => {
const site = await resolveSiteSource({ site: "x" });
expect(site.source).toBe("builtin");
expect(site.id).toBe("x");
expect(site.manifest.authPolicy).toEqual({
mode: "bootstrap_then_attach",
authProbeTool: "auth.get",
allowAnonymousTools: true,
});
});

it("resolves external adapter module by relative path", async () => {
Expand Down
3 changes: 3 additions & 0 deletions skills/webmcp-bridge/references/link-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ This is for one daemon-managed site session. Do not treat it as permission to la

If a site reacts badly to headed/headless switching or browser fingerprint differences, split the profile into separate `cli` and `ui` profiles for that site.

For auth-sensitive sites such as `x` and `google`, the shared profile is also the anchor for
`bridge.session.bootstrap` and later attach-mode reuse. Do not omit `--user-data-dir` for those sites.

## Link Creation Pattern

```bash
Expand Down
5 changes: 5 additions & 0 deletions skills/webmcp-bridge/references/usage-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ board-webmcp-cli nodes.list
command -v x-webmcp-cli
command -v x-webmcp-ui
skills/webmcp-bridge/scripts/ensure-links.sh --name x --site x
x-webmcp-ui bridge.session.status
x-webmcp-ui bridge.session.bootstrap
x-webmcp-cli -h
x-webmcp-cli timeline.home.list -h
```

For auth-sensitive built-in sites such as `x`, expect the first headed run to require manual
sign-in against the managed profile before page tools become available.

## Third-party adapter module

```bash
Expand Down
Loading