@shipstatic/mcp 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/dist/index.js +9 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,23 +11,16 @@ const CONFIG_EXAMPLE = JSON.stringify({
|
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
}, null, 2);
|
|
14
|
-
if (process.stdin.isTTY) {
|
|
15
|
-
console.error('Shipstatic MCP server v0.1.4');
|
|
16
|
-
console.error('This is a stdio server for MCP clients.\n');
|
|
17
|
-
console.error('Add to your MCP client config:\n');
|
|
18
|
-
console.error(CONFIG_EXAMPLE);
|
|
19
|
-
process.exit(0);
|
|
20
|
-
}
|
|
21
14
|
const apiKey = process.env.SHIP_API_KEY;
|
|
22
|
-
if (
|
|
23
|
-
console.error('Error: SHIP_API_KEY environment variable is required.\n');
|
|
24
|
-
console.error('Add it to your MCP client config:\n');
|
|
25
|
-
console.error(CONFIG_EXAMPLE);
|
|
26
|
-
process.exit(1);
|
|
27
|
-
}
|
|
28
|
-
async function main() {
|
|
15
|
+
if (apiKey) {
|
|
29
16
|
const server = createServer(new Ship({ apiKey }));
|
|
30
17
|
const transport = new StdioServerTransport();
|
|
31
|
-
|
|
18
|
+
server.connect(transport).catch(console.error);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
console.error('Shipstatic MCP server v0.1.6');
|
|
22
|
+
console.error('This is a stdio server for MCP clients.\n');
|
|
23
|
+
console.error('SHIP_API_KEY environment variable is required.\n');
|
|
24
|
+
console.error('Add to your MCP client config:\n');
|
|
25
|
+
console.error(CONFIG_EXAMPLE);
|
|
32
26
|
}
|
|
33
|
-
main().catch(console.error);
|