@opsee/mcp-server 0.1.4 → 0.1.6
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 +7 -2
- package/package.json +1 -1
- package/src/auth/credentials.ts +1 -1
- package/src/auth/login.ts +1 -1
- package/src/auth/manager.ts +1 -1
package/bin/opsee-mcp.js
CHANGED
|
@@ -3,14 +3,19 @@
|
|
|
3
3
|
import { spawn } from "node:child_process";
|
|
4
4
|
import { dirname, resolve } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { createRequire } from "node:module";
|
|
6
7
|
|
|
7
8
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
const
|
|
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");
|
|
9
14
|
|
|
10
15
|
const command = process.argv[2];
|
|
11
16
|
const script = command === "login"
|
|
12
17
|
? resolve(__dirname, "..", "src", "auth", "login-cli.ts")
|
|
13
18
|
: resolve(__dirname, "..", "src", "index.ts");
|
|
14
19
|
|
|
15
|
-
const child = spawn(tsx,
|
|
20
|
+
const child = spawn(process.execPath, [tsx, script], { stdio: "inherit", env: process.env });
|
|
16
21
|
child.on("exit", (code) => process.exit(code || 0));
|
package/package.json
CHANGED
package/src/auth/credentials.ts
CHANGED
|
@@ -22,7 +22,7 @@ export function readCredentials(): Credentials | null {
|
|
|
22
22
|
if (process.env.OPSEE_API_TOKEN) {
|
|
23
23
|
return {
|
|
24
24
|
token: process.env.OPSEE_API_TOKEN,
|
|
25
|
-
serverUrl: process.env.OPSEE_API_URL || "https://api.opsee.
|
|
25
|
+
serverUrl: process.env.OPSEE_API_URL || "https://grpc.api.opsee.ai",
|
|
26
26
|
userId: "",
|
|
27
27
|
companyId: "",
|
|
28
28
|
expiresAt: "",
|
package/src/auth/login.ts
CHANGED
|
@@ -27,7 +27,7 @@ const ERROR_HTML = `<!DOCTYPE html>
|
|
|
27
27
|
export async function startLoginFlow(): Promise<void> {
|
|
28
28
|
const port = 9876;
|
|
29
29
|
const callbackUrl = `http://localhost:${port}/callback`;
|
|
30
|
-
const appUrl = process.env.OPSEE_APP_URL || "https://
|
|
30
|
+
const appUrl = process.env.OPSEE_APP_URL || "https://opsee.ai";
|
|
31
31
|
const loginUrl = `${appUrl}/auth/mcp?callback=${encodeURIComponent(callbackUrl)}`;
|
|
32
32
|
|
|
33
33
|
return new Promise<void>((resolve, reject) => {
|