unofficial-ravensburger-playhub-mcp 1.0.0 → 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.
- package/dist/index.js +18 -5
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { realpathSync } from "node:fs";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
5
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
@@ -7,8 +7,19 @@ import { loadFilterOptions } from "./lib/api.js";
|
|
|
7
7
|
import { registerEventTools } from "./tools/events.js";
|
|
8
8
|
import { registerFilterTools } from "./tools/filters.js";
|
|
9
9
|
import { registerStoreTools } from "./tools/stores.js";
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
// Resolve symlinks so we detect entry when run via npm/npx bin (which uses a symlink)
|
|
11
|
+
function isEntryModule() {
|
|
12
|
+
if (process.argv[1] == null)
|
|
13
|
+
return false;
|
|
14
|
+
try {
|
|
15
|
+
const argvPath = realpathSync(process.argv[1]);
|
|
16
|
+
const selfPath = realpathSync(fileURLToPath(import.meta.url));
|
|
17
|
+
return argvPath === selfPath;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
12
23
|
const server = new McpServer({
|
|
13
24
|
name: "lorcana-event-finder",
|
|
14
25
|
version: "1.0.0",
|
|
@@ -17,12 +28,14 @@ registerEventTools(server);
|
|
|
17
28
|
registerStoreTools(server);
|
|
18
29
|
registerFilterTools(server);
|
|
19
30
|
async function main() {
|
|
20
|
-
await loadFilterOptions();
|
|
21
31
|
const transport = new StdioServerTransport();
|
|
22
32
|
await server.connect(transport);
|
|
23
33
|
console.error("Lorcana Event Finder MCP server running on stdio");
|
|
34
|
+
// Load format/category maps in background so we don't block the MCP handshake
|
|
35
|
+
// (Cursor and other clients time out if the server doesn't respond to initialize quickly)
|
|
36
|
+
loadFilterOptions().catch((err) => console.error("Failed to load filter options:", err));
|
|
24
37
|
}
|
|
25
|
-
if (isEntryModule) {
|
|
38
|
+
if (isEntryModule()) {
|
|
26
39
|
main().catch((error) => {
|
|
27
40
|
console.error("Fatal error:", error);
|
|
28
41
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unofficial-ravensburger-playhub-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "MCP server for finding Disney Lorcana TCG events",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"unofficial-ravensburger-playhub-mcp": "
|
|
8
|
+
"unofficial-ravensburger-playhub-mcp": "dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "rm -rf dist && tsc",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "git",
|
|
31
|
-
"url": "https://github.com/zammitt/unofficial-ravensburger-playhub-mcp.git"
|
|
31
|
+
"url": "git+https://github.com/zammitt/unofficial-ravensburger-playhub-mcp.git"
|
|
32
32
|
},
|
|
33
33
|
"files": [
|
|
34
34
|
"dist",
|