Using openwork with chrome mcp

From different-ai/the-factory · View interactive version

Using openwork with chrome mcp is an AI agent skill from the GitHub repository different-ai/the-factory. Drive the OpenWork dev renderer with Chrome MCP and verify workspace UI flows. Triggers when user mentions: - "use Chrome MCP with OpenWork" - "hook up to pnpm dev renderer" - "add an OpenWork workspace through the UI

How to use this skill

Skill file

Skill: using-openwork-with-chrome-mcp

Use this when you need to control the running OpenWork app UI through Chrome MCP, especially the local pnpm dev renderer at localhost:5173.

Quick Usage (Already Configured)

1. Attach to the OpenWork renderer

  1. Run chrome-devtools_list_pages.
  2. Select or navigate to the OpenWork renderer, usually:
  1. Run chrome-devtools_take_snapshot and confirm the page title is OpenWork.

2. Prefer UI actions first

Use snapshots and visible element UIDs:

  1. Click Add workspace.
  2. Click Local workspace.
  3. Click, fill, or press only visible controls from the latest snapshot.
  4. Verify with another snapshot, not assumptions.

Native Folder Picker Limitation

Chrome MCP cannot reliably control the native OS folder picker opened by Select folder.

If the user explicitly provides a folder path and asks to continue through the UI, inject the path into the visible CreateWorkspaceModal React state, then click the now-enabled Create Workspace button.

Inject selected folder into the modal

Run this with chrome-devtools_evaluate_script, replacing path with the explicit folder path:

() => {
  const path = "/absolute/path/to/folder";

  function findFiber(el) {
    const key = Object.keys(el).find((k) => k.startsWith("__reactFiber$"));
    return key ? el[key] : null;
  }

  const placeholder = Array.from(document.querySelectorAll("span")).find(
    (el) => el.textContent?.trim() === "No folder selected yet.",
  );
  if (!placeholder) return { ok: false, reason: "placeholder not found" };

  let fiber = findFiber(placeholder);
  while (fiber && (fiber.elementType?.name || fiber.type?.name) !== "CreateWorkspaceModal") {
    fiber = fiber.return;
  }
  if (!fiber) return { ok: false, reason: "CreateWorkspaceModal fiber not found" };

  const hooks = [];
  let hook = fiber.memoizedState;
  while (hook) {
    hooks.push(hook);
    hook = hook.next;
  }

  const selectedFolderHook = hooks[2];
  const pickingFolderHook = hooks[3];
  if (!selectedFolderHook?.queue?.dispatch) {
    return { ok: false, reason: "selectedFolder dispatch not found" };
  }

  selectedFolderHook.queue.dispatch(path);
  pickingFolderHook?.queue?.dispatch?.(false);

  return { ok: true, dispatchedPath: path };
}

After injection:

  1. Take a fresh snapshot.
  2. Confirm the absolute path is visible where No folder selected yet. was.
  3. Click Create Workspace.
  4. Wait for the new workspace name/path to appear in the sidebar or settings panel.

Verification Checklist

Safety Notes

First-Time Setup (If Not Configured)

  1. Start the OpenWork dev renderer, for example from _repos/openwork/apps/app with pnpm dev.
  2. Ensure Chrome MCP can list pages.
  3. Navigate Chrome MCP to http://localhost:5173 if no OpenWork renderer page is open.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.