@aiwerk/mcp-bridge 1.1.2 → 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":
@@ -84,8 +84,9 @@ export async function convertJsonSchemaToTypeBox(schema, depth = 0) {
84
84
  stringOptions.pattern = schema.pattern;
85
85
  return Type.String(stringOptions);
86
86
  }
87
- case "number":
88
- case "integer": {
87
+ case "number": {
88
+ if (schema.enum)
89
+ return Type.Union(schema.enum.map((v) => Type.Literal(v)));
89
90
  const numberOptions = {};
90
91
  if (schema.minimum !== undefined)
91
92
  numberOptions.minimum = schema.minimum;
@@ -93,6 +94,16 @@ export async function convertJsonSchemaToTypeBox(schema, depth = 0) {
93
94
  numberOptions.maximum = schema.maximum;
94
95
  return Type.Number(numberOptions);
95
96
  }
97
+ case "integer": {
98
+ if (schema.enum)
99
+ return Type.Union(schema.enum.map((v) => Type.Literal(v)));
100
+ const intOptions = {};
101
+ if (schema.minimum !== undefined)
102
+ intOptions.minimum = schema.minimum;
103
+ if (schema.maximum !== undefined)
104
+ intOptions.maximum = schema.maximum;
105
+ return Type.Integer(intOptions);
106
+ }
96
107
  case "boolean":
97
108
  return Type.Boolean();
98
109
  case "array":
@@ -87,7 +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
- if (state.event === "endpoint") {
90
+ const eventType = state.event;
91
+ state.event = "";
92
+ if (eventType === "endpoint") {
91
93
  if (data.startsWith("/")) {
92
94
  const base = new URL(this.config.url);
93
95
  this.endpointUrl = `${base.origin}${data}`;
@@ -139,7 +139,7 @@ export class StreamableHttpTransport extends BaseTransport {
139
139
  }
140
140
  }
141
141
  catch (error) {
142
- this.logger.warn(`[mcp-bridge] Streamable HTTP server probe failed (non-blocking): ${error?.message || error}`);
142
+ this.logger.warn(`[mcp-bridge] Streamable HTTP server probe failed (non-blocking): ${error instanceof Error ? error.message : String(error)}`);
143
143
  }
144
144
  }
145
145
  async disconnect() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiwerk/mcp-bridge",
3
- "version": "1.1.2",
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",
@@ -9,7 +9,7 @@ if ($args.Count -eq 0) {
9
9
  Write-Host "Usage: install-server.ps1 <server-name> [--dry-run] [--remove]"
10
10
  Write-Host ""
11
11
  Write-Host "Available servers:"
12
- Get-ChildItem -Path (Join-Path $ScriptDir "servers") -Directory | ForEach-Object { Write-Host " - $($_.Name)" }
12
+ Get-ChildItem -Path (Join-Path (Split-Path $ScriptDir -Parent) "servers") -Directory | ForEach-Object { Write-Host " - $($_.Name)" }
13
13
  exit 1
14
14
  }
15
15
 
@@ -17,10 +17,10 @@ $ServerName = $args[0]
17
17
  $DryRun = $args -contains "--dry-run"
18
18
  $Remove = $args -contains "--remove"
19
19
 
20
- $ServerDir = Join-Path $ScriptDir "servers\$ServerName"
20
+ $ServerDir = Join-Path (Split-Path $ScriptDir -Parent) "servers\$ServerName"
21
21
  if (-not (Test-Path $ServerDir)) {
22
22
  Write-Host "Error: Server '$ServerName' not found."
23
- Get-ChildItem -Path (Join-Path $ScriptDir "servers") -Directory | ForEach-Object { Write-Host " - $($_.Name)" }
23
+ Get-ChildItem -Path (Join-Path (Split-Path $ScriptDir -Parent) "servers") -Directory | ForEach-Object { Write-Host " - $($_.Name)" }
24
24
  exit 1
25
25
  }
26
26
 
@@ -10,7 +10,7 @@ usage() {
10
10
  echo "Usage: $0 <server-name> [--dry-run] [--remove]"
11
11
  echo ""
12
12
  echo "Available servers:"
13
- for server_dir in "$SCRIPT_DIR/servers"/*; do
13
+ for server_dir in "$SCRIPT_DIR/../servers"/*; do
14
14
  [[ -d "$server_dir" ]] && echo " - $(basename "$server_dir")"
15
15
  done
16
16
  exit 1
@@ -30,7 +30,7 @@ while [[ $# -gt 0 ]]; do
30
30
  shift
31
31
  done
32
32
 
33
- SERVER_DIR="$SCRIPT_DIR/servers/$SERVER_NAME"
33
+ SERVER_DIR="$SCRIPT_DIR/../servers/$SERVER_NAME"
34
34
  if [[ ! -d "$SERVER_DIR" ]]; then
35
35
  echo "Error: Server '$SERVER_NAME' not found."
36
36
  usage