@hasna/connectors 0.2.8 → 0.3.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.
Files changed (3) hide show
  1. package/bin/index.js +3 -3
  2. package/bin/mcp.js +88 -59
  3. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -6583,7 +6583,7 @@ var PRESETS = {
6583
6583
  commerce: { description: "Commerce and finance", connectors: ["stripe", "shopify", "revolut", "mercury", "pandadoc"] }
6584
6584
  };
6585
6585
  var program2 = new Command;
6586
- program2.name("connectors").description("Install API connectors for your project").version("0.2.8");
6586
+ program2.name("connectors").description("Install API connectors for your project").version("0.3.0");
6587
6587
  program2.command("interactive", { isDefault: true }).alias("i").description("Interactive connector browser").action(() => {
6588
6588
  if (!isTTY) {
6589
6589
  console.log(`Non-interactive environment detected. Use a subcommand:
@@ -7746,7 +7746,7 @@ program2.command("import").argument("<file>", "JSON backup file to import (use -
7746
7746
  }
7747
7747
  });
7748
7748
  program2.command("upgrade").alias("self-update").option("--check", "Only check for updates, don't install", false).option("--json", "Output as JSON", false).description("Check for updates and upgrade to the latest version").action(async (options) => {
7749
- const currentVersion = "0.2.8";
7749
+ const currentVersion = "0.3.0";
7750
7750
  try {
7751
7751
  const res = await fetch("https://registry.npmjs.org/@hasna/connectors/latest");
7752
7752
  if (!res.ok)
@@ -7962,7 +7962,7 @@ Available presets:
7962
7962
  program2.command("whoami").option("--json", "Output as JSON", false).description("Show current setup: config dir, installed connectors, auth status").action((options) => {
7963
7963
  const configDir = join5(homedir3(), ".connectors");
7964
7964
  const installed = getInstalledConnectors();
7965
- const version = "0.2.8";
7965
+ const version = "0.3.0";
7966
7966
  let configured = 0;
7967
7967
  let unconfigured = 0;
7968
7968
  const connectorDetails = [];
package/bin/mcp.js CHANGED
@@ -20275,14 +20275,12 @@ function guessKeyField(name) {
20275
20275
  loadConnectorVersions();
20276
20276
  var server = new McpServer({
20277
20277
  name: "connectors",
20278
- version: "0.2.8"
20278
+ version: "0.3.0"
20279
20279
  });
20280
20280
  server.registerTool("search_connectors", {
20281
20281
  title: "Search Connectors",
20282
- description: "Search connectors by name, keyword, or description.",
20283
- inputSchema: {
20284
- query: exports_external.string().describe("Search query")
20285
- }
20282
+ description: "Search connectors by name or keyword.",
20283
+ inputSchema: { query: exports_external.string() }
20286
20284
  }, async ({ query }) => {
20287
20285
  const results = searchConnectors(query);
20288
20286
  return {
@@ -20302,11 +20300,12 @@ server.registerTool("search_connectors", {
20302
20300
  });
20303
20301
  server.registerTool("list_connectors", {
20304
20302
  title: "List Connectors",
20305
- description: "List connectors, optionally filtered by category.",
20303
+ description: "List connectors. category filters; compact=true returns names only.",
20306
20304
  inputSchema: {
20307
- category: exports_external.string().optional().describe("Filter by category (e.g. 'AI & ML', 'Developer Tools')")
20305
+ category: exports_external.string().optional(),
20306
+ compact: exports_external.boolean().optional()
20308
20307
  }
20309
- }, async ({ category }) => {
20308
+ }, async ({ category, compact }) => {
20310
20309
  let connectors = CONNECTORS;
20311
20310
  if (category) {
20312
20311
  const matched = CATEGORIES.find((c) => c.toLowerCase() === category.toLowerCase());
@@ -20323,28 +20322,25 @@ server.registerTool("list_connectors", {
20323
20322
  }
20324
20323
  connectors = getConnectorsByCategory(matched);
20325
20324
  }
20325
+ const data = compact ? connectors.map((c) => c.name) : connectors.map((c) => ({
20326
+ name: c.name,
20327
+ displayName: c.displayName,
20328
+ version: c.version,
20329
+ category: c.category,
20330
+ description: c.description
20331
+ }));
20326
20332
  return {
20327
- content: [
20328
- {
20329
- type: "text",
20330
- text: JSON.stringify(connectors.map((c) => ({
20331
- name: c.name,
20332
- displayName: c.displayName,
20333
- version: c.version,
20334
- category: c.category,
20335
- description: c.description
20336
- })), null, 2)
20337
- }
20338
- ]
20333
+ content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
20339
20334
  };
20340
20335
  });
20341
20336
  server.registerTool("connector_docs", {
20342
20337
  title: "Connector Documentation",
20343
- description: "Get auth, env vars, CLI commands, and API docs for a connector.",
20338
+ description: "Get connector docs. essential=true returns auth+envVars only.",
20344
20339
  inputSchema: {
20345
- name: exports_external.string().describe("Connector name")
20340
+ name: exports_external.string(),
20341
+ essential: exports_external.boolean().optional()
20346
20342
  }
20347
- }, async ({ name }) => {
20343
+ }, async ({ name, essential }) => {
20348
20344
  const meta = getConnector(name);
20349
20345
  if (!meta) {
20350
20346
  return {
@@ -20359,32 +20355,28 @@ server.registerTool("connector_docs", {
20359
20355
  isError: true
20360
20356
  };
20361
20357
  }
20358
+ const data = essential ? { name: meta.name, auth: docs.auth, envVars: docs.envVars } : {
20359
+ name: meta.name,
20360
+ displayName: meta.displayName,
20361
+ version: meta.version,
20362
+ category: meta.category,
20363
+ description: meta.description,
20364
+ overview: docs.overview,
20365
+ auth: docs.auth,
20366
+ envVars: docs.envVars,
20367
+ cliCommands: docs.cliCommands,
20368
+ dataStorage: docs.dataStorage
20369
+ };
20362
20370
  return {
20363
- content: [
20364
- {
20365
- type: "text",
20366
- text: JSON.stringify({
20367
- name: meta.name,
20368
- displayName: meta.displayName,
20369
- version: meta.version,
20370
- category: meta.category,
20371
- description: meta.description,
20372
- overview: docs.overview,
20373
- auth: docs.auth,
20374
- envVars: docs.envVars,
20375
- cliCommands: docs.cliCommands,
20376
- dataStorage: docs.dataStorage
20377
- }, null, 2)
20378
- }
20379
- ]
20371
+ content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
20380
20372
  };
20381
20373
  });
20382
20374
  server.registerTool("install_connector", {
20383
20375
  title: "Install Connector",
20384
- description: "Install connectors into .connectors/ with auto-generated index.ts.",
20376
+ description: "Install connectors into .connectors/.",
20385
20377
  inputSchema: {
20386
- names: exports_external.array(exports_external.string()).describe("Connector names to install"),
20387
- overwrite: exports_external.boolean().optional().describe("Overwrite if already installed")
20378
+ names: exports_external.array(exports_external.string()),
20379
+ overwrite: exports_external.boolean().optional()
20388
20380
  }
20389
20381
  }, async ({ names, overwrite }) => {
20390
20382
  const results = names.map((name) => installConnector(name, { overwrite: overwrite ?? false }));
@@ -20405,10 +20397,8 @@ server.registerTool("install_connector", {
20405
20397
  });
20406
20398
  server.registerTool("remove_connector", {
20407
20399
  title: "Remove Connector",
20408
- description: "Remove an installed connector from the project.",
20409
- inputSchema: {
20410
- name: exports_external.string().describe("Connector name to remove")
20411
- }
20400
+ description: "Remove an installed connector.",
20401
+ inputSchema: { name: exports_external.string() }
20412
20402
  }, async ({ name }) => {
20413
20403
  const removed = removeConnector(name);
20414
20404
  return {
@@ -20437,10 +20427,8 @@ server.registerTool("list_installed", {
20437
20427
  });
20438
20428
  server.registerTool("connector_info", {
20439
20429
  title: "Connector Info",
20440
- description: "Get connector metadata: version, category, tags, installed status.",
20441
- inputSchema: {
20442
- name: exports_external.string().describe("Connector name")
20443
- }
20430
+ description: "Get connector metadata and installed status.",
20431
+ inputSchema: { name: exports_external.string() }
20444
20432
  }, async ({ name }) => {
20445
20433
  const meta = getConnector(name);
20446
20434
  if (!meta) {
@@ -20462,10 +20450,8 @@ server.registerTool("connector_info", {
20462
20450
  });
20463
20451
  server.registerTool("connector_auth_status", {
20464
20452
  title: "Connector Auth Status",
20465
- description: "Check auth status: type (oauth/apikey/bearer), configured, token expiry, env vars.",
20466
- inputSchema: {
20467
- name: exports_external.string().describe("Connector name")
20468
- }
20453
+ description: "Check auth status, token expiry, and env vars.",
20454
+ inputSchema: { name: exports_external.string() }
20469
20455
  }, async ({ name }) => {
20470
20456
  const meta = getConnector(name);
20471
20457
  if (!meta) {
@@ -20490,11 +20476,11 @@ server.registerTool("connector_auth_status", {
20490
20476
  });
20491
20477
  server.registerTool("configure_auth", {
20492
20478
  title: "Configure Auth",
20493
- description: "Save an API key or bearer token for a connector.",
20479
+ description: "Save an API key or token for a connector.",
20494
20480
  inputSchema: {
20495
- name: exports_external.string().describe("Connector name"),
20496
- key: exports_external.string().describe("API key or bearer token"),
20497
- field: exports_external.string().optional().describe("Field name (default: 'apiKey')")
20481
+ name: exports_external.string(),
20482
+ key: exports_external.string(),
20483
+ field: exports_external.string().optional()
20498
20484
  }
20499
20485
  }, async ({ name, key, field }) => {
20500
20486
  try {
@@ -20537,6 +20523,49 @@ server.registerTool("list_categories", {
20537
20523
  ]
20538
20524
  };
20539
20525
  });
20526
+ server.registerTool("search_tools", {
20527
+ title: "Search Tools",
20528
+ description: "List tool names, optionally filtered by keyword.",
20529
+ inputSchema: { query: exports_external.string().optional() }
20530
+ }, async ({ query }) => {
20531
+ const all = [
20532
+ "search_connectors",
20533
+ "list_connectors",
20534
+ "connector_docs",
20535
+ "install_connector",
20536
+ "remove_connector",
20537
+ "list_installed",
20538
+ "connector_info",
20539
+ "connector_auth_status",
20540
+ "configure_auth",
20541
+ "list_categories",
20542
+ "search_tools",
20543
+ "describe_tools"
20544
+ ];
20545
+ const matches = query ? all.filter((n) => n.includes(query.toLowerCase())) : all;
20546
+ return { content: [{ type: "text", text: matches.join(", ") }] };
20547
+ });
20548
+ server.registerTool("describe_tools", {
20549
+ title: "Describe Tools",
20550
+ description: "Get full descriptions for specific tools.",
20551
+ inputSchema: { names: exports_external.array(exports_external.string()) }
20552
+ }, async ({ names }) => {
20553
+ const descriptions = {
20554
+ search_connectors: "Search connectors by name/keyword. Params: query",
20555
+ list_connectors: "List connectors by category. Params: category, compact",
20556
+ connector_docs: "Get auth, env vars, CLI docs. Params: name, essential?",
20557
+ install_connector: "Install connector. Params: names, overwrite?",
20558
+ remove_connector: "Remove installed connector. Params: name",
20559
+ list_installed: "List installed connectors.",
20560
+ connector_info: "Get metadata and install status. Params: name",
20561
+ connector_auth_status: "Check auth status and env vars. Params: name",
20562
+ configure_auth: "Save API key or token. Params: name, key, field?",
20563
+ list_categories: "List connector categories with counts."
20564
+ };
20565
+ const result = names.map((n) => `${n}: ${descriptions[n] || "See tool schema"}`).join(`
20566
+ `);
20567
+ return { content: [{ type: "text", text: result }] };
20568
+ });
20540
20569
  async function main() {
20541
20570
  const transport = new StdioServerTransport;
20542
20571
  await server.connect(transport);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/connectors",
3
- "version": "0.2.8",
3
+ "version": "0.3.0",
4
4
  "description": "Open source connector library - Install API connectors with a single command",
5
5
  "type": "module",
6
6
  "bin": {