|
| 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 | +### 1. Install Chrome Extension |
| 37 | + |
| 38 | +**🎉 Now available on Chrome Web Store!** |
| 39 | + |
| 40 | +[](https://chromewebstore.google.com/detail/mcp-pointer/jfhgaembhafbffidedhpkmnaajdfeiok) |
| 41 | + |
| 42 | +Simply click the link above to install from the Chrome Web Store. |
| 43 | + |
| 44 | +<details> |
| 45 | +<summary>Alternative: Manual Installation</summary> |
| 46 | + |
| 47 | +**Option A: Download from Releases** |
| 48 | + |
| 49 | +1. Go to [GitHub Releases](https://github.com/etsd-tech/mcp-pointer/releases) |
| 50 | +2. Download `mcp-pointer-chrome-extension.zip` from the latest release |
| 51 | +3. Extract the zip file to a folder on your computer |
| 52 | +4. Open Chrome → Settings → Extensions → Developer mode (toggle ON) |
| 53 | +5. Click "Load unpacked" and select the extracted folder |
| 54 | +6. The MCP Pointer extension should appear in your extensions list |
| 55 | +7. **Reload web pages** to activate the extension |
| 56 | + |
| 57 | +**Option B: Build from Source** |
| 58 | + |
| 59 | +1. Clone this repository |
| 60 | +2. Follow the build instructions in [CONTRIBUTING.md](./CONTRIBUTING.md) |
| 61 | +3. Open Chrome → Settings → Extensions → Developer mode (toggle ON) |
| 62 | +4. Click "Load unpacked" and select the `packages/chrome-extension/dist/` folder |
| 63 | +5. **Reload web pages** to activate the extension |
| 64 | + |
| 65 | +</details> |
| 66 | + |
| 67 | +### 2. Configure MCP Server |
| 68 | + |
| 69 | +One command setup for your AI tool: |
| 70 | + |
| 71 | +```bash |
| 72 | +npx -y @mcp-pointer/server config claude # or cursor, windsurf, and others - see below |
| 73 | +``` |
| 74 | + |
| 75 | +<details> |
| 76 | +<summary>Other AI Tools & Options</summary> |
| 77 | + |
| 78 | +```bash |
| 79 | +# For other AI tools |
| 80 | +npx -y @mcp-pointer/server config cursor # Opens Cursor deeplink for automatic installation |
| 81 | +npx -y @mcp-pointer/server config windsurf # Automatically updates Windsurf config file |
| 82 | +npx -y @mcp-pointer/server config manual # Shows manual configuration for other tools |
| 83 | +``` |
| 84 | + |
| 85 | +> **Optional:** You can install globally with `npm install -g @mcp-pointer/server` to use `mcp-pointer` instead of `npx -y @mcp-pointer/server` |
| 86 | +
|
| 87 | +</details> |
| 88 | + |
| 89 | +After configuration, **restart your coding tool** to load the MCP connection. |
| 90 | + |
| 91 | +> **🔄 Already using MCP Pointer?** Run the config command again to update to auto-updating configuration: |
| 92 | +> ```bash |
| 93 | +> npx -y @mcp-pointer/server config <your-tool> # Reconfigures to always use latest version |
| 94 | +> ``` |
| 95 | +
|
| 96 | +### 3. Start Using |
| 97 | +
|
| 98 | +1. **Navigate to any webpage** |
| 99 | +2. **`Option+Click`** any element to select it |
| 100 | +3. **Ask your AI** to analyze the targeted element! |
| 101 | +
|
| 102 | +Your AI tool will automatically start the MCP server when needed using the `npx -y @mcp-pointer/server@latest start` command. |
| 103 | +
|
| 104 | +**Available MCP Tool:** |
| 105 | +- `get-pointed-element` - Get textual information about the currently pointed DOM element from the browser extension |
| 106 | +
|
| 107 | +## 🎯 How It Works |
| 108 | +
|
| 109 | +1. **Element Selection**: Content script captures `Option+Click` events |
| 110 | +2. **Data Extraction**: Analyzes element structure, CSS, and framework info |
| 111 | +3. **WebSocket Transport**: Sends data to MCP server on port 7007 |
| 112 | +4. **MCP Protocol**: Makes data available to AI tools via MCP tools |
| 113 | +5. **AI Analysis**: Your assistant can now see and analyze the element! |
| 114 | +
|
| 115 | +## 🎨 Element Data Extracted |
| 116 | +
|
| 117 | +- **Basic Info**: Tag name, ID, classes, text content |
| 118 | +- **CSS Properties**: Display, position, colors, dimensions |
| 119 | +- **Component Info**: React component names and source files (experimental) |
| 120 | +- **Attributes**: All HTML attributes |
| 121 | +- **Position**: Exact coordinates and dimensions |
| 122 | +- **Source Hints**: File paths and component origins |
| 123 | +
|
| 124 | +## 🔍 Framework Support |
| 125 | +
|
| 126 | +- ⚛️ **React** - Component names and source files via Fiber (experimental) |
| 127 | +- 📦 **Generic HTML/CSS/JS** - Full support for any web content |
| 128 | +- 🔮 **Planned** - Vue component detection (PRs appreciated) |
| 129 | +
|
| 130 | +## 🌐 Browser Support |
| 131 | +
|
| 132 | +- ✅ **Chrome** - Full support (tested) |
| 133 | +- 🟡 **Chromium-based browsers** - Should work (Edge, Brave, Arc - load built extension manually) |
| 134 | +
|
| 135 | +## 🐛 Troubleshooting |
| 136 | +
|
| 137 | +### Extension Not Connecting |
| 138 | +
|
| 139 | +1. Make sure MCP server is running: `npx -y @mcp-pointer/server@latest start` |
| 140 | +2. Check browser console for WebSocket errors |
| 141 | +3. Verify port 7007 is not blocked by firewall |
| 142 | +
|
| 143 | +### MCP Tools Not Available |
| 144 | +
|
| 145 | +1. Restart your AI assistant after installing |
| 146 | +2. Check MCP configuration: `mcp-pointer config <your-tool>` |
| 147 | +3. Verify server is running: `npx -y @mcp-pointer/server@latest start` |
| 148 | +
|
| 149 | +### Elements Not Highlighting |
| 150 | +
|
| 151 | +1. Some pages block content scripts (chrome://, etc.) |
| 152 | +2. Try refreshing the page |
| 153 | +3. Check if targeting is enabled (click extension icon) |
| 154 | +
|
| 155 | +## 🚀 Roadmap |
| 156 | +
|
| 157 | +### 1. **Dynamic Context Control** |
| 158 | + - Full raw context transferred to server |
| 159 | + - LLM-configurable detail levels (visible text only, all text, CSS levels) |
| 160 | + - Progressive refinement options / token-conscious data fetching |
| 161 | +
|
| 162 | +### 2. **Visual Content Support** (for multimodal LLMs) |
| 163 | + - Base64 encoding for images (img tags) |
| 164 | + - Screenshot capture of selected elements |
| 165 | + - Separate MCP tool for direct visual content retrieval |
| 166 | +
|
| 167 | +### 3. **Enhanced Framework Support** |
| 168 | + - Vue.js component detection |
| 169 | + - Better React support (React 19 removed `_debugSource`, affecting source mapping in dev builds) |
| 170 | +
|
| 171 | +### 4. **Multi Select** |
| 172 | + - Having the ability to select multiple DOM elements |
| 173 | + - https://github.com/etsd-tech/mcp-pointer/pull/9 |
| 174 | +
|
| 175 | +## 📝 License |
| 176 | +
|
| 177 | +MIT License - see LICENSE file for details |
| 178 | +
|
| 179 | +## 🤝 Contributing |
| 180 | +
|
| 181 | +We welcome contributions! Please see our [CONTRIBUTING.md](./CONTRIBUTING.md) guide for development setup and guidelines. |
| 182 | +
|
| 183 | +--- |
| 184 | +
|
| 185 | +*Inspired by tools like [Click-to-Component](https://github.com/ericclemmons/click-to-component) for component development workflows.* |
| 186 | +
|
| 187 | +--- |
| 188 | +
|
| 189 | +**Made with ❤️ for AI-powered web development** |
| 190 | +
|
| 191 | +*Now your AI can analyze any element you point at with `Option+Click`! 👆* |
0 commit comments