Skip to content

Commit eb70122

Browse files
committed
Fix auto-update: ensure users always get latest MCP server version
Changed all configuration commands to use @mcp-pointer/server@latest instead of cached version, ensuring automatic updates.
1 parent 999aec6 commit eb70122

File tree

5 files changed

+29
-180
lines changed

5 files changed

+29
-180
lines changed

.changeset/fix-auto-update.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@mcp-pointer/server": patch
3+
---
4+
5+
Fix auto-update configuration to always use latest version
6+
7+
Users were stuck on the first installed version because npx cached the initial version. Updated all MCP server configurations to use `@mcp-pointer/server@latest` ensuring users always get the newest version when their AI tool starts the server.
8+
9+
- Updated Claude Code, Cursor, and Windsurf configurations
10+
- Added instructions for existing users to reconfigure
11+
- Updated documentation and troubleshooting sections

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,18 @@ npx -y @mcp-pointer/server config manual # Shows manual configuration for ot
8888

8989
After configuration, **restart your coding tool** to load the MCP connection.
9090

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+
9196
### 3. Start Using
9297
9398
1. **Navigate to any webpage**
9499
2. **`Option+Click`** any element to select it
95100
3. **Ask your AI** to analyze the targeted element!
96101
97-
Your AI tool will automatically start the MCP server when needed using the `npx -y @mcp-pointer/server start` command.
102+
Your AI tool will automatically start the MCP server when needed using the `npx -y @mcp-pointer/server@latest start` command.
98103
99104
**Available MCP Tool:**
100105
- `get-pointed-element` - Get textual information about the currently pointed DOM element from the browser extension
@@ -131,15 +136,15 @@ Your AI tool will automatically start the MCP server when needed using the `npx
131136
132137
### Extension Not Connecting
133138
134-
1. Make sure MCP server is running: `npx -y @mcp-pointer/server start`
139+
1. Make sure MCP server is running: `npx -y @mcp-pointer/server@latest start`
135140
2. Check browser console for WebSocket errors
136141
3. Verify port 7007 is not blocked by firewall
137142
138143
### MCP Tools Not Available
139144
140145
1. Restart your AI assistant after installing
141146
2. Check MCP configuration: `mcp-pointer config <your-tool>`
142-
3. Verify server is running: `npx -y @mcp-pointer/server start`
147+
3. Verify server is running: `npx -y @mcp-pointer/server@latest start`
143148
144149
### Elements Not Highlighting
145150

packages/server/README.md

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

packages/server/src/__tests__/config.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ describe('configCommand', () => {
8787
const addCommand = mockExecSync.mock.calls[1][0];
8888

8989
// Verify exact command structure for add command
90-
const expectedCommand = 'claude mcp add pointer -s user --env MCP_POINTER_PORT=7007 -- npx -y @mcp-pointer/server start';
90+
const expectedCommand = 'claude mcp add pointer -s user --env MCP_POINTER_PORT=7007 -- npx -y @mcp-pointer/server@latest start';
9191
expect(addCommand).toBe(expectedCommand);
9292

9393
// Verify success message
@@ -101,7 +101,7 @@ describe('configCommand', () => {
101101

102102
expect(mockExecSync).toHaveBeenCalledTimes(2);
103103
const addCommand = mockExecSync.mock.calls[1][0];
104-
const expectedCommand = 'claude mcp add pointer -s user --env MCP_POINTER_PORT=8888 -- npx -y @mcp-pointer/server start';
104+
const expectedCommand = 'claude mcp add pointer -s user --env MCP_POINTER_PORT=8888 -- npx -y @mcp-pointer/server@latest start';
105105
expect(addCommand).toBe(expectedCommand);
106106
});
107107

@@ -117,7 +117,7 @@ describe('configCommand', () => {
117117

118118
// Second call should be add command
119119
const addCommand = mockExecSync.mock.calls[1][0];
120-
expect(addCommand).toBe('claude mcp add pointer -s user --env MCP_POINTER_PORT=7007 -- npx -y @mcp-pointer/server start');
120+
expect(addCommand).toBe('claude mcp add pointer -s user --env MCP_POINTER_PORT=7007 -- npx -y @mcp-pointer/server@latest start');
121121

122122
expect(mockLoggerInfo).toHaveBeenCalledWith(expect.stringContaining('🔄 Removed existing MCP Pointer configuration'));
123123
expect(mockLoggerInfo).toHaveBeenCalledWith(expect.stringContaining('✅ Successfully configured MCP Pointer for Claude Code'));
@@ -177,7 +177,7 @@ describe('configCommand', () => {
177177
const configObj = JSON.parse(decodedConfig);
178178

179179
expect(configObj.command).toBe('npx');
180-
expect(configObj.args).toEqual(['-y', '@mcp-pointer/server', 'start']);
180+
expect(configObj.args).toEqual(['-y', '@mcp-pointer/server@latest', 'start']);
181181
expect(configObj.env.MCP_POINTER_PORT).toBe('7007');
182182

183183
expect(mockLoggerInfo).toHaveBeenCalledWith(expect.stringContaining('✅ MCP Pointer configuration sent to Cursor IDE'));
@@ -216,7 +216,7 @@ describe('configCommand', () => {
216216

217217
const pointerConfig = writtenConfig.mcpServers.pointer;
218218
expect(pointerConfig.command).toBe('npx');
219-
expect(pointerConfig.args).toEqual(['-y', '@mcp-pointer/server', 'start']);
219+
expect(pointerConfig.args).toEqual(['-y', '@mcp-pointer/server@latest', 'start']);
220220
expect(pointerConfig.env.MCP_POINTER_PORT).toBe('7007');
221221

222222
expect(mockLoggerInfo).toHaveBeenCalledWith(expect.stringContaining('✅ Successfully configured MCP Pointer for Windsurf IDE'));
@@ -237,7 +237,7 @@ describe('configCommand', () => {
237237
expect(loggedMessages).toContain('"pointer"');
238238
expect(loggedMessages).toContain('"command": "npx"');
239239
expect(loggedMessages).toContain('"-y"');
240-
expect(loggedMessages).toContain('"@mcp-pointer/server"');
240+
expect(loggedMessages).toContain('"@mcp-pointer/server@latest"');
241241
expect(loggedMessages).toContain('"start"');
242242
});
243243
});

packages/server/src/config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function configureClaudeCode(port: string) {
4747
}
4848

4949
// Now add the server configuration
50-
const command = `claude mcp add ${MCP_SERVER_NAME} -s user --env MCP_POINTER_PORT=${port} -- npx -y @mcp-pointer/server start`;
50+
const command = `claude mcp add ${MCP_SERVER_NAME} -s user --env MCP_POINTER_PORT=${port} -- npx -y @mcp-pointer/server@latest start`;
5151
execSync(command, { stdio: 'pipe' });
5252

5353
logger.info('✅ Successfully configured MCP Pointer for Claude Code (user-wide)');
@@ -66,7 +66,7 @@ function configureCursor(port: string) {
6666
// Create the MCP server configuration
6767
const cursorConfig = {
6868
command: 'npx',
69-
args: ['-y', '@mcp-pointer/server', 'start'],
69+
args: ['-y', '@mcp-pointer/server@latest', 'start'],
7070
env: {
7171
MCP_POINTER_PORT: port,
7272
},
@@ -124,7 +124,7 @@ function configureWindsurf(port: string) {
124124
// Prepare the MCP Pointer configuration
125125
const mcpPointerConfig = {
126126
command: 'npx',
127-
args: ['-y', '@mcp-pointer/server', 'start'],
127+
args: ['-y', '@mcp-pointer/server@latest', 'start'],
128128
env: {
129129
MCP_POINTER_PORT: port,
130130
},
@@ -174,7 +174,7 @@ function showManualConfig(port: string) {
174174
mcpServers: {
175175
[MCP_SERVER_NAME]: {
176176
command: 'npx',
177-
args: ['-y', '@mcp-pointer/server', 'start'],
177+
args: ['-y', '@mcp-pointer/server@latest', 'start'],
178178
env: {
179179
MCP_POINTER_PORT: port,
180180
},

0 commit comments

Comments
 (0)