@aiwerk/mcp-bridge 1.1.3 → 1.1.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.
@@ -67,6 +67,10 @@ function parseArgs(argv) {
67
67
  break;
68
68
  case "--config":
69
69
  i++;
70
+ if (!argv[i]) {
71
+ process.stderr.write("Error: --config requires a path\n");
72
+ process.exit(1);
73
+ }
70
74
  args.configPath = resolve(argv[i]);
71
75
  break;
72
76
  case "--verbose":
@@ -85,23 +85,23 @@ export async function convertJsonSchemaToTypeBox(schema, depth = 0) {
85
85
  return Type.String(stringOptions);
86
86
  }
87
87
  case "number": {
88
+ if (schema.enum)
89
+ return Type.Union(schema.enum.map((v) => Type.Literal(v)));
88
90
  const numberOptions = {};
89
91
  if (schema.minimum !== undefined)
90
92
  numberOptions.minimum = schema.minimum;
91
93
  if (schema.maximum !== undefined)
92
94
  numberOptions.maximum = schema.maximum;
93
- if (schema.enum)
94
- return Type.Union(schema.enum.map((v) => Type.Literal(v)));
95
95
  return Type.Number(numberOptions);
96
96
  }
97
97
  case "integer": {
98
+ if (schema.enum)
99
+ return Type.Union(schema.enum.map((v) => Type.Literal(v)));
98
100
  const intOptions = {};
99
101
  if (schema.minimum !== undefined)
100
102
  intOptions.minimum = schema.minimum;
101
103
  if (schema.maximum !== undefined)
102
104
  intOptions.maximum = schema.maximum;
103
- if (schema.enum)
104
- return Type.Union(schema.enum.map((v) => Type.Literal(v)));
105
105
  return Type.Integer(intOptions);
106
106
  }
107
107
  case "boolean":
@@ -87,8 +87,9 @@ export class SseTransport extends BaseTransport {
87
87
  return;
88
88
  const data = state.dataBuffer.join("\n");
89
89
  state.dataBuffer.length = 0;
90
+ const eventType = state.event;
90
91
  state.event = "";
91
- if (state.event === "endpoint") {
92
+ if (eventType === "endpoint") {
92
93
  if (data.startsWith("/")) {
93
94
  const base = new URL(this.config.url);
94
95
  this.endpointUrl = `${base.origin}${data}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiwerk/mcp-bridge",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Standalone MCP server that multiplexes multiple MCP servers into one interface",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",