onto-mcp 0.4.10 → 0.4.11
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/dist/mcpb-entry.js +28 -0
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `.mcpb` Desktop Extension entry point.
|
|
3
|
+
*
|
|
4
|
+
* Claude Desktop's built-in Node host **imports this module by path** (it does
|
|
5
|
+
* not spawn `mcp_config.command`/`args`). So the manifest `entry_point` must be
|
|
6
|
+
* an importable `.js` ES module that starts the MCP stdio server on load — NOT
|
|
7
|
+
* the extensionless `bin/onto` CLI dispatcher (ESM cannot resolve an
|
|
8
|
+
* extensionless path, and `bin/onto` needs an `mcp` argv the import path never
|
|
9
|
+
* provides).
|
|
10
|
+
*
|
|
11
|
+
* Self-configures the two bundle-fixed values so the server starts even if the
|
|
12
|
+
* host does not apply `mcp_config.env` under the built-in-node path: `ONTO_HOME`
|
|
13
|
+
* (the bundle root, which anchors `.onto/` resource resolution) and the simple
|
|
14
|
+
* tool profile. Provider config still flows from the install env via the
|
|
15
|
+
* first-run bootstrap inside `startMcpServer` when present; otherwise the
|
|
16
|
+
* runtime resolves provider from the existing `settings.json` chain.
|
|
17
|
+
*/
|
|
18
|
+
import path from "node:path";
|
|
19
|
+
import { fileURLToPath } from "node:url";
|
|
20
|
+
import { startMcpServer } from "./mcp/server.js";
|
|
21
|
+
// dist/mcpb-entry.js → the bundle root is one level up from dist/.
|
|
22
|
+
const bundleRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
23
|
+
process.env.ONTO_HOME ??= bundleRoot;
|
|
24
|
+
process.env.ONTO_MCP_PROFILE ??= "simple";
|
|
25
|
+
void startMcpServer().then((code) => process.exit(code), (error) => {
|
|
26
|
+
process.stderr.write(`[onto mcpb-entry] failed to start: ${error instanceof Error ? error.stack ?? error.message : String(error)}\n`);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
});
|
package/package.json
CHANGED