@rb2b/rb2b-apis-mcp 1.1.0 → 1.1.2

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/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ if (process.argv[2] === "init") {
3
+ await import("./init.js");
4
+ }
5
+ else {
6
+ await import("./server.js");
7
+ }
8
+ export {};
package/dist/init.js CHANGED
@@ -16,15 +16,23 @@ async function main() {
16
16
  console.log("RB2B MCP Server — Initial Setup");
17
17
  console.log("=================================\n");
18
18
  }
19
- const apiKey = await prompt("Enter your RB2B API key: ");
20
- if (!apiKey.trim()) {
19
+ const input = await prompt(existing
20
+ ? "Enter a new RB2B API key (or press Enter to keep the existing one): "
21
+ : "Enter your RB2B API key: ");
22
+ if (!input.trim()) {
23
+ if (existing) {
24
+ console.log("\nKeeping existing API key. No changes made.");
25
+ rl.close();
26
+ process.exit(0);
27
+ }
21
28
  console.error("Error: API key cannot be empty.");
22
29
  process.exit(1);
23
30
  }
31
+ const apiKey = input.trim();
24
32
  console.log("\nValidating API key...");
25
33
  try {
26
34
  const res = await fetch(`${BASE_URL}/credits`, {
27
- headers: { "Api-Key": apiKey.trim() },
35
+ headers: { "Api-Key": apiKey },
28
36
  });
29
37
  if (!res.ok) {
30
38
  const text = await res.text().catch(() => res.statusText);
@@ -34,7 +42,7 @@ async function main() {
34
42
  const data = await res.json();
35
43
  console.log("\nAPI key valid!");
36
44
  console.log("Credits info:", JSON.stringify(data, null, 2));
37
- saveConfig({ apiKey: apiKey.trim() });
45
+ saveConfig({ apiKey });
38
46
  console.log("\nConfiguration saved to ~/.rb2b/config.json");
39
47
  console.log("\nYou can now add the MCP server to your Claude config:\n");
40
48
  console.log(JSON.stringify({
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@rb2b/rb2b-apis-mcp",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "MCP server exposing RB2B API tools for identity resolution and enrichment",
5
5
  "type": "module",
6
6
  "main": "dist/server.js",
7
7
  "bin": {
8
- "rb2b-mcp": "dist/server.js",
9
- "rb2b-mcp-init": "dist/init.js"
8
+ "rb2b-apis-mcp": "dist/cli.js"
10
9
  },
11
10
  "scripts": {
12
11
  "build": "tsc",