@wrongstack/mcp 0.292.1 → 0.295.0

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/README.md CHANGED
@@ -13,7 +13,7 @@ Connect any [Model Context Protocol](https://modelcontextprotocol.io) server to
13
13
  ## Quick Start
14
14
 
15
15
  ```json
16
- // ~/.wrongstack/config.json
16
+ // ~/.wrongstack/profiles/<name>/config.json
17
17
  {
18
18
  "mcpServers": {
19
19
  "filesystem": {
package/dist/index.js CHANGED
@@ -739,7 +739,7 @@ function boundedServerName(value) {
739
739
 
740
740
  // src/client.ts
741
741
  import { spawn } from "node:child_process";
742
- import { buildChildEnv } from "@wrongstack/core";
742
+ import { buildChildEnv } from "@wrongstack/core/utils";
743
743
  import { toErrorMessage } from "@wrongstack/core/utils";
744
744
 
745
745
  // src/constants.ts
@@ -1015,7 +1015,7 @@ function normalizeMCPTools(value) {
1015
1015
  }
1016
1016
 
1017
1017
  // src/transport-jsonrpc.ts
1018
- import { ToolError } from "@wrongstack/core";
1018
+ import { ToolError } from "@wrongstack/core/types";
1019
1019
  function isJsonRpcResult(v) {
1020
1020
  if (typeof v !== "object" || v === null) return false;
1021
1021
  const r = v;
@@ -1103,7 +1103,7 @@ function assertMatchingJsonRpcResult(data, expectedId, method) {
1103
1103
  }
1104
1104
 
1105
1105
  // src/sse-reader.ts
1106
- import { ToolError as ToolError2 } from "@wrongstack/core";
1106
+ import { ToolError as ToolError2 } from "@wrongstack/core/types";
1107
1107
  var SSE_READER_MAX_BUFFER = 256 * 1024;
1108
1108
  var SSE_READER_MAX_DATA_LINES = 1024;
1109
1109
  var SSEReader = class {
@@ -1139,13 +1139,16 @@ var SSEReader = class {
1139
1139
  }
1140
1140
  });
1141
1141
  }
1142
- let idx = this.buffer.indexOf("\n");
1142
+ let start = 0;
1143
+ let idx = this.buffer.indexOf("\n", start);
1143
1144
  while (idx !== -1) {
1144
- const line = this.buffer.slice(0, idx).replace(/\r$/, "");
1145
- this.buffer = this.buffer.slice(idx + 1);
1146
- idx = this.buffer.indexOf("\n");
1147
- this.processLine(line);
1145
+ let end = idx;
1146
+ if (end > start && this.buffer.charCodeAt(end - 1) === 13) end--;
1147
+ this.processLine(this.buffer.slice(start, end));
1148
+ start = idx + 1;
1149
+ idx = this.buffer.indexOf("\n", start);
1148
1150
  }
1151
+ if (start > 0) this.buffer = this.buffer.slice(start);
1149
1152
  }
1150
1153
  processLine(line) {
1151
1154
  if (line === "") {
@@ -1204,11 +1207,11 @@ var SSEReader = class {
1204
1207
 
1205
1208
  // src/transport-base.ts
1206
1209
  import * as https2 from "node:https";
1207
- import { ConfigError as ConfigError2 } from "@wrongstack/core";
1210
+ import { ConfigError as ConfigError2 } from "@wrongstack/core/types";
1208
1211
 
1209
1212
  // src/transport-security.ts
1210
1213
  import * as net2 from "node:net";
1211
- import { ConfigError } from "@wrongstack/core";
1214
+ import { ConfigError } from "@wrongstack/core/types";
1212
1215
  function isTlsUnsafeAllowed() {
1213
1216
  return process.env["WRONGSTACK_UNSAFE_MCP_TLS"] === "1";
1214
1217
  }
@@ -1452,7 +1455,7 @@ var BaseHTTPTransport = class {
1452
1455
 
1453
1456
  // src/transport-sse.ts
1454
1457
  import { randomBytes as randomBytes2 } from "node:crypto";
1455
- import { ToolError as ToolError3 } from "@wrongstack/core";
1458
+ import { ToolError as ToolError3 } from "@wrongstack/core/types";
1456
1459
  var SSETransport = class extends BaseHTTPTransport {
1457
1460
  _nextId = 1;
1458
1461
  readerDone = false;
@@ -2917,6 +2920,8 @@ function projectServer(name, cfg, registry) {
2917
2920
  if (cfg.description !== void 0) info.description = cfg.description;
2918
2921
  if (cfg.url !== void 0) info.url = cfg.url;
2919
2922
  if (cfg.command !== void 0) info.command = cfg.command;
2923
+ if (cfg.args !== void 0) info.args = cfg.args;
2924
+ if (cfg.env !== void 0) info.env = cfg.env;
2920
2925
  if (cfg.lazy !== void 0) info.lazy = cfg.lazy;
2921
2926
  return info;
2922
2927
  }
@@ -3268,10 +3273,10 @@ function percentile(sorted, ratio) {
3268
3273
  }
3269
3274
 
3270
3275
  // src/registry.ts
3271
- import { expectDefined } from "@wrongstack/core";
3276
+ import { expectDefined } from "@wrongstack/core/utils";
3272
3277
 
3273
3278
  // src/wrap-tool.ts
3274
- import { ToolCapabilities } from "@wrongstack/core";
3279
+ import { ToolCapabilities } from "@wrongstack/core/security";
3275
3280
  var MUTATING_RE = /create|update|delete|write|send|set|put|post|patch|remove|rename|move/i;
3276
3281
  function isMutatingTool(mcpTool) {
3277
3282
  if (MUTATING_RE.test(mcpTool.name)) return true;
@@ -4298,7 +4303,7 @@ function catalogSnapshot(slot) {
4298
4303
 
4299
4304
  // src/server.ts
4300
4305
  import { createServer } from "node:http";
4301
- import { expectDefined as expectDefined2 } from "@wrongstack/core";
4306
+ import { expectDefined as expectDefined2 } from "@wrongstack/core/utils";
4302
4307
  import { toErrorMessage as toErrorMessage2 } from "@wrongstack/core/utils";
4303
4308
  var PARSE_ERROR = -32700;
4304
4309
  var INVALID_REQUEST = -32600;