@hasna/mcps 0.0.27 → 0.0.28

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/bin/index.js CHANGED
@@ -12743,6 +12743,40 @@ function normalizeCandidate(value) {
12743
12743
  const trimmed = value?.trim();
12744
12744
  return trimmed ? trimmed : undefined;
12745
12745
  }
12746
+ function normalizeServerTransport(value, fallback = "stdio") {
12747
+ if (value === undefined)
12748
+ return fallback;
12749
+ if (typeof value !== "string") {
12750
+ throw new Error("Invalid transport type");
12751
+ }
12752
+ const transport = value.trim();
12753
+ if (!transport) {
12754
+ throw new Error("Invalid transport type");
12755
+ }
12756
+ if (!VALID_TRANSPORTS.has(transport)) {
12757
+ throw new Error("Invalid transport type");
12758
+ }
12759
+ return transport;
12760
+ }
12761
+ function normalizeServerUrl(value) {
12762
+ if (value === null || value === undefined)
12763
+ return null;
12764
+ if (typeof value !== "string") {
12765
+ throw new Error("URL must be a valid HTTP(S) URL");
12766
+ }
12767
+ const trimmed = value.trim();
12768
+ if (!trimmed)
12769
+ return null;
12770
+ try {
12771
+ const parsed = new URL(trimmed);
12772
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
12773
+ throw new Error("unsupported protocol");
12774
+ }
12775
+ } catch {
12776
+ throw new Error("URL must be a valid HTTP(S) URL");
12777
+ }
12778
+ return trimmed;
12779
+ }
12746
12780
  function pickNameFromArgs(args) {
12747
12781
  if (!args || args.length === 0)
12748
12782
  return;
@@ -12784,9 +12818,11 @@ function addServer(opts) {
12784
12818
  if (!id) {
12785
12819
  throw new Error("Unable to generate a valid server ID");
12786
12820
  }
12821
+ const transport = normalizeServerTransport(opts.transport);
12822
+ const url = normalizeServerUrl(opts.url);
12787
12823
  const row = db2.prepare(`INSERT INTO servers (id, name, description, command, args, env, credential_refs, transport, url, source)
12788
12824
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
12789
- RETURNING *`).get(id, name, opts.description || null, command, JSON.stringify(opts.args || []), JSON.stringify(normalizeLiteralEnv(opts.env)), JSON.stringify(normalizeCredentialRefs(opts.credentialRefs)), opts.transport || "stdio", opts.url || null, opts.source || "local");
12825
+ RETURNING *`).get(id, name, opts.description || null, command, JSON.stringify(opts.args || []), JSON.stringify(normalizeLiteralEnv(opts.env)), JSON.stringify(normalizeCredentialRefs(opts.credentialRefs)), transport, url, opts.source || "local");
12790
12826
  return parseRow(row);
12791
12827
  }
12792
12828
  function removeServer(id) {
@@ -12807,6 +12843,14 @@ function updateServer(id, updates) {
12807
12843
  const db2 = getDb();
12808
12844
  const sets = [];
12809
12845
  const values = [];
12846
+ let nextTransport;
12847
+ let nextUrl;
12848
+ if (updates.transport !== undefined) {
12849
+ nextTransport = normalizeServerTransport(updates.transport);
12850
+ }
12851
+ if (updates.url !== undefined) {
12852
+ nextUrl = normalizeServerUrl(updates.url);
12853
+ }
12810
12854
  if (updates.name !== undefined) {
12811
12855
  const name = normalizeCandidate(updates.name);
12812
12856
  if (!name) {
@@ -12841,11 +12885,11 @@ function updateServer(id, updates) {
12841
12885
  }
12842
12886
  if (updates.transport !== undefined) {
12843
12887
  sets.push("transport = ?");
12844
- values.push(updates.transport);
12888
+ values.push(nextTransport);
12845
12889
  }
12846
12890
  if (updates.url !== undefined) {
12847
12891
  sets.push("url = ?");
12848
- values.push(updates.url);
12892
+ values.push(nextUrl ?? null);
12849
12893
  }
12850
12894
  if (updates.enabled !== undefined) {
12851
12895
  sets.push("enabled = ?");
@@ -12953,9 +12997,15 @@ function getCachedTools(serverId) {
12953
12997
  input_schema: safeJsonParse(r.input_schema, {})
12954
12998
  }));
12955
12999
  }
13000
+ var VALID_TRANSPORTS;
12956
13001
  var init_registry = __esm(() => {
12957
13002
  init_db();
12958
13003
  init_credentials();
13004
+ VALID_TRANSPORTS = new Set([
13005
+ "stdio",
13006
+ "sse",
13007
+ "streamable-http"
13008
+ ]);
12959
13009
  });
12960
13010
 
12961
13011
  // node_modules/zod/v3/helpers/util.js
@@ -34649,14 +34699,11 @@ function buildEnv(extra) {
34649
34699
  return merged;
34650
34700
  }
34651
34701
  function requireUrl(entry) {
34652
- if (!entry.url) {
34702
+ const url2 = normalizeServerUrl(entry.url);
34703
+ if (!url2) {
34653
34704
  throw new Error(`Server "${entry.id}" is missing a URL for ${entry.transport} transport`);
34654
34705
  }
34655
- try {
34656
- return new URL(entry.url);
34657
- } catch {
34658
- throw new Error(`Server "${entry.id}" has an invalid URL: ${entry.url}`);
34659
- }
34706
+ return new URL(url2);
34660
34707
  }
34661
34708
  async function connectToServer(entry, options = {}) {
34662
34709
  if (connections.has(entry.id)) {
@@ -34688,8 +34735,10 @@ async function connectToServer(entry, options = {}) {
34688
34735
  });
34689
34736
  } else if (entry.transport === "sse") {
34690
34737
  transport = new SSEClientTransport(requireUrl(entry));
34691
- } else {
34738
+ } else if (entry.transport === "streamable-http") {
34692
34739
  transport = new StreamableHTTPClientTransport(requireUrl(entry));
34740
+ } else {
34741
+ throw new Error(`Unsupported transport type for server "${entry.id}": ${entry.transport}`);
34693
34742
  }
34694
34743
  await client.connect(transport);
34695
34744
  const result = await client.listTools();
@@ -36454,7 +36503,7 @@ var init_provider_profiles = __esm(() => {
36454
36503
  var require_package = __commonJS((exports, module) => {
36455
36504
  module.exports = {
36456
36505
  name: "@hasna/mcps",
36457
- version: "0.0.27",
36506
+ version: "0.0.28",
36458
36507
  description: "Meta-MCP registry & CLI \u2014 discover, manage, and proxy MCP servers",
36459
36508
  type: "module",
36460
36509
  repository: {
@@ -45430,6 +45479,16 @@ program2.command("import").argument("<file>", "Path to the export JSON file").de
45430
45479
  }
45431
45480
  const literalEnv = normalizeLiteralEnv(s.env ?? {});
45432
45481
  const credentialRefs = normalizeCredentialRefs(s.credentialRefs ?? s.credential_refs ?? {});
45482
+ let transport;
45483
+ let url2;
45484
+ try {
45485
+ transport = normalizeServerTransport(s.transport);
45486
+ url2 = normalizeServerUrl(s.url);
45487
+ } catch (err) {
45488
+ console.error(chalk2.red(`Invalid server in import "${s.id ?? "(unknown)"}": ${err.message}`));
45489
+ closeDb();
45490
+ process.exit(1);
45491
+ }
45433
45492
  db2.run(`INSERT ${orReplace} INTO servers (id, name, description, command, args, env, credential_refs, transport, url, source, enabled, created_at, updated_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)`, [
45434
45493
  s.id,
45435
45494
  s.name,
@@ -45438,8 +45497,8 @@ program2.command("import").argument("<file>", "Path to the export JSON file").de
45438
45497
  JSON.stringify(s.args ?? []),
45439
45498
  JSON.stringify(literalEnv),
45440
45499
  JSON.stringify(credentialRefs),
45441
- s.transport,
45442
- s.url,
45500
+ transport,
45501
+ url2,
45443
45502
  s.source,
45444
45503
  s.enabled ? 1 : 0,
45445
45504
  s.created_at,
package/bin/mcp.js CHANGED
@@ -30759,6 +30759,40 @@ function normalizeCandidate(value) {
30759
30759
  const trimmed = value?.trim();
30760
30760
  return trimmed ? trimmed : undefined;
30761
30761
  }
30762
+ function normalizeServerTransport(value, fallback = "stdio") {
30763
+ if (value === undefined)
30764
+ return fallback;
30765
+ if (typeof value !== "string") {
30766
+ throw new Error("Invalid transport type");
30767
+ }
30768
+ const transport = value.trim();
30769
+ if (!transport) {
30770
+ throw new Error("Invalid transport type");
30771
+ }
30772
+ if (!VALID_TRANSPORTS.has(transport)) {
30773
+ throw new Error("Invalid transport type");
30774
+ }
30775
+ return transport;
30776
+ }
30777
+ function normalizeServerUrl(value) {
30778
+ if (value === null || value === undefined)
30779
+ return null;
30780
+ if (typeof value !== "string") {
30781
+ throw new Error("URL must be a valid HTTP(S) URL");
30782
+ }
30783
+ const trimmed = value.trim();
30784
+ if (!trimmed)
30785
+ return null;
30786
+ try {
30787
+ const parsed = new URL(trimmed);
30788
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
30789
+ throw new Error("unsupported protocol");
30790
+ }
30791
+ } catch {
30792
+ throw new Error("URL must be a valid HTTP(S) URL");
30793
+ }
30794
+ return trimmed;
30795
+ }
30762
30796
  function pickNameFromArgs(args) {
30763
30797
  if (!args || args.length === 0)
30764
30798
  return;
@@ -30800,9 +30834,11 @@ function addServer(opts) {
30800
30834
  if (!id) {
30801
30835
  throw new Error("Unable to generate a valid server ID");
30802
30836
  }
30837
+ const transport = normalizeServerTransport(opts.transport);
30838
+ const url2 = normalizeServerUrl(opts.url);
30803
30839
  const row = db2.prepare(`INSERT INTO servers (id, name, description, command, args, env, credential_refs, transport, url, source)
30804
30840
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
30805
- RETURNING *`).get(id, name, opts.description || null, command, JSON.stringify(opts.args || []), JSON.stringify(normalizeLiteralEnv(opts.env)), JSON.stringify(normalizeCredentialRefs(opts.credentialRefs)), opts.transport || "stdio", opts.url || null, opts.source || "local");
30841
+ RETURNING *`).get(id, name, opts.description || null, command, JSON.stringify(opts.args || []), JSON.stringify(normalizeLiteralEnv(opts.env)), JSON.stringify(normalizeCredentialRefs(opts.credentialRefs)), transport, url2, opts.source || "local");
30806
30842
  return parseRow(row);
30807
30843
  }
30808
30844
  function removeServer(id) {
@@ -30823,6 +30859,14 @@ function updateServer(id, updates) {
30823
30859
  const db2 = getDb();
30824
30860
  const sets = [];
30825
30861
  const values = [];
30862
+ let nextTransport;
30863
+ let nextUrl;
30864
+ if (updates.transport !== undefined) {
30865
+ nextTransport = normalizeServerTransport(updates.transport);
30866
+ }
30867
+ if (updates.url !== undefined) {
30868
+ nextUrl = normalizeServerUrl(updates.url);
30869
+ }
30826
30870
  if (updates.name !== undefined) {
30827
30871
  const name = normalizeCandidate(updates.name);
30828
30872
  if (!name) {
@@ -30857,11 +30901,11 @@ function updateServer(id, updates) {
30857
30901
  }
30858
30902
  if (updates.transport !== undefined) {
30859
30903
  sets.push("transport = ?");
30860
- values.push(updates.transport);
30904
+ values.push(nextTransport);
30861
30905
  }
30862
30906
  if (updates.url !== undefined) {
30863
30907
  sets.push("url = ?");
30864
- values.push(updates.url);
30908
+ values.push(nextUrl ?? null);
30865
30909
  }
30866
30910
  if (updates.enabled !== undefined) {
30867
30911
  sets.push("enabled = ?");
@@ -30914,9 +30958,15 @@ function getCachedTools(serverId) {
30914
30958
  input_schema: safeJsonParse(r.input_schema, {})
30915
30959
  }));
30916
30960
  }
30961
+ var VALID_TRANSPORTS;
30917
30962
  var init_registry = __esm(() => {
30918
30963
  init_db();
30919
30964
  init_credentials();
30965
+ VALID_TRANSPORTS = new Set([
30966
+ "stdio",
30967
+ "sse",
30968
+ "streamable-http"
30969
+ ]);
30920
30970
  });
30921
30971
 
30922
30972
  // src/lib/local-command-consent.ts
@@ -34452,14 +34502,11 @@ function buildEnv(extra) {
34452
34502
  return merged;
34453
34503
  }
34454
34504
  function requireUrl(entry) {
34455
- if (!entry.url) {
34505
+ const url2 = normalizeServerUrl(entry.url);
34506
+ if (!url2) {
34456
34507
  throw new Error(`Server "${entry.id}" is missing a URL for ${entry.transport} transport`);
34457
34508
  }
34458
- try {
34459
- return new URL(entry.url);
34460
- } catch {
34461
- throw new Error(`Server "${entry.id}" has an invalid URL: ${entry.url}`);
34462
- }
34509
+ return new URL(url2);
34463
34510
  }
34464
34511
  async function connectToServer(entry, options = {}) {
34465
34512
  if (connections.has(entry.id)) {
@@ -34491,8 +34538,10 @@ async function connectToServer(entry, options = {}) {
34491
34538
  });
34492
34539
  } else if (entry.transport === "sse") {
34493
34540
  transport = new SSEClientTransport(requireUrl(entry));
34494
- } else {
34541
+ } else if (entry.transport === "streamable-http") {
34495
34542
  transport = new StreamableHTTPClientTransport(requireUrl(entry));
34543
+ } else {
34544
+ throw new Error(`Unsupported transport type for server "${entry.id}": ${entry.transport}`);
34496
34545
  }
34497
34546
  await client.connect(transport);
34498
34547
  const result = await client.listTools();
package/dist/index.js CHANGED
@@ -17441,6 +17441,11 @@ function credentialRefPlaceholders(refs) {
17441
17441
  }
17442
17442
 
17443
17443
  // src/lib/registry.ts
17444
+ var VALID_TRANSPORTS = new Set([
17445
+ "stdio",
17446
+ "sse",
17447
+ "streamable-http"
17448
+ ]);
17444
17449
  function parseRow(row) {
17445
17450
  return {
17446
17451
  id: row.id,
@@ -17476,6 +17481,40 @@ function normalizeCandidate(value) {
17476
17481
  const trimmed = value?.trim();
17477
17482
  return trimmed ? trimmed : undefined;
17478
17483
  }
17484
+ function normalizeServerTransport(value, fallback = "stdio") {
17485
+ if (value === undefined)
17486
+ return fallback;
17487
+ if (typeof value !== "string") {
17488
+ throw new Error("Invalid transport type");
17489
+ }
17490
+ const transport = value.trim();
17491
+ if (!transport) {
17492
+ throw new Error("Invalid transport type");
17493
+ }
17494
+ if (!VALID_TRANSPORTS.has(transport)) {
17495
+ throw new Error("Invalid transport type");
17496
+ }
17497
+ return transport;
17498
+ }
17499
+ function normalizeServerUrl(value) {
17500
+ if (value === null || value === undefined)
17501
+ return null;
17502
+ if (typeof value !== "string") {
17503
+ throw new Error("URL must be a valid HTTP(S) URL");
17504
+ }
17505
+ const trimmed = value.trim();
17506
+ if (!trimmed)
17507
+ return null;
17508
+ try {
17509
+ const parsed = new URL(trimmed);
17510
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
17511
+ throw new Error("unsupported protocol");
17512
+ }
17513
+ } catch {
17514
+ throw new Error("URL must be a valid HTTP(S) URL");
17515
+ }
17516
+ return trimmed;
17517
+ }
17479
17518
  function pickNameFromArgs(args) {
17480
17519
  if (!args || args.length === 0)
17481
17520
  return;
@@ -17517,9 +17556,11 @@ function addServer(opts) {
17517
17556
  if (!id) {
17518
17557
  throw new Error("Unable to generate a valid server ID");
17519
17558
  }
17559
+ const transport = normalizeServerTransport(opts.transport);
17560
+ const url = normalizeServerUrl(opts.url);
17520
17561
  const row = db2.prepare(`INSERT INTO servers (id, name, description, command, args, env, credential_refs, transport, url, source)
17521
17562
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
17522
- RETURNING *`).get(id, name, opts.description || null, command, JSON.stringify(opts.args || []), JSON.stringify(normalizeLiteralEnv(opts.env)), JSON.stringify(normalizeCredentialRefs(opts.credentialRefs)), opts.transport || "stdio", opts.url || null, opts.source || "local");
17563
+ RETURNING *`).get(id, name, opts.description || null, command, JSON.stringify(opts.args || []), JSON.stringify(normalizeLiteralEnv(opts.env)), JSON.stringify(normalizeCredentialRefs(opts.credentialRefs)), transport, url, opts.source || "local");
17523
17564
  return parseRow(row);
17524
17565
  }
17525
17566
  function removeServer(id) {
@@ -17540,6 +17581,14 @@ function updateServer(id, updates) {
17540
17581
  const db2 = getDb();
17541
17582
  const sets = [];
17542
17583
  const values = [];
17584
+ let nextTransport;
17585
+ let nextUrl;
17586
+ if (updates.transport !== undefined) {
17587
+ nextTransport = normalizeServerTransport(updates.transport);
17588
+ }
17589
+ if (updates.url !== undefined) {
17590
+ nextUrl = normalizeServerUrl(updates.url);
17591
+ }
17543
17592
  if (updates.name !== undefined) {
17544
17593
  const name = normalizeCandidate(updates.name);
17545
17594
  if (!name) {
@@ -17574,11 +17623,11 @@ function updateServer(id, updates) {
17574
17623
  }
17575
17624
  if (updates.transport !== undefined) {
17576
17625
  sets.push("transport = ?");
17577
- values.push(updates.transport);
17626
+ values.push(nextTransport);
17578
17627
  }
17579
17628
  if (updates.url !== undefined) {
17580
17629
  sets.push("url = ?");
17581
- values.push(updates.url);
17630
+ values.push(nextUrl ?? null);
17582
17631
  }
17583
17632
  if (updates.enabled !== undefined) {
17584
17633
  sets.push("enabled = ?");
@@ -25998,14 +26047,11 @@ function buildEnv(extra) {
25998
26047
  return merged;
25999
26048
  }
26000
26049
  function requireUrl(entry) {
26001
- if (!entry.url) {
26050
+ const url2 = normalizeServerUrl(entry.url);
26051
+ if (!url2) {
26002
26052
  throw new Error(`Server "${entry.id}" is missing a URL for ${entry.transport} transport`);
26003
26053
  }
26004
- try {
26005
- return new URL(entry.url);
26006
- } catch {
26007
- throw new Error(`Server "${entry.id}" has an invalid URL: ${entry.url}`);
26008
- }
26054
+ return new URL(url2);
26009
26055
  }
26010
26056
  async function connectToServer(entry, options = {}) {
26011
26057
  if (connections.has(entry.id)) {
@@ -26037,8 +26083,10 @@ async function connectToServer(entry, options = {}) {
26037
26083
  });
26038
26084
  } else if (entry.transport === "sse") {
26039
26085
  transport = new SSEClientTransport(requireUrl(entry));
26040
- } else {
26086
+ } else if (entry.transport === "streamable-http") {
26041
26087
  transport = new StreamableHTTPClientTransport(requireUrl(entry));
26088
+ } else {
26089
+ throw new Error(`Unsupported transport type for server "${entry.id}": ${entry.transport}`);
26042
26090
  }
26043
26091
  await client.connect(transport);
26044
26092
  const result = await client.listTools();
@@ -1,4 +1,7 @@
1
1
  import type { CredentialReference, McpServerEntry, AddServerOptions } from "../types.js";
2
+ export declare const VALID_TRANSPORTS: Set<"stdio" | "sse" | "streamable-http">;
3
+ export declare function normalizeServerTransport(value: unknown, fallback?: McpServerEntry["transport"]): McpServerEntry["transport"];
4
+ export declare function normalizeServerUrl(value: unknown): string | null;
2
5
  export declare function addServer(opts: AddServerOptions): McpServerEntry;
3
6
  export declare function removeServer(id: string): void;
4
7
  export declare function listServers(): McpServerEntry[];
package/dist/mcp/index.js CHANGED
@@ -30759,6 +30759,40 @@ function normalizeCandidate(value) {
30759
30759
  const trimmed = value?.trim();
30760
30760
  return trimmed ? trimmed : undefined;
30761
30761
  }
30762
+ function normalizeServerTransport(value, fallback = "stdio") {
30763
+ if (value === undefined)
30764
+ return fallback;
30765
+ if (typeof value !== "string") {
30766
+ throw new Error("Invalid transport type");
30767
+ }
30768
+ const transport = value.trim();
30769
+ if (!transport) {
30770
+ throw new Error("Invalid transport type");
30771
+ }
30772
+ if (!VALID_TRANSPORTS.has(transport)) {
30773
+ throw new Error("Invalid transport type");
30774
+ }
30775
+ return transport;
30776
+ }
30777
+ function normalizeServerUrl(value) {
30778
+ if (value === null || value === undefined)
30779
+ return null;
30780
+ if (typeof value !== "string") {
30781
+ throw new Error("URL must be a valid HTTP(S) URL");
30782
+ }
30783
+ const trimmed = value.trim();
30784
+ if (!trimmed)
30785
+ return null;
30786
+ try {
30787
+ const parsed = new URL(trimmed);
30788
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
30789
+ throw new Error("unsupported protocol");
30790
+ }
30791
+ } catch {
30792
+ throw new Error("URL must be a valid HTTP(S) URL");
30793
+ }
30794
+ return trimmed;
30795
+ }
30762
30796
  function pickNameFromArgs(args) {
30763
30797
  if (!args || args.length === 0)
30764
30798
  return;
@@ -30800,9 +30834,11 @@ function addServer(opts) {
30800
30834
  if (!id) {
30801
30835
  throw new Error("Unable to generate a valid server ID");
30802
30836
  }
30837
+ const transport = normalizeServerTransport(opts.transport);
30838
+ const url2 = normalizeServerUrl(opts.url);
30803
30839
  const row = db2.prepare(`INSERT INTO servers (id, name, description, command, args, env, credential_refs, transport, url, source)
30804
30840
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
30805
- RETURNING *`).get(id, name, opts.description || null, command, JSON.stringify(opts.args || []), JSON.stringify(normalizeLiteralEnv(opts.env)), JSON.stringify(normalizeCredentialRefs(opts.credentialRefs)), opts.transport || "stdio", opts.url || null, opts.source || "local");
30841
+ RETURNING *`).get(id, name, opts.description || null, command, JSON.stringify(opts.args || []), JSON.stringify(normalizeLiteralEnv(opts.env)), JSON.stringify(normalizeCredentialRefs(opts.credentialRefs)), transport, url2, opts.source || "local");
30806
30842
  return parseRow(row);
30807
30843
  }
30808
30844
  function removeServer(id) {
@@ -30823,6 +30859,14 @@ function updateServer(id, updates) {
30823
30859
  const db2 = getDb();
30824
30860
  const sets = [];
30825
30861
  const values = [];
30862
+ let nextTransport;
30863
+ let nextUrl;
30864
+ if (updates.transport !== undefined) {
30865
+ nextTransport = normalizeServerTransport(updates.transport);
30866
+ }
30867
+ if (updates.url !== undefined) {
30868
+ nextUrl = normalizeServerUrl(updates.url);
30869
+ }
30826
30870
  if (updates.name !== undefined) {
30827
30871
  const name = normalizeCandidate(updates.name);
30828
30872
  if (!name) {
@@ -30857,11 +30901,11 @@ function updateServer(id, updates) {
30857
30901
  }
30858
30902
  if (updates.transport !== undefined) {
30859
30903
  sets.push("transport = ?");
30860
- values.push(updates.transport);
30904
+ values.push(nextTransport);
30861
30905
  }
30862
30906
  if (updates.url !== undefined) {
30863
30907
  sets.push("url = ?");
30864
- values.push(updates.url);
30908
+ values.push(nextUrl ?? null);
30865
30909
  }
30866
30910
  if (updates.enabled !== undefined) {
30867
30911
  sets.push("enabled = ?");
@@ -30914,9 +30958,15 @@ function getCachedTools(serverId) {
30914
30958
  input_schema: safeJsonParse(r.input_schema, {})
30915
30959
  }));
30916
30960
  }
30961
+ var VALID_TRANSPORTS;
30917
30962
  var init_registry = __esm(() => {
30918
30963
  init_db();
30919
30964
  init_credentials();
30965
+ VALID_TRANSPORTS = new Set([
30966
+ "stdio",
30967
+ "sse",
30968
+ "streamable-http"
30969
+ ]);
30920
30970
  });
30921
30971
 
30922
30972
  // src/lib/local-command-consent.ts
@@ -34452,14 +34502,11 @@ function buildEnv(extra) {
34452
34502
  return merged;
34453
34503
  }
34454
34504
  function requireUrl(entry) {
34455
- if (!entry.url) {
34505
+ const url2 = normalizeServerUrl(entry.url);
34506
+ if (!url2) {
34456
34507
  throw new Error(`Server "${entry.id}" is missing a URL for ${entry.transport} transport`);
34457
34508
  }
34458
- try {
34459
- return new URL(entry.url);
34460
- } catch {
34461
- throw new Error(`Server "${entry.id}" has an invalid URL: ${entry.url}`);
34462
- }
34509
+ return new URL(url2);
34463
34510
  }
34464
34511
  async function connectToServer(entry, options = {}) {
34465
34512
  if (connections.has(entry.id)) {
@@ -34491,8 +34538,10 @@ async function connectToServer(entry, options = {}) {
34491
34538
  });
34492
34539
  } else if (entry.transport === "sse") {
34493
34540
  transport = new SSEClientTransport(requireUrl(entry));
34494
- } else {
34541
+ } else if (entry.transport === "streamable-http") {
34495
34542
  transport = new StreamableHTTPClientTransport(requireUrl(entry));
34543
+ } else {
34544
+ throw new Error(`Unsupported transport type for server "${entry.id}": ${entry.transport}`);
34496
34545
  }
34497
34546
  await client.connect(transport);
34498
34547
  const result = await client.listTools();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/mcps",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "description": "Meta-MCP registry & CLI — discover, manage, and proxy MCP servers",
5
5
  "type": "module",
6
6
  "repository": {