@yashwant.dharmdas/elementor-mcp 3.18.0 → 3.18.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.
- package/dist/index.js +10 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4107,15 +4107,21 @@ else {
|
|
|
4107
4107
|
console.error("No sites configured. Run first: npx elementor-mcp setup");
|
|
4108
4108
|
process.exit(1);
|
|
4109
4109
|
}
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4110
|
+
// Auto-detect transport:
|
|
4111
|
+
// • No TTY (spawned by Claude Desktop via pipe) → stdio, unless --http forces HTTP
|
|
4112
|
+
// • TTY present (user ran manually in terminal) → HTTP, unless --stdio forces stdio
|
|
4113
|
+
const forceStdio = process.argv.includes("--stdio");
|
|
4114
|
+
const forceHttp = process.argv.includes("--http");
|
|
4115
|
+
const hasTTY = Boolean(process.stdin.isTTY);
|
|
4116
|
+
const useHttp = forceHttp || (!forceStdio && hasTTY);
|
|
4117
|
+
if (!useHttp) {
|
|
4118
|
+
// ── Stdio mode — for Claude Desktop (or --stdio flag) ────────────────
|
|
4113
4119
|
const server = createMcpServer(sites);
|
|
4114
4120
|
const transport = new StdioServerTransport();
|
|
4115
4121
|
await server.connect(transport);
|
|
4116
4122
|
}
|
|
4117
4123
|
else {
|
|
4118
|
-
// ── HTTP mode
|
|
4124
|
+
// ── HTTP mode — for browser-based MCP testers (or --http flag) ───────
|
|
4119
4125
|
const port = parseInt(process.env.PORT ?? "3001");
|
|
4120
4126
|
const mcpServer = createMcpServer(sites);
|
|
4121
4127
|
const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined });
|
package/package.json
CHANGED