caelus-mcp 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.
Files changed (2) hide show
  1. package/dist/src/server.js +13 -1
  2. package/package.json +2 -2
@@ -16,6 +16,7 @@ import { z } from "zod";
16
16
  import { dirname, join } from "node:path";
17
17
  import { fileURLToPath } from "node:url";
18
18
  import { createRequire } from "node:module";
19
+ import { realpathSync } from "node:fs";
19
20
  import { Engine, BODIES, julianDay, mod } from "caelus";
20
21
  import { loadNodeData } from "caelus/node";
21
22
  const require = createRequire(import.meta.url);
@@ -311,7 +312,18 @@ export function buildServer() {
311
312
  return server;
312
313
  }
313
314
  // ---------------------------------------------------------------- main
314
- const isMain = process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1];
315
+ // argv[1] is a symlink when invoked via a bin shim (npx, node_modules/.bin),
316
+ // so compare realpaths or the server silently never starts.
317
+ const isMain = (() => {
318
+ if (!process.argv[1])
319
+ return false;
320
+ try {
321
+ return fileURLToPath(import.meta.url) === realpathSync(process.argv[1]);
322
+ }
323
+ catch {
324
+ return false;
325
+ }
326
+ })();
315
327
  if (isMain) {
316
328
  const server = buildServer();
317
329
  const transport = new StdioServerTransport();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "caelus-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "MCP server for caelus chart computation.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,7 +14,7 @@
14
14
  "dependencies": {
15
15
  "@modelcontextprotocol/sdk": "^1.12.0",
16
16
  "zod": "^3.24.0",
17
- "caelus": "^0.1.0"
17
+ "caelus": "^0.1.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "ajv": "^8.17.1"