@heuresis/mcp 1.0.0-rc.3 → 1.0.0-rc.4
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/cli.js +27 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -98,7 +98,34 @@ function parseLoginFlags(argv) {
|
|
|
98
98
|
function sleep(ms) {
|
|
99
99
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
100
100
|
}
|
|
101
|
+
// Wire HTTPS_PROXY / HTTP_PROXY env vars into Node's global fetch dispatcher.
|
|
102
|
+
// Node 18-22's undici does NOT auto-honor these vars (Node 24+ does). Without
|
|
103
|
+
// this, the CLI fails with "fetch failed" on corporate networks. Idempotent
|
|
104
|
+
// and a no-op when no proxy var is set.
|
|
105
|
+
let proxyAgentInstalled = false;
|
|
106
|
+
async function ensureProxyAgent() {
|
|
107
|
+
if (proxyAgentInstalled)
|
|
108
|
+
return;
|
|
109
|
+
proxyAgentInstalled = true;
|
|
110
|
+
const proxyUrl = process.env.HTTPS_PROXY ||
|
|
111
|
+
process.env.https_proxy ||
|
|
112
|
+
process.env.HTTP_PROXY ||
|
|
113
|
+
process.env.http_proxy;
|
|
114
|
+
if (!proxyUrl)
|
|
115
|
+
return;
|
|
116
|
+
try {
|
|
117
|
+
// Dynamic import keeps undici out of the cold-start path when no proxy
|
|
118
|
+
// is in play. Node ships undici as part of the runtime so this resolves.
|
|
119
|
+
const { ProxyAgent, setGlobalDispatcher } = await import('undici');
|
|
120
|
+
setGlobalDispatcher(new ProxyAgent(proxyUrl));
|
|
121
|
+
log(`(routing through proxy ${proxyUrl})`);
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
log(`(could not configure proxy ${proxyUrl}: ${err instanceof Error ? err.message : String(err)})`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
101
127
|
async function postJson(url, body) {
|
|
128
|
+
await ensureProxyAgent();
|
|
102
129
|
const res = await fetch(url, {
|
|
103
130
|
method: 'POST',
|
|
104
131
|
headers: { 'Content-Type': 'application/json' },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heuresis/mcp",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.4",
|
|
4
4
|
"description": "Cloud-authenticated Model Context Protocol server for a Heuresis workspace. Logs into the user's Heuresis account and lets any MCP client (Claude Desktop, Claude Code, Cursor, custom agents) read and write the same workspace the webapp uses. 31 data tools, 3 operator tools (Branch/Matrix/C-K/ASIT/TRIZ/Free/Combine/Explore), and live Realtime change subscriptions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|