@hasna/connectors 0.2.7 → 0.2.9

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 +91 -50
  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.7");
6586
+ program2.name("connectors").description("Install API connectors for your project").version("0.2.9");
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.7";
7749
+ const currentVersion = "0.2.9";
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.7";
7965
+ const version = "0.2.9";
7966
7966
  let configured = 0;
7967
7967
  let unconfigured = 0;
7968
7968
  const connectorDetails = [];
package/bin/mcp.js CHANGED
@@ -20275,13 +20275,13 @@ function guessKeyField(name) {
20275
20275
  loadConnectorVersions();
20276
20276
  var server = new McpServer({
20277
20277
  name: "connectors",
20278
- version: "0.2.7"
20278
+ version: "0.2.9"
20279
20279
  });
20280
20280
  server.registerTool("search_connectors", {
20281
20281
  title: "Search Connectors",
20282
- description: "Search the connector library by name, description, or keyword. " + "Use this to discover available API connectors (e.g. 'payment', 'ai', 'email').",
20282
+ description: "Search connectors by name, keyword, or description.",
20283
20283
  inputSchema: {
20284
- query: exports_external.string().describe("Search query (name, keyword, or description)")
20284
+ query: exports_external.string().describe("Search query")
20285
20285
  }
20286
20286
  }, async ({ query }) => {
20287
20287
  const results = searchConnectors(query);
@@ -20302,11 +20302,12 @@ server.registerTool("search_connectors", {
20302
20302
  });
20303
20303
  server.registerTool("list_connectors", {
20304
20304
  title: "List Connectors",
20305
- description: "List all available connectors, optionally filtered by category. " + "Returns name, version, category, and description for each connector.",
20305
+ description: "List connectors, optionally filtered by category. Use compact=true for names only.",
20306
20306
  inputSchema: {
20307
- category: exports_external.string().optional().describe("Filter by category. Available: " + CATEGORIES.join(", "))
20307
+ category: exports_external.string().optional().describe("Filter by category (e.g. 'AI & ML', 'Developer Tools')"),
20308
+ compact: exports_external.boolean().optional().describe("Return names only (default: false)")
20308
20309
  }
20309
- }, async ({ category }) => {
20310
+ }, async ({ category, compact }) => {
20310
20311
  let connectors = CONNECTORS;
20311
20312
  if (category) {
20312
20313
  const matched = CATEGORIES.find((c) => c.toLowerCase() === category.toLowerCase());
@@ -20323,28 +20324,25 @@ server.registerTool("list_connectors", {
20323
20324
  }
20324
20325
  connectors = getConnectorsByCategory(matched);
20325
20326
  }
20327
+ const data = compact ? connectors.map((c) => c.name) : connectors.map((c) => ({
20328
+ name: c.name,
20329
+ displayName: c.displayName,
20330
+ version: c.version,
20331
+ category: c.category,
20332
+ description: c.description
20333
+ }));
20326
20334
  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
- ]
20335
+ content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
20339
20336
  };
20340
20337
  });
20341
20338
  server.registerTool("connector_docs", {
20342
20339
  title: "Connector Documentation",
20343
- description: "Get detailed documentation for a connector including auth method, " + "required environment variables, CLI commands, and API capabilities. " + "Use this BEFORE installing a connector to understand how to use it.",
20340
+ description: "Get connector docs. Use essential=true for auth+envVars only (faster).",
20344
20341
  inputSchema: {
20345
- name: exports_external.string().describe("Connector name (e.g. 'stripe', 'anthropic', 'gmail')")
20342
+ name: exports_external.string().describe("Connector name"),
20343
+ essential: exports_external.boolean().optional().describe("Return auth+envVars only (default: false)")
20346
20344
  }
20347
- }, async ({ name }) => {
20345
+ }, async ({ name, essential }) => {
20348
20346
  const meta = getConnector(name);
20349
20347
  if (!meta) {
20350
20348
  return {
@@ -20359,32 +20357,28 @@ server.registerTool("connector_docs", {
20359
20357
  isError: true
20360
20358
  };
20361
20359
  }
20360
+ const data = essential ? { name: meta.name, auth: docs.auth, envVars: docs.envVars } : {
20361
+ name: meta.name,
20362
+ displayName: meta.displayName,
20363
+ version: meta.version,
20364
+ category: meta.category,
20365
+ description: meta.description,
20366
+ overview: docs.overview,
20367
+ auth: docs.auth,
20368
+ envVars: docs.envVars,
20369
+ cliCommands: docs.cliCommands,
20370
+ dataStorage: docs.dataStorage
20371
+ };
20362
20372
  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
- ]
20373
+ content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
20380
20374
  };
20381
20375
  });
20382
20376
  server.registerTool("install_connector", {
20383
20377
  title: "Install Connector",
20384
- description: "Install one or more API connectors into the current project. " + "Connectors are copied to .connectors/ with an auto-generated index.ts for imports.",
20378
+ description: "Install connectors into .connectors/ directory.",
20385
20379
  inputSchema: {
20386
- names: exports_external.array(exports_external.string()).describe("Connector names to install (e.g. ['stripe', 'figma'])"),
20387
- overwrite: exports_external.boolean().optional().describe("Overwrite if already installed (default: false)")
20380
+ names: exports_external.array(exports_external.string()).describe("Connector names to install"),
20381
+ overwrite: exports_external.boolean().optional().describe("Overwrite if already installed")
20388
20382
  }
20389
20383
  }, async ({ names, overwrite }) => {
20390
20384
  const results = names.map((name) => installConnector(name, { overwrite: overwrite ?? false }));
@@ -20422,7 +20416,7 @@ server.registerTool("remove_connector", {
20422
20416
  });
20423
20417
  server.registerTool("list_installed", {
20424
20418
  title: "List Installed Connectors",
20425
- description: "List connectors currently installed in the project's .connectors/ directory.",
20419
+ description: "List connectors installed in .connectors/.",
20426
20420
  inputSchema: {}
20427
20421
  }, async () => {
20428
20422
  const installed = getInstalledConnectors();
@@ -20437,7 +20431,7 @@ server.registerTool("list_installed", {
20437
20431
  });
20438
20432
  server.registerTool("connector_info", {
20439
20433
  title: "Connector Info",
20440
- description: "Get metadata about a specific connector including version, category, " + "tags, and whether it's currently installed.",
20434
+ description: "Get connector metadata and installed status.",
20441
20435
  inputSchema: {
20442
20436
  name: exports_external.string().describe("Connector name")
20443
20437
  }
@@ -20462,9 +20456,9 @@ server.registerTool("connector_info", {
20462
20456
  });
20463
20457
  server.registerTool("connector_auth_status", {
20464
20458
  title: "Connector Auth Status",
20465
- description: "Check the authentication status of an installed connector. " + "Returns auth type (oauth/apikey/bearer), whether it's configured, " + "token expiry for OAuth connectors, and environment variable status.",
20459
+ description: "Check connector auth status, token expiry, and env vars.",
20466
20460
  inputSchema: {
20467
- name: exports_external.string().describe("Connector name (e.g. 'gmail', 'stripe', 'anthropic')")
20461
+ name: exports_external.string().describe("Connector name")
20468
20462
  }
20469
20463
  }, async ({ name }) => {
20470
20464
  const meta = getConnector(name);
@@ -20490,11 +20484,11 @@ server.registerTool("connector_auth_status", {
20490
20484
  });
20491
20485
  server.registerTool("configure_auth", {
20492
20486
  title: "Configure Auth",
20493
- description: "Save an API key or bearer token for a connector. " + "Stores credentials in ~/.connectors/connect-{name}/profiles/. " + "Use connector_docs to find required env vars and field names first.",
20487
+ description: "Save an API key or bearer token for a connector.",
20494
20488
  inputSchema: {
20495
- name: exports_external.string().describe("Connector name (e.g. 'stripe', 'anthropic', 'openai')"),
20496
- key: exports_external.string().describe("The API key or bearer token value"),
20497
- field: exports_external.string().optional().describe("Key field name (defaults to the connector's primary key field, usually 'apiKey')")
20489
+ name: exports_external.string().describe("Connector name"),
20490
+ key: exports_external.string().describe("API key or bearer token"),
20491
+ field: exports_external.string().optional().describe("Field name (default: 'apiKey')")
20498
20492
  }
20499
20493
  }, async ({ name, key, field }) => {
20500
20494
  try {
@@ -20521,7 +20515,7 @@ server.registerTool("configure_auth", {
20521
20515
  });
20522
20516
  server.registerTool("list_categories", {
20523
20517
  title: "List Categories",
20524
- description: "List all connector categories with the number of connectors in each.",
20518
+ description: "List connector categories with counts.",
20525
20519
  inputSchema: {}
20526
20520
  }, async () => {
20527
20521
  const categoryCounts = CATEGORIES.map((category) => ({
@@ -20537,6 +20531,53 @@ server.registerTool("list_categories", {
20537
20531
  ]
20538
20532
  };
20539
20533
  });
20534
+ server.registerTool("search_tools", {
20535
+ title: "Search Tools",
20536
+ description: "List tool names, optionally filtered by keyword.",
20537
+ inputSchema: {
20538
+ query: exports_external.string().optional().describe("Keyword filter")
20539
+ }
20540
+ }, async ({ query }) => {
20541
+ const all = [
20542
+ "search_connectors",
20543
+ "list_connectors",
20544
+ "connector_docs",
20545
+ "install_connector",
20546
+ "remove_connector",
20547
+ "list_installed",
20548
+ "connector_info",
20549
+ "connector_auth_status",
20550
+ "configure_auth",
20551
+ "list_categories",
20552
+ "search_tools",
20553
+ "describe_tools"
20554
+ ];
20555
+ const matches = query ? all.filter((n) => n.includes(query.toLowerCase())) : all;
20556
+ return { content: [{ type: "text", text: matches.join(", ") }] };
20557
+ });
20558
+ server.registerTool("describe_tools", {
20559
+ title: "Describe Tools",
20560
+ description: "Get descriptions for specific tools by name.",
20561
+ inputSchema: {
20562
+ names: exports_external.array(exports_external.string()).describe("Tool names")
20563
+ }
20564
+ }, async ({ names }) => {
20565
+ const descriptions = {
20566
+ search_connectors: "Search connectors by name/keyword. Params: query",
20567
+ list_connectors: "List connectors by category. Params: category, compact",
20568
+ connector_docs: "Get auth, env vars, CLI docs. Params: name, essential?",
20569
+ install_connector: "Install connector. Params: names, overwrite?",
20570
+ remove_connector: "Remove installed connector. Params: name",
20571
+ list_installed: "List installed connectors.",
20572
+ connector_info: "Get metadata and install status. Params: name",
20573
+ connector_auth_status: "Check auth status and env vars. Params: name",
20574
+ configure_auth: "Save API key or token. Params: name, key, field?",
20575
+ list_categories: "List connector categories with counts."
20576
+ };
20577
+ const result = names.map((n) => `${n}: ${descriptions[n] || "See tool schema"}`).join(`
20578
+ `);
20579
+ return { content: [{ type: "text", text: result }] };
20580
+ });
20540
20581
  async function main() {
20541
20582
  const transport = new StdioServerTransport;
20542
20583
  await server.connect(transport);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/connectors",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "Open source connector library - Install API connectors with a single command",
5
5
  "type": "module",
6
6
  "bin": {