moeba-claude-channel 0.0.3 → 0.0.5

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.
@@ -237,13 +237,20 @@ function connectSSE(c, mcp) {
237
237
  // Main — authenticate first, then connect MCP
238
238
  // ---------------------------------------------------------------------------
239
239
  async function main() {
240
- // 1. Authenticate (cached or browser OAuth) before MCP connects
240
+ // 1. Load cached credentials never open browser automatically
241
+ // User must run `npx moeba-claude-channel --login` to authenticate new projects
242
+ const loginMode = process.argv.includes('--login');
241
243
  let creds = loadCredentials();
242
- if (!creds) {
244
+ if (!creds && loginMode) {
243
245
  console.error('No Moeba credentials found — opening browser to sign in...');
244
246
  creds = await authenticate();
245
247
  }
246
- console.error(`Authenticated as ${creds.email} (project: ${PROJECT_NAME})`);
248
+ if (creds) {
249
+ console.error(`Authenticated as ${creds.email} (project: ${PROJECT_NAME})`);
250
+ }
251
+ else {
252
+ console.error(`Moeba channel: no credentials for project "${PROJECT_NAME}" — run with --login to authenticate`);
253
+ }
247
254
  // 2. Create MCP channel server
248
255
  const mcp = new Server({ name: 'moeba', version: '0.0.1' }, {
249
256
  capabilities: {
@@ -351,9 +358,11 @@ IMPORTANT: The user is on a mobile app and CANNOT approve terminal permissions.
351
358
  });
352
359
  // 4. Connect MCP to Claude Code
353
360
  await mcp.connect(new StdioServerTransport());
354
- // 5. Start SSE listener
355
- connectSSE(creds, mcp);
356
- console.error('Moeba channel ready — waiting for messages');
361
+ // 5. Start SSE listener (only if authenticated)
362
+ if (creds) {
363
+ connectSSE(creds, mcp);
364
+ console.error('Moeba channel ready — waiting for messages');
365
+ }
357
366
  }
358
367
  main().catch((err) => {
359
368
  console.error('Fatal:', err.message);
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "moeba-claude-channel",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Claude Code channel for Moeba — chat with Claude Code from the Moeba app",
5
5
  "type": "module",
6
6
  "main": "dist/moeba-channel.js",
7
7
  "bin": {
8
- "moeba-channel": "dist/moeba-channel.js"
8
+ "moeba-claude-channel": "dist/moeba-channel.js"
9
9
  },
10
10
  "files": [
11
11
  "dist"
12
12
  ],
13
13
  "scripts": {
14
14
  "build": "tsc",
15
- "prepublishOnly": "npm run build"
15
+ "prepublishOnly": "npm run build && chmod +x dist/moeba-channel.js"
16
16
  },
17
17
  "keywords": [
18
18
  "claude-code",