ui-grab
v0.1.35
Published
Open-source UI context picker for coding agents with built-in Shift multi-select
Maintainers
Readme
ui-grab
UI context picker for coding agents with built-in Shift + click multi-select.
ui-grab keeps the prompt UI and comment history flow, adds built-in Shift + click multi-select, and ships a separate MCP bridge so browser context picking can stay lightweight by default.
Packages
ui-grab: runtime, CLI, and public exports forui-grab/core,ui-grab/primitives, andui-grab/styles.cssui-grab-mcp: optional MCP bridge for editor and agent integrations
Install
Recommended: guided setup
npx ui-grab@latest initui-grab init configures your project and installs ui-grab automatically unless you pass --skip-install.
Manual package install
pnpm add -D ui-grab
# npm
npm install -D ui-grabOptional: local MCP bridge install
pnpm add -D ui-grab-mcp
npm install -D ui-grab-mcpUse the published package names with hyphens: ui-grab and ui-grab-mcp.
If you already installed ui-grab manually with npm install -D ui-grab, npx ui-grab@latest init will still configure your project.
Quick Start
- Run
npx ui-grab@latest initinside your project. - Start your app in development mode.
- Hold
Cmd+Con macOS orCtrl+Con Windows/Linux briefly to activate UI Grab, unless you configured a custom activation key. - Hover an element and click it to copy a single element.
- With UI Grab active, hold
Shiftand click multiple elements to build a grouped selection. - Release
Shift, type into the prompt textarea, and pressEnterto submit.
MCP Bridge
pnpm add -D ui-grab-mcp
npx ui-grab@latest add mcpInstall ui-grab-mcp only if you want an MCP-capable agent to consume UI Grab payloads directly.
- If you only want the in-browser picker, install
ui-graband stop there. - If you want Codex, Cursor, Claude Code, OpenCode, or another MCP-capable agent to read the latest picked UI context, enable the MCP bridge.
ui-grab add mcpwrites agent config files that runui-grab-mcpovernpx.- A project-local
ui-grab-mcpinstall is optional. It is useful when you want to pin the exact MCP version inside a repo or run the server locally yourself.
Manual Setup
Next.js (App Router)
import Script from "next/script";
export default function RootLayout(props: { children: React.ReactNode }) {
return (
<html>
<head>
{process.env.NODE_ENV === "development" && (
<Script
src="https://unpkg.com/ui-grab/dist/index.global.js"
crossOrigin="anonymous"
strategy="beforeInteractive"
/>
)}
</head>
<body>{props.children}</body>
</html>
);
}Next.js (Pages Router)
import Script from "next/script";
import { Head, Html, Main, NextScript } from "next/document";
export default function Document() {
return (
<Html lang="en">
<Head>
{process.env.NODE_ENV === "development" && (
<Script
src="https://unpkg.com/ui-grab/dist/index.global.js"
crossOrigin="anonymous"
strategy="beforeInteractive"
/>
)}
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}Vite
if (import.meta.env.DEV) {
import("ui-grab");
}Webpack
if (process.env.NODE_ENV === "development") {
import("ui-grab");
}Exports
- Runtime entry:
ui-grab - Core API:
ui-grab/core - Primitives:
ui-grab/primitives - Stylesheet:
ui-grab/styles.css - CLI:
ui-grab - MCP bridge:
ui-grab-mcp
Support
- Repository: kyleryu98/ui-grab
- Issues: GitHub Issues
License
UI Grab is distributed under the MIT license. Keep the original copyright notice and license text when redistributing forked code.
