lantern-connect 0.1.0 โ†’ 0.1.1

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
@@ -75,6 +75,43 @@ cd lantern-connect
75
75
  node bin/lantern-connect.js --mcp-url https://your-ngrok-url.ngrok-free.dev/mcp --lantern-url http://localhost:3000
76
76
  ```
77
77
 
78
+ ## Resetting / Uninstall
79
+
80
+ To remove Lantern configuration from all AI tools at once:
81
+
82
+ ```bash
83
+ npx lantern-reset
84
+ ```
85
+
86
+ This removes the Lantern MCP server from Claude Desktop, Claude Code, Gemini CLI, and Cursor. Restart your AI tools after running.
87
+
88
+ ### Manual Reset
89
+
90
+ If you prefer to reset manually:
91
+
92
+ **Claude Code:**
93
+ ```bash
94
+ claude mcp remove lantern
95
+ ```
96
+
97
+ **Claude Desktop (macOS):**
98
+ ```bash
99
+ nano ~/Library/Application\ Support/Claude/claude_desktop_config.json
100
+ # Remove the "lantern" entry from mcpServers, then save
101
+ ```
102
+
103
+ **Gemini CLI:**
104
+ ```bash
105
+ nano ~/.gemini/settings.json
106
+ # Remove the "lantern" entry from mcpServers, then save
107
+ ```
108
+
109
+ **Cursor:**
110
+ ```bash
111
+ nano ~/.cursor/mcp.json
112
+ # Remove the "lantern" entry from mcpServers, then save
113
+ ```
114
+
78
115
  ## Troubleshooting
79
116
 
80
117
  ### Claude Desktop shows "Server disconnected"
@@ -0,0 +1,114 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { existsSync, readFileSync, writeFileSync } from 'fs'
4
+ import { homedir, platform } from 'os'
5
+ import { join } from 'path'
6
+ import { execSync } from 'child_process'
7
+
8
+ function expandHome(path) {
9
+ if (path.startsWith('~')) {
10
+ return join(homedir(), path.slice(1))
11
+ }
12
+ return path
13
+ }
14
+
15
+ function getClaudeDesktopConfigPath() {
16
+ const os = platform()
17
+ if (os === 'darwin') {
18
+ return expandHome('~/Library/Application Support/Claude/claude_desktop_config.json')
19
+ } else if (os === 'win32') {
20
+ return join(process.env.APPDATA || '', 'Claude', 'claude_desktop_config.json')
21
+ } else {
22
+ return expandHome('~/.config/Claude/claude_desktop_config.json')
23
+ }
24
+ }
25
+
26
+ function removeFromJsonConfig(configPath, name) {
27
+ if (!existsSync(configPath)) {
28
+ return { found: false, reason: 'config file not found' }
29
+ }
30
+
31
+ try {
32
+ const content = readFileSync(configPath, 'utf-8')
33
+ const config = JSON.parse(content)
34
+
35
+ if (!config.mcpServers || !config.mcpServers[name]) {
36
+ return { found: false, reason: 'lantern not configured' }
37
+ }
38
+
39
+ delete config.mcpServers[name]
40
+ writeFileSync(configPath, JSON.stringify(config, null, 2))
41
+ return { found: true }
42
+ } catch (err) {
43
+ return { found: false, reason: err.message }
44
+ }
45
+ }
46
+
47
+ function removeClaudeCode() {
48
+ try {
49
+ execSync('claude mcp remove lantern', { stdio: 'pipe' })
50
+ return { found: true }
51
+ } catch (err) {
52
+ const stderr = err.stderr?.toString() || ''
53
+ if (stderr.includes('not found') || stderr.includes('does not exist')) {
54
+ return { found: false, reason: 'lantern not configured' }
55
+ }
56
+ // If claude CLI doesn't exist
57
+ if (err.message.includes('ENOENT') || err.message.includes('not found')) {
58
+ return { found: false, reason: 'claude CLI not installed' }
59
+ }
60
+ return { found: false, reason: err.message }
61
+ }
62
+ }
63
+
64
+ async function main() {
65
+ console.log('')
66
+ console.log(' ๐Ÿ”ฅ Lantern Reset')
67
+ console.log(' โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€')
68
+ console.log('')
69
+ console.log(' Removing Lantern from AI tools...')
70
+ console.log('')
71
+
72
+ const results = []
73
+
74
+ // Claude Desktop
75
+ const claudeDesktopPath = getClaudeDesktopConfigPath()
76
+ const claudeDesktopResult = removeFromJsonConfig(claudeDesktopPath, 'lantern')
77
+ results.push({ name: 'Claude Desktop', ...claudeDesktopResult })
78
+
79
+ // Claude Code
80
+ const claudeCodeResult = removeClaudeCode()
81
+ results.push({ name: 'Claude Code', ...claudeCodeResult })
82
+
83
+ // Gemini CLI
84
+ const geminiPath = expandHome('~/.gemini/settings.json')
85
+ const geminiResult = removeFromJsonConfig(geminiPath, 'lantern')
86
+ results.push({ name: 'Gemini CLI', ...geminiResult })
87
+
88
+ // Cursor
89
+ const cursorPath = expandHome('~/.cursor/mcp.json')
90
+ const cursorResult = removeFromJsonConfig(cursorPath, 'lantern')
91
+ results.push({ name: 'Cursor', ...cursorResult })
92
+
93
+ // Print results
94
+ let anyRemoved = false
95
+ for (const result of results) {
96
+ if (result.found) {
97
+ console.log(` โœ“ ${result.name} - removed`)
98
+ anyRemoved = true
99
+ } else {
100
+ console.log(` ยท ${result.name} - ${result.reason}`)
101
+ }
102
+ }
103
+
104
+ console.log('')
105
+
106
+ if (anyRemoved) {
107
+ console.log(' โœ… Done! Restart your AI tools to complete the reset.')
108
+ } else {
109
+ console.log(' โ„น๏ธ Lantern was not configured in any tools.')
110
+ }
111
+ console.log('')
112
+ }
113
+
114
+ main().catch(console.error)
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "lantern-connect",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "CLI installer to connect AI tools (Claude, Gemini, Cursor) to Lantern",
5
5
  "type": "module",
6
6
  "bin": {
7
- "lantern-connect": "./bin/lantern-connect.js"
7
+ "lantern-connect": "./bin/lantern-connect.js",
8
+ "lantern-reset": "./bin/lantern-reset.js"
8
9
  },
9
10
  "files": [
10
11
  "bin",