@opsee/mcp-server 0.1.0 → 0.1.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.
package/bin/opsee-mcp.js CHANGED
@@ -1,21 +1,21 @@
1
- #!/usr/bin/env npx tsx
1
+ #!/usr/bin/env node
2
2
 
3
- import { startLoginFlow } from "../src/auth/login.js";
3
+ import { spawn } from "node:child_process";
4
+ import { dirname, resolve } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+ import { createRequire } from "node:module";
4
7
 
5
- const command = process.argv[2];
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const require = createRequire(import.meta.url);
10
+
11
+ // Resolve tsx binary from wherever npm installed it (handles hoisting)
12
+ const tsxPkg = dirname(require.resolve("tsx/package.json"));
13
+ const tsx = resolve(tsxPkg, "dist", "cli.mjs");
6
14
 
7
- switch (command) {
8
- case "login":
9
- try {
10
- await startLoginFlow();
11
- } catch (error: any) {
12
- console.error("Login failed:", error.message);
13
- process.exit(1);
14
- }
15
- break;
15
+ const command = process.argv[2];
16
+ const script = command === "login"
17
+ ? resolve(__dirname, "..", "src", "auth", "login-cli.ts")
18
+ : resolve(__dirname, "..", "src", "index.ts");
16
19
 
17
- case "serve":
18
- default:
19
- await import("../src/index.js");
20
- break;
21
- }
20
+ const child = spawn(process.execPath, [tsx, script], { stdio: "inherit", env: process.env });
21
+ child.on("exit", (code) => process.exit(code || 0));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opsee/mcp-server",
3
- "version": "0.1.0",
3
+ "version": "0.1.5",
4
4
  "description": "Opsee MCP server — manage projects, tasks, docs, and cycles from AI coding environments",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,9 @@
1
+ import { startLoginFlow } from "./login.js";
2
+
3
+ try {
4
+ await startLoginFlow();
5
+ } catch (error: unknown) {
6
+ const msg = error instanceof Error ? error.message : String(error);
7
+ console.error("Login failed:", msg);
8
+ process.exit(1);
9
+ }