Skip to content

Commit 55997d8

Browse files
Testclaude
andcommitted
Bundle MCP server with deps, add signup validation
- Bundle mcp-server.mjs via esbuild so transitive deps (zod etc.) are included — fixes Claude Desktop failing to launch the MCP server - Add basic email/password validation on signup form - Simplify electron-builder config to unpack only the bundled file Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 86964ad commit 55997d8

3 files changed

Lines changed: 21 additions & 10 deletions

File tree

electron/ipc.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ export function setupIPC() {
9393
try {
9494
const configPath = getClaudeConfigPath()
9595

96-
// Get absolute path to mcp-server.mjs
97-
// In packaged app, asarUnpack puts it at app.asar.unpacked/mcp-server.mjs
96+
// Get absolute path to the bundled mcp-server.mjs in dist-electron/
97+
// In packaged app, asarUnpack puts it at app.asar.unpacked/dist-electron/mcp-server.mjs
9898
const appPath = app.getAppPath()
9999
const mcpServerPath = appPath.includes('.asar')
100-
? path.resolve(appPath.replace('.asar', '.asar.unpacked'), 'mcp-server.mjs')
101-
: path.resolve(appPath, 'mcp-server.mjs')
100+
? path.resolve(appPath.replace('.asar', '.asar.unpacked'), 'dist-electron', 'mcp-server.mjs')
101+
: path.resolve(appPath, 'dist-electron', 'mcp-server.mjs')
102102

103103
if (!fs.existsSync(mcpServerPath)) {
104104
console.error('[claude] MCP server not found at:', mcpServerPath)

package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "dist-electron/main.js",
66
"scripts": {
77
"dev": "vite",
8-
"build": "vite build",
8+
"build": "vite build && npx esbuild mcp-server.mjs --bundle --platform=node --format=esm --outfile=dist-electron/mcp-server.mjs",
99
"preview": "vite preview",
1010
"package": "npm run build && electron-builder",
1111
"test": "vitest run",
@@ -46,13 +46,10 @@
4646
"dist/**/*",
4747
"dist-electron/**/*",
4848
"resources/**/*",
49-
"build/**/*",
50-
"mcp-server.mjs",
51-
"node_modules/@modelcontextprotocol/**/*"
49+
"build/**/*"
5250
],
5351
"asarUnpack": [
54-
"mcp-server.mjs",
55-
"node_modules/@modelcontextprotocol/**/*"
52+
"dist-electron/mcp-server.mjs"
5653
],
5754
"mac": {
5855
"icon": "build/icon.icns",

src/views/Settings.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,20 @@ function AccountSection() {
115115
if (!showAuth || !email.trim() || !password.trim()) return
116116
setLoading(true)
117117
setError('')
118+
119+
if (showAuth === 'signup') {
120+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email.trim())) {
121+
setError('Please enter a valid email address')
122+
setLoading(false)
123+
return
124+
}
125+
if (password.length < 8) {
126+
setError('Password must be at least 8 characters')
127+
setLoading(false)
128+
return
129+
}
130+
}
131+
118132
const result = showAuth === 'signup'
119133
? await window.purroxy.account.signup(email, password)
120134
: await window.purroxy.account.login(email, password)

0 commit comments

Comments
 (0)