Skip to content

Commit f8717a6

Browse files
committed
Improve README badges and Option+Click emphasis, fix release workflow
- Add npm version, chrome extension, and license badges to README - Emphasize Option+Click usage with backticks throughout README - Fix release workflow to prevent README from being committed: - Move README copy to right before npm publish - Add cleanup step to remove copied README after publish - Add automatic manifest version bumping in release workflow - Create bump-manifest script for chrome extension - Remove copied server README from git tracking - Remove redundant enabled config check in chrome extension background
1 parent 31debc0 commit f8717a6

File tree

8 files changed

+56
-173
lines changed

8 files changed

+56
-173
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ jobs:
4040
- name: Run tests
4141
run: pnpm test
4242

43-
- name: Copy README to server package for npm
44-
run: cp README.md packages/server/README.md
43+
- name: Bump Chrome extension manifest version
44+
run: pnpm -C packages/chrome-extension bump-manifest
4545

4646
- name: Build all packages
4747
run: pnpm build
@@ -50,6 +50,9 @@ jobs:
5050
working-directory: packages/chrome-extension/dist
5151
run: zip -r ../../../mcp-pointer-chrome-extension.zip .
5252

53+
- name: Copy README for npm package
54+
run: cp README.md packages/server/README.md
55+
5356
- name: Attest Build Provenance
5457
uses: actions/attest-build-provenance@v3.0.0
5558
with:
@@ -63,6 +66,9 @@ jobs:
6366
env:
6467
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6568

69+
- name: Clean up copied README
70+
run: rm -f packages/server/README.md
71+
6672
- name: Upload Chrome extension to release
6773
if: steps.changesets.outputs.published == 'true'
6874
uses: softprops/action-gh-release@v1

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
[![CI](https://github.com/etsd-tech/mcp-pointer/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/etsd-tech/mcp-pointer/actions/workflows/ci.yml)
44
[![Release](https://github.com/etsd-tech/mcp-pointer/actions/workflows/release.yml/badge.svg?branch=main)](https://github.com/etsd-tech/mcp-pointer/actions/workflows/release.yml)
5+
[![npm version](https://img.shields.io/npm/v/@mcp-pointer/server?label=Server)](https://www.npmjs.com/package/@mcp-pointer/server)
6+
[![Chrome Extension](https://img.shields.io/github/package-json/v/etsd-tech/mcp-pointer?filename=packages%2Fchrome-extension%2Fpackage.json&label=Chrome-Extension)](https://github.com/etsd-tech/mcp-pointer/releases)
7+
[![License: MIT](https://img.shields.io/github/license/etsd-tech/mcp-pointer?label=License)](https://github.com/etsd-tech/mcp-pointer/blob/main/LICENSE)
58

69
# 👆 MCP Pointer
710

@@ -10,13 +13,13 @@
1013
MCP Pointer is a *local* tool combining an MCP Server with a Chrome Extension:
1114

1215
1. **🖥️ MCP Server** (Node.js package) - Bridges between the browser and AI tools via the Model Context Protocol
13-
2. **🌐 Chrome Extension** - Captures DOM element selections in the browser using Option+Click
16+
2. **🌐 Chrome Extension** - Captures DOM element selections in the browser using `Option+Click`
1417

1518
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.
1619

1720
## ✨ Features
1821

19-
- 🎯 **Option+Click Selection** - Simply hold Option (Alt on Windows) and click any element
22+
- 🎯 **`Option+Click` Selection** - Simply hold `Option` (Alt on Windows) and click any element
2023
- 📋 **Complete Element Data** - Text content, CSS classes, HTML attributes, positioning, and styling
2124
- ⚛️ **React Component Detection** - Component names and source files via Fiber (experimental)
2225
- 🔗 **WebSocket Connection** - Real-time communication between browser and AI tools
@@ -26,7 +29,7 @@ The extension lets you visually select DOM elements in the browser, and the MCP
2629

2730
https://github.com/user-attachments/assets/98c4adf6-1f05-4c9b-be41-0416ab784e2c
2831

29-
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.
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.
3033

3134
## 🚀 Getting Started
3235

@@ -46,6 +49,8 @@ npx -y @mcp-pointer/server config manual # Shows manual configuration for ot
4649

4750
> **Optional:** You can install globally with `npm install -g @mcp-pointer/server` to use `mcp-pointer` instead of `npx -y @mcp-pointer/server`
4851
52+
After configuration, **restart your coding tool** to load the MCP connection.
53+
4954
### 2. Install Chrome Extension
5055

5156
**Option A: Download from Releases (Recommended)**
@@ -56,18 +61,20 @@ npx -y @mcp-pointer/server config manual # Shows manual configuration for ot
5661
4. Open Chrome → Settings → Extensions → Developer mode (toggle ON)
5762
5. Click "Load unpacked" and select the extracted folder
5863
6. The MCP Pointer extension should appear in your extensions list
64+
7. **Reload web pages** to activate the extension
5965

6066
**Option B: Build from Source**
6167

6268
1. Clone this repository
6369
2. Follow the build instructions in [CONTRIBUTING.md](./CONTRIBUTING.md)
6470
3. Open Chrome → Settings → Extensions → Developer mode (toggle ON)
6571
4. Click "Load unpacked" and select the `packages/chrome-extension/dist/` folder
72+
5. **Reload web pages** to activate the extension
6673

6774
### 3. Start Using
6875

6976
1. **Navigate to any webpage**
70-
2. **Option+Click** any element to select it
77+
2. **`Option+Click`** any element to select it
7178
3. **Ask your AI** to analyze the targeted element!
7279

7380
Your AI tool will automatically start the MCP server when needed using the `npx -y @mcp-pointer/server start` command.
@@ -79,7 +86,7 @@ Your AI tool will automatically start the MCP server when needed using the `npx
7986

8087
## 🎯 How It Works
8188

82-
1. **Element Selection**: Content script captures Option+Click events
89+
1. **Element Selection**: Content script captures `Option+Click` events
8390
2. **Data Extraction**: Analyzes element structure, CSS, and framework info
8491
3. **WebSocket Transport**: Sends data to MCP server on port 7007
8592
4. **MCP Protocol**: Makes data available to AI tools via MCP tools
@@ -151,6 +158,10 @@ We welcome contributions! Please see our [CONTRIBUTING.md](./CONTRIBUTING.md) gu
151158

152159
---
153160

161+
*Inspired by tools like [Click-to-Component](https://github.com/ericclemmons/click-to-component) for component development workflows.*
162+
163+
---
164+
154165
**Made with ❤️ for AI-powered web development**
155166

156-
*Now your AI can analyze any element you point at! 👆*
167+
*Now your AI can analyze any element you point at with `Option+Click`! 👆*

packages/chrome-extension/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"clean": "rm -rf dist",
1212
"clean-dev": "rm -rf dev",
1313
"typecheck": "tsc --noEmit src/*.ts",
14+
"bump-manifest": "node scripts/bump-manifest.js",
1415
"build": "pnpm clean && esbuild src/background.ts src/content.ts src/popup.ts src/styles.css src/popup.css src/manifest.json src/popup.html src/*.png --bundle --outdir=dist --outbase=src --format=iife --platform=browser --target=chrome100 --minify --define:IS_DEV=false --loader:.css=copy --loader:.html=copy --loader:.json=copy --loader:.png=copy",
1516
"dev": "pnpm clean-dev && esbuild src/background.ts src/content.ts src/popup.ts src/styles.css src/popup.css src/manifest.json src/popup.html src/*.png --bundle --outdir=dev --outbase=src --format=iife --platform=browser --target=chrome100 --sourcemap --define:IS_DEV=true --loader:.css=copy --loader:.html=copy --loader:.json=copy --loader:.png=copy --watch"
1617
},
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
// Read version from local package.json
5+
const packageJsonPath = path.join(__dirname, '../package.json');
6+
const manifestPath = path.join(__dirname, '../src/manifest.json');
7+
8+
try {
9+
// Get version from package.json
10+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
11+
const version = packageJson.version;
12+
13+
// Read and update manifest.json
14+
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
15+
manifest.version = version;
16+
17+
// Write back to manifest.json with proper formatting
18+
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n');
19+
20+
console.log(`✅ Bumped manifest version to ${version}`);
21+
} catch (error) {
22+
console.error('❌ Error bumping manifest version:', error.message);
23+
process.exit(1);
24+
}

packages/chrome-extension/src/background.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ ConfigStorageService.onChange((newConfig: ExtensionConfig) => {
3737
// Listen for messages from content script
3838
chrome.runtime.onMessage
3939
.addListener((request: any, _sender: any, sendResponse: (response: any) => void) => {
40-
if (!currentConfig?.enabled) {
41-
sendResponse({ success: false, error: 'Extension is disabled' });
42-
return;
43-
}
44-
4540
if (request.type === 'ELEMENT_SELECTED' && request.data) {
4641
// Send element with current port and status callback
4742
elementSender.sendElement(

packages/chrome-extension/src/services/element-sender-service.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ export class ElementSenderService {
1313

1414
private idleTimeout: NodeJS.Timeout | null = null;
1515

16-
private readonly IDLE_DURATION = 120000; // 2 minutes of inactivity
16+
private readonly IDLE_DURATION = 10000; // 10 seconds of inactivity
1717

18-
private readonly CONNECTION_TIMEOUT = 5000; // 5 seconds to wait for connection
18+
private readonly CONNECTION_TIMEOUT = 10000; // 5 seconds to wait for connection
1919

2020
private readonly MAX_RECONNECTION_DELAY = 10000; // 10 seconds max delay
2121

2222
private readonly MIN_RECONNECTION_DELAY = 1000; // 1 second min delay
2323

2424
private readonly RECONNECTION_DELAY_GROW_FACTOR = 1.5; // Exponential backoff factor
2525

26-
private readonly MAX_RETRIES = 5; // Maximum connection retry attempts
26+
private readonly MAX_RETRIES = 10; // Maximum connection retry attempts
2727

2828
async sendElement(
2929
element: TargetedElement,
@@ -186,6 +186,8 @@ export class ElementSenderService {
186186
this.ws.close();
187187
this.ws = null;
188188
}
189+
190+
logger.debug('🔌 WS client disconnected');
189191
}
190192

191193
private get isConnected(): boolean {

packages/chrome-extension/src/utils/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const config: ExtensionConfig = {
1818
},
1919
logger: {
2020
enabled: IS_DEV,
21-
level: LogLevel.INFO,
21+
level: LogLevel.DEBUG,
2222
},
2323
};
2424

packages/server/README.md

Lines changed: 0 additions & 156 deletions
This file was deleted.

0 commit comments

Comments
 (0)