@hasna/connectors 0.2.8 → 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.
- package/bin/index.js +3 -3
- package/bin/mcp.js +80 -39
- 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.
|
|
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.
|
|
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.
|
|
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,7 +20275,7 @@ function guessKeyField(name) {
|
|
|
20275
20275
|
loadConnectorVersions();
|
|
20276
20276
|
var server = new McpServer({
|
|
20277
20277
|
name: "connectors",
|
|
20278
|
-
version: "0.2.
|
|
20278
|
+
version: "0.2.9"
|
|
20279
20279
|
});
|
|
20280
20280
|
server.registerTool("search_connectors", {
|
|
20281
20281
|
title: "Search Connectors",
|
|
@@ -20302,11 +20302,12 @@ server.registerTool("search_connectors", {
|
|
|
20302
20302
|
});
|
|
20303
20303
|
server.registerTool("list_connectors", {
|
|
20304
20304
|
title: "List Connectors",
|
|
20305
|
-
description: "List connectors, optionally filtered by category.",
|
|
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 (e.g. 'AI & ML', 'Developer Tools')")
|
|
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
|
|
20340
|
+
description: "Get connector docs. Use essential=true for auth+envVars only (faster).",
|
|
20344
20341
|
inputSchema: {
|
|
20345
|
-
name: exports_external.string().describe("Connector name")
|
|
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,29 +20357,25 @@ 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 connectors into .connectors/
|
|
20378
|
+
description: "Install connectors into .connectors/ directory.",
|
|
20385
20379
|
inputSchema: {
|
|
20386
20380
|
names: exports_external.array(exports_external.string()).describe("Connector names to install"),
|
|
20387
20381
|
overwrite: exports_external.boolean().optional().describe("Overwrite if already installed")
|
|
@@ -20437,7 +20431,7 @@ server.registerTool("list_installed", {
|
|
|
20437
20431
|
});
|
|
20438
20432
|
server.registerTool("connector_info", {
|
|
20439
20433
|
title: "Connector Info",
|
|
20440
|
-
description: "Get connector metadata
|
|
20434
|
+
description: "Get connector metadata and installed status.",
|
|
20441
20435
|
inputSchema: {
|
|
20442
20436
|
name: exports_external.string().describe("Connector name")
|
|
20443
20437
|
}
|
|
@@ -20462,7 +20456,7 @@ server.registerTool("connector_info", {
|
|
|
20462
20456
|
});
|
|
20463
20457
|
server.registerTool("connector_auth_status", {
|
|
20464
20458
|
title: "Connector Auth Status",
|
|
20465
|
-
description: "Check auth status
|
|
20459
|
+
description: "Check connector auth status, token expiry, and env vars.",
|
|
20466
20460
|
inputSchema: {
|
|
20467
20461
|
name: exports_external.string().describe("Connector name")
|
|
20468
20462
|
}
|
|
@@ -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);
|