lantern-connect 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -34,7 +34,7 @@ lantern-connect --mcp-url https://your-ngrok-url.ngrok-free.dev/mcp
34
34
 
35
35
  ## What it does
36
36
 
37
- 1. **Detects** installed AI tools (Claude Desktop, Claude Code, Gemini CLI, Cursor)
37
+ 1. **Detects** installed AI tools (Claude Code, Gemini CLI, Cursor)
38
38
  2. **Configures** each detected tool to connect to Lantern's MCP server
39
39
  3. **Each tool authenticates** with Lantern on first use (via OAuth)
40
40
 
@@ -42,11 +42,18 @@ lantern-connect --mcp-url https://your-ngrok-url.ngrok-free.dev/mcp
42
42
 
43
43
  | Tool | Config Location | Method |
44
44
  |------|-----------------|--------|
45
- | Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` | mcp-remote |
46
45
  | Claude Code | `~/.claude.json` | `claude mcp add` |
47
46
  | Gemini CLI | `~/.gemini/settings.json` | httpUrl config |
48
47
  | Cursor | `~/.cursor/mcp.json` | url config |
49
48
 
49
+ ### Claude Web & Desktop
50
+
51
+ For Claude Web and Claude Desktop, use the built-in custom connector:
52
+
53
+ 1. Go to **Settings → Connectors → Add custom connector**
54
+ 2. Name it **Lantern** and paste: `https://mcp.onlantern.com/mcp`
55
+ 3. Click **Add**, then **Connect**
56
+
50
57
  ## After Installation
51
58
 
52
59
  1. **Fully quit and reopen** your AI tools (Cmd+Q on macOS)
@@ -62,12 +69,9 @@ lantern-connect --mcp-url https://your-ngrok-url.ngrok-free.dev/mcp
62
69
  # Start your local Lantern backend and MCP server
63
70
  cd lantern && npm run dev
64
71
 
65
- # Start ngrok to expose MCP server (required for Claude Desktop)
66
- ngrok http 3002
67
-
68
- # Run the CLI with your ngrok URL
72
+ # Run the CLI with your local MCP server
69
73
  cd lantern-connect
70
- node bin/lantern-connect.js --mcp-url https://your-ngrok-url.ngrok-free.dev/mcp
74
+ node bin/lantern-connect.js --mcp-url http://localhost:3002/mcp
71
75
  ```
72
76
 
73
77
  ## Resetting / Uninstall
@@ -78,7 +82,7 @@ To remove Lantern configuration from all AI tools at once:
78
82
  npx lantern-reset
79
83
  ```
80
84
 
81
- This removes the Lantern MCP server from Claude Desktop, Claude Code, Gemini CLI, and Cursor. Restart your AI tools after running.
85
+ This removes the Lantern MCP server from Claude Code, Gemini CLI, and Cursor. Restart your AI tools after running.
82
86
 
83
87
  ### Manual Reset
84
88
 
@@ -89,11 +93,8 @@ If you prefer to reset manually:
89
93
  claude mcp remove lantern
90
94
  ```
91
95
 
92
- **Claude Desktop (macOS):**
93
- ```bash
94
- nano ~/Library/Application\ Support/Claude/claude_desktop_config.json
95
- # Remove the "lantern" entry from mcpServers, then save
96
- ```
96
+ **Claude Web & Desktop:**
97
+ Go to Settings → Connectors and remove the Lantern connector.
97
98
 
98
99
  **Gemini CLI:**
99
100
  ```bash
@@ -109,10 +110,6 @@ nano ~/.cursor/mcp.json
109
110
 
110
111
  ## Troubleshooting
111
112
 
112
- ### Claude Desktop shows "Server disconnected"
113
- - Make sure you're using an ngrok URL (Claude Desktop can't reach localhost)
114
- - Restart Claude Desktop completely (Cmd+Q, not just close window)
115
-
116
113
  ### Gemini CLI shows "Bad Request" for SSE
117
114
  - Make sure your backend has the latest MCP session handling code
118
115
  - Restart your backend server
@@ -2,7 +2,6 @@
2
2
 
3
3
  import {
4
4
  expandHome,
5
- getClaudeDesktopConfigPath,
6
5
  removeFromJsonConfig,
7
6
  clearGeminiOAuthCache,
8
7
  removeClaudeCode,
@@ -18,11 +17,6 @@ async function main() {
18
17
 
19
18
  const results = []
20
19
 
21
- // Claude Desktop
22
- const claudeDesktopPath = getClaudeDesktopConfigPath()
23
- const claudeDesktopResult = removeFromJsonConfig(claudeDesktopPath, 'lantern')
24
- results.push({ name: 'Claude Desktop', ...claudeDesktopResult, reason: 'not configured' })
25
-
26
20
  // Claude Code
27
21
  const claudeCodeResult = removeClaudeCode()
28
22
  results.push({ name: 'Claude Code', ...claudeCodeResult, reason: 'not configured' })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lantern-connect",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "CLI installer to connect AI tools (Claude, Gemini, Cursor) to Lantern",
5
5
  "type": "module",
6
6
  "bin": {
package/src/detect.js CHANGED
@@ -19,22 +19,6 @@ function commandExists(command) {
19
19
  }
20
20
  }
21
21
 
22
- function getClaudeDesktopPath() {
23
- const os = platform()
24
- if (os === 'darwin') {
25
- return expandHome('~/Library/Application Support/Claude')
26
- } else if (os === 'win32') {
27
- return join(process.env.APPDATA || '', 'Claude')
28
- } else {
29
- // Linux
30
- return expandHome('~/.config/Claude')
31
- }
32
- }
33
-
34
- function getClaudeDesktopConfigPath() {
35
- return join(getClaudeDesktopPath(), 'claude_desktop_config.json')
36
- }
37
-
38
22
  function getCursorPath() {
39
23
  // Cursor uses ~/.cursor for MCP config on all platforms
40
24
  return expandHome('~/.cursor')
@@ -49,11 +33,6 @@ function getGeminiConfigPath() {
49
33
  }
50
34
 
51
35
  export const tools = {
52
- claudeDesktop: {
53
- name: 'Claude Desktop',
54
- detect: () => existsSync(getClaudeDesktopPath()),
55
- configPath: getClaudeDesktopConfigPath,
56
- },
57
36
  claudeCode: {
58
37
  name: 'Claude Code',
59
38
  detect: () => commandExists('claude'),
package/src/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { detectTools, hasAnyTools } from './detect.js'
2
- import { configureClaudeDesktop } from './configure/claude-desktop.js'
3
2
  import { configureClaudeCode } from './configure/claude-code.js'
4
3
  import { configureGeminiCli } from './configure/gemini-cli.js'
5
4
  import { configureCursor } from './configure/cursor.js'
@@ -8,7 +7,6 @@ import { resetAll } from './reset.js'
8
7
  const DEFAULT_MCP_URL = 'https://mcp.onlantern.com/mcp'
9
8
 
10
9
  const configurators = {
11
- claudeDesktop: configureClaudeDesktop,
12
10
  claudeCode: configureClaudeCode,
13
11
  geminiCli: configureGeminiCli,
14
12
  cursor: configureCursor,
@@ -65,11 +63,14 @@ export async function main() {
65
63
  console.log(' ⚠️ No supported AI tools found.')
66
64
  console.log('')
67
65
  console.log(' Supported tools:')
68
- console.log(' • Claude Desktop')
69
66
  console.log(' • Claude Code (claude CLI)')
70
67
  console.log(' • Gemini CLI')
71
68
  console.log(' • Cursor')
72
69
  console.log('')
70
+ console.log(' For Claude Desktop or Claude Web, use the custom connector:')
71
+ console.log(' Settings → Connectors → Add custom connector')
72
+ console.log(' URL: https://mcp.onlantern.com/mcp')
73
+ console.log('')
73
74
  process.exit(1)
74
75
  }
75
76
 
package/src/reset.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { existsSync, readFileSync, writeFileSync } from 'fs'
2
- import { homedir, platform } from 'os'
2
+ import { homedir } from 'os'
3
3
  import { join } from 'path'
4
4
  import { execSync } from 'child_process'
5
5
 
@@ -10,17 +10,6 @@ function expandHome(path) {
10
10
  return path
11
11
  }
12
12
 
13
- function getClaudeDesktopConfigPath() {
14
- const os = platform()
15
- if (os === 'darwin') {
16
- return expandHome('~/Library/Application Support/Claude/claude_desktop_config.json')
17
- } else if (os === 'win32') {
18
- return join(process.env.APPDATA || '', 'Claude', 'claude_desktop_config.json')
19
- } else {
20
- return expandHome('~/.config/Claude/claude_desktop_config.json')
21
- }
22
- }
23
-
24
13
  function removeFromJsonConfig(configPath, name) {
25
14
  if (!existsSync(configPath)) {
26
15
  return { found: false }
@@ -84,12 +73,6 @@ function removeClaudeCode() {
84
73
  export function resetAll() {
85
74
  let anyReset = false
86
75
 
87
- // Claude Desktop
88
- const claudeDesktopPath = getClaudeDesktopConfigPath()
89
- if (removeFromJsonConfig(claudeDesktopPath, 'lantern').found) {
90
- anyReset = true
91
- }
92
-
93
76
  // Claude Code
94
77
  if (removeClaudeCode().found) {
95
78
  anyReset = true
@@ -116,7 +99,6 @@ export function resetAll() {
116
99
  // Export individual functions for lantern-reset CLI
117
100
  export {
118
101
  expandHome,
119
- getClaudeDesktopConfigPath,
120
102
  removeFromJsonConfig,
121
103
  clearGeminiOAuthCache,
122
104
  removeClaudeCode,
@@ -1,66 +0,0 @@
1
- import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs'
2
- import { dirname } from 'path'
3
- import { execSync } from 'child_process'
4
- import { tools } from '../detect.js'
5
-
6
- function checkNodeVersion() {
7
- try {
8
- const version = execSync('node -v', { encoding: 'utf-8' }).trim()
9
- const major = parseInt(version.slice(1).split('.')[0], 10)
10
-
11
- if (major < 20) {
12
- const lines = [
13
- `Node.js >= 20 required, but found ${version}`,
14
- '',
15
- 'Claude Desktop uses mcp-remote which requires Node.js 20+.',
16
- '',
17
- 'To fix:',
18
- ' • If using nvm: nvm install 20 && nvm alias default 20',
19
- ' • Or download from: https://nodejs.org',
20
- '',
21
- 'Then restart your terminal and run lantern-connect again.',
22
- ]
23
- throw new Error(lines.join('\n'))
24
- }
25
- } catch (err) {
26
- if (err.message.includes('Node.js >= 20')) {
27
- throw err
28
- }
29
- // If node command fails, let it proceed and fail later with a clearer error
30
- }
31
- }
32
-
33
- export function configureClaudeDesktop(mcpUrl) {
34
- checkNodeVersion()
35
- const configPath = tools.claudeDesktop.configPath()
36
-
37
- // Ensure directory exists
38
- const configDir = dirname(configPath)
39
- if (!existsSync(configDir)) {
40
- mkdirSync(configDir, { recursive: true })
41
- }
42
-
43
- // Read existing config or create new one
44
- let config = {}
45
- if (existsSync(configPath)) {
46
- try {
47
- const content = readFileSync(configPath, 'utf-8')
48
- config = JSON.parse(content)
49
- } catch {
50
- // If file exists but is invalid JSON, start fresh
51
- config = {}
52
- }
53
- }
54
-
55
- // Add/update Lantern MCP server using mcp-remote to bridge HTTP
56
- config.mcpServers = config.mcpServers || {}
57
- config.mcpServers.lantern = {
58
- command: 'npx',
59
- args: ['mcp-remote', mcpUrl],
60
- }
61
-
62
- // Write config
63
- writeFileSync(configPath, JSON.stringify(config, null, 2))
64
-
65
- return configPath
66
- }