rivet-mcp 1.0.1 → 1.0.2

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/cli.js +17 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { pathToFileURL } from "node:url";
2
+ import { realpathSync } from "node:fs";
3
+ import { fileURLToPath } from "node:url";
3
4
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
4
5
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
6
  import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
@@ -56,8 +57,21 @@ async function main() {
56
57
  process.on("SIGTERM", () => void shutdown());
57
58
  await server.connect(new StdioServerTransport());
58
59
  }
59
- // main() — только при запуске файла как CLI, не при import из тестов
60
- if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
60
+ // main() — только при запуске файла как CLI. npm запускает бин через symlink
61
+ // (.bin/rivet-mcp → dist/cli.js), поэтому пути сравниваются по realpath.
62
+ function isCliInvocation() {
63
+ const entry = process.argv[1];
64
+ if (!entry) {
65
+ return false;
66
+ }
67
+ try {
68
+ return realpathSync(entry) === realpathSync(fileURLToPath(import.meta.url));
69
+ }
70
+ catch {
71
+ return false;
72
+ }
73
+ }
74
+ if (isCliInvocation()) {
61
75
  main().catch((error) => {
62
76
  const message = error instanceof Error ? error.message : String(error);
63
77
  console.error(`rivet-mcp-bridge: ${message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rivet-mcp",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "stdio MCP bridge for the Rivet code-retrieval platform: exchanges a GitLab PAT for a short-lived MCP token and forwards to the Rivet Streamable HTTP endpoint",
5
5
  "type": "module",
6
6
  "bin": {