lantern-connect 0.2.1 → 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 +14 -17
- package/bin/lantern-reset.js +0 -6
- package/package.json +1 -1
- package/src/detect.js +0 -21
- package/src/index.js +4 -3
- package/src/reset.js +1 -19
- package/src/configure/claude-desktop.js +0 -37
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
|
|
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
|
-
#
|
|
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
|
|
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
|
|
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
|
|
93
|
-
|
|
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
|
package/bin/lantern-reset.js
CHANGED
|
@@ -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
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
|
|
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,37 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs'
|
|
2
|
-
import { dirname } from 'path'
|
|
3
|
-
import { tools } from '../detect.js'
|
|
4
|
-
|
|
5
|
-
export function configureClaudeDesktop(mcpUrl) {
|
|
6
|
-
const configPath = tools.claudeDesktop.configPath()
|
|
7
|
-
|
|
8
|
-
// Ensure directory exists
|
|
9
|
-
const configDir = dirname(configPath)
|
|
10
|
-
if (!existsSync(configDir)) {
|
|
11
|
-
mkdirSync(configDir, { recursive: true })
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// Read existing config or create new one
|
|
15
|
-
let config = {}
|
|
16
|
-
if (existsSync(configPath)) {
|
|
17
|
-
try {
|
|
18
|
-
const content = readFileSync(configPath, 'utf-8')
|
|
19
|
-
config = JSON.parse(content)
|
|
20
|
-
} catch {
|
|
21
|
-
// If file exists but is invalid JSON, start fresh
|
|
22
|
-
config = {}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Add/update Lantern MCP server using mcp-remote to bridge HTTP
|
|
27
|
-
config.mcpServers = config.mcpServers || {}
|
|
28
|
-
config.mcpServers.lantern = {
|
|
29
|
-
command: 'npx',
|
|
30
|
-
args: ['mcp-remote', mcpUrl],
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Write config
|
|
34
|
-
writeFileSync(configPath, JSON.stringify(config, null, 2))
|
|
35
|
-
|
|
36
|
-
return configPath
|
|
37
|
-
}
|