|
| 1 | +<img width="1440" height="480" alt="MCP Pointer banner" src="https://github.com/user-attachments/assets/a36d2666-e848-4a80-97b3-466897b244f7" /> |
| 2 | + |
| 3 | +[](https://github.com/etsd-tech/mcp-pointer/actions/workflows/ci.yml) |
| 4 | +[](https://github.com/etsd-tech/mcp-pointer/actions/workflows/release.yml) |
| 5 | +[](https://www.npmjs.com/package/@mcp-pointer/server) |
| 6 | +[](https://github.com/etsd-tech/mcp-pointer/releases) |
| 7 | +[](https://github.com/etsd-tech/mcp-pointer/blob/main/LICENSE) |
| 8 | + |
| 9 | +# 👆 MCP Pointer |
| 10 | + |
| 11 | +**Point to browser DOM elements for agentic coding tools via MCP!** |
| 12 | + |
| 13 | +MCP Pointer is a *local* tool combining an MCP Server with a Chrome Extension: |
| 14 | + |
| 15 | +1. **🖥️ MCP Server** (Node.js package) - Bridges between the browser and AI tools via the Model Context Protocol |
| 16 | +2. **🌐 Chrome Extension** - Captures DOM element selections in the browser using `Option+Click` |
| 17 | + |
| 18 | +The extension lets you visually select DOM elements in the browser, and the MCP server makes this **textual context** available to agentic coding tools like Claude Code, Cursor, and Windsurf through standardized MCP tools. |
| 19 | + |
| 20 | +## ✨ Features |
| 21 | + |
| 22 | +- 🎯 **`Option+Click` Selection** - Simply hold `Option` (Alt on Windows) and click any element |
| 23 | +- 📋 **Complete Element Data** - Text content, CSS classes, HTML attributes, positioning, and styling |
| 24 | +- ⚛️ **React Component Detection** - Component names and source files via Fiber (experimental) |
| 25 | +- 🔗 **WebSocket Connection** - Real-time communication between browser and AI tools |
| 26 | +- 🤖 **MCP Compatible** - Works with Claude Code and other MCP-enabled AI tools |
| 27 | + |
| 28 | +## 🎬 Usage example (video) |
| 29 | + |
| 30 | +https://github.com/user-attachments/assets/98c4adf6-1f05-4c9b-be41-0416ab784e2c |
| 31 | + |
| 32 | +See MCP Pointer in action: `Option+Click` any element in your browser, then ask your agentic coding tool about it (in this example, Claude Code). The AI gets complete textual context about the selected DOM element including CSS properties, url, selector, and more. |
| 33 | + |
| 34 | +## 🚀 Getting Started |
| 35 | + |
| 36 | +> **Note:** Chrome extension is not yet published on Chrome Web Store. You'll need to build and install it manually for now. |
| 37 | +
|
| 38 | +### 1. Configure the MCP Server |
| 39 | + |
| 40 | +Use npx to automatically configure the MCP server with your AI tool: |
| 41 | + |
| 42 | +```bash |
| 43 | +# Configure MCP Pointer for your AI tool |
| 44 | +npx -y @mcp-pointer/server config claude # Automatically configures Claude Code |
| 45 | +npx -y @mcp-pointer/server config cursor # Opens Cursor deeplink for automatic installation |
| 46 | +npx -y @mcp-pointer/server config windsurf # Automatically updates Windsurf config file |
| 47 | +npx -y @mcp-pointer/server config manual # Shows manual configuration for other tools |
| 48 | +``` |
| 49 | + |
| 50 | +> **Optional:** You can install globally with `npm install -g @mcp-pointer/server` to use `mcp-pointer` instead of `npx -y @mcp-pointer/server` |
| 51 | +
|
| 52 | +After configuration, **restart your coding tool** to load the MCP connection. |
| 53 | + |
| 54 | +### 2. Install Chrome Extension |
| 55 | + |
| 56 | +**Option A: Download from Releases (Recommended)** |
| 57 | + |
| 58 | +1. Go to [GitHub Releases](https://github.com/etsd-tech/mcp-pointer/releases) |
| 59 | +2. Download `mcp-pointer-chrome-extension.zip` from the latest release |
| 60 | +3. Extract the zip file to a folder on your computer |
| 61 | +4. Open Chrome → Settings → Extensions → Developer mode (toggle ON) |
| 62 | +5. Click "Load unpacked" and select the extracted folder |
| 63 | +6. The MCP Pointer extension should appear in your extensions list |
| 64 | +7. **Reload web pages** to activate the extension |
| 65 | + |
| 66 | +**Option B: Build from Source** |
| 67 | + |
| 68 | +1. Clone this repository |
| 69 | +2. Follow the build instructions in [CONTRIBUTING.md](./CONTRIBUTING.md) |
| 70 | +3. Open Chrome → Settings → Extensions → Developer mode (toggle ON) |
| 71 | +4. Click "Load unpacked" and select the `packages/chrome-extension/dist/` folder |
| 72 | +5. **Reload web pages** to activate the extension |
| 73 | + |
| 74 | +### 3. Start Using |
| 75 | + |
| 76 | +1. **Navigate to any webpage** |
| 77 | +2. **`Option+Click`** any element to select it |
| 78 | +3. **Ask your AI** to analyze the targeted element! |
| 79 | + |
| 80 | +Your AI tool will automatically start the MCP server when needed using the `npx -y @mcp-pointer/server start` command. |
| 81 | + |
| 82 | +**Available AI Tools:** |
| 83 | +- `getTargetedElement` - Get comprehensive info about the selected element |
| 84 | +- `clearTargetedElement` - Clear the current selection |
| 85 | +- `getPointerStatus` - Check system status and statistics |
| 86 | + |
| 87 | +## 🎯 How It Works |
| 88 | + |
| 89 | +1. **Element Selection**: Content script captures `Option+Click` events |
| 90 | +2. **Data Extraction**: Analyzes element structure, CSS, and framework info |
| 91 | +3. **WebSocket Transport**: Sends data to MCP server on port 7007 |
| 92 | +4. **MCP Protocol**: Makes data available to AI tools via MCP tools |
| 93 | +5. **AI Analysis**: Your assistant can now see and analyze the element! |
| 94 | + |
| 95 | +## 🎨 Element Data Extracted |
| 96 | + |
| 97 | +- **Basic Info**: Tag name, ID, classes, text content |
| 98 | +- **CSS Properties**: Display, position, colors, dimensions |
| 99 | +- **Component Info**: React component names and source files (experimental) |
| 100 | +- **Attributes**: All HTML attributes |
| 101 | +- **Position**: Exact coordinates and dimensions |
| 102 | +- **Source Hints**: File paths and component origins |
| 103 | + |
| 104 | +## 🔍 Framework Support |
| 105 | + |
| 106 | +- ⚛️ **React** - Component names and source files via Fiber (experimental) |
| 107 | +- 📦 **Generic HTML/CSS/JS** - Full support for any web content |
| 108 | +- 🔮 **Planned** - Vue component detection (PRs appreciated) |
| 109 | + |
| 110 | +## 🌐 Browser Support |
| 111 | + |
| 112 | +- ✅ **Chrome** - Full support (tested) |
| 113 | +- 🟡 **Chromium-based browsers** - Should work (Edge, Brave, Arc - load built extension manually) |
| 114 | + |
| 115 | +## 🐛 Troubleshooting |
| 116 | + |
| 117 | +### Extension Not Connecting |
| 118 | + |
| 119 | +1. Make sure MCP server is running: `npx -y @mcp-pointer/server start` |
| 120 | +2. Check browser console for WebSocket errors |
| 121 | +3. Verify port 7007 is not blocked by firewall |
| 122 | + |
| 123 | +### MCP Tools Not Available |
| 124 | + |
| 125 | +1. Restart your AI assistant after installing |
| 126 | +2. Check MCP configuration: `mcp-pointer config <your-tool>` |
| 127 | +3. Verify server is running: `npx -y @mcp-pointer/server start` |
| 128 | + |
| 129 | +### Elements Not Highlighting |
| 130 | + |
| 131 | +1. Some pages block content scripts (chrome://, etc.) |
| 132 | +2. Try refreshing the page |
| 133 | +3. Check if targeting is enabled (click extension icon) |
| 134 | + |
| 135 | +## 🚀 Roadmap |
| 136 | + |
| 137 | +### 1. **Dynamic Context Control** |
| 138 | + - LLM-configurable detail levels (visible text only, all text, CSS levels) |
| 139 | + - Progressive refinement options |
| 140 | + - Token-conscious data fetching |
| 141 | + |
| 142 | +### 2. **Enhanced Framework Support** |
| 143 | + - Vue.js component detection |
| 144 | + - Better React support (React 19 removed `_debugSource`, affecting source mapping in dev builds) |
| 145 | + |
| 146 | +### 3. **Visual Content Support** (for multimodal LLMs) |
| 147 | + - Base64 encoding for images (img tags) |
| 148 | + - Screenshot capture of selected elements |
| 149 | + - Separate MCP tool for direct visual content retrieval |
| 150 | + |
| 151 | +## 📝 License |
| 152 | + |
| 153 | +MIT License - see LICENSE file for details |
| 154 | + |
| 155 | +## 🤝 Contributing |
| 156 | + |
| 157 | +We welcome contributions! Please see our [CONTRIBUTING.md](./CONTRIBUTING.md) guide for development setup and guidelines. |
| 158 | + |
| 159 | +--- |
| 160 | + |
| 161 | +*Inspired by tools like [Click-to-Component](https://github.com/ericclemmons/click-to-component) for component development workflows.* |
| 162 | + |
| 163 | +--- |
| 164 | + |
| 165 | +**Made with ❤️ for AI-powered web development** |
| 166 | + |
| 167 | +*Now your AI can analyze any element you point at with `Option+Click`! 👆* |
0 commit comments