@aipermission/mcp 0.2.56 → 0.2.57

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/init.js CHANGED
@@ -50,12 +50,18 @@ async function runConfiguration(command, argv) {
50
50
  const flags = parseCommandFlags(command, argv);
51
51
  const interactive = Boolean(input.isTTY && output.isTTY);
52
52
  assertProviderSelectionAvailable(flags.provider, interactive);
53
- const rl = readline.createInterface({ input, output });
53
+ let rl;
54
+ const getReadline = () => {
55
+ rl ||= readline.createInterface({ input, output });
56
+ return rl;
57
+ };
54
58
  try {
55
59
  const provider = flags.provider
56
60
  ? findProvider(flags.provider)
57
61
  : await selectProvider("Which AI client should use this token?", MCP_PROVIDERS);
58
- const name = sanitizeName(flags.name || (interactive ? await ask(rl, "MCP server name", "aipermission") : "aipermission"));
62
+ const needsToken = provider.id !== "custom" && !flags.print;
63
+ const stdinToken = needsToken && flags.tokenStdin ? (await readStdin()).trim() : "";
64
+ const name = sanitizeName(flags.name || (interactive ? await ask(getReadline(), "MCP server name", "aipermission") : "aipermission"));
59
65
  const apiUrl = normalizeURL(flags.apiUrl || DEFAULT_API_URL);
60
66
  const outputTarget =
61
67
  provider.id === "custom"
@@ -75,8 +81,7 @@ async function runConfiguration(command, argv) {
75
81
  return { provider: provider.id, name, printed: true, skill: skillResult };
76
82
  }
77
83
 
78
- const stdinToken = flags.tokenStdin ? (await readStdin()).trim() : "";
79
- const token = await resolveToken({ ...flags, stdinToken }, rl);
84
+ const token = flags.tokenStdin ? stdinToken : await resolveToken(flags, getReadline());
80
85
  if (!token) {
81
86
  throw new Error("API token is required.");
82
87
  }
@@ -103,7 +108,7 @@ async function runConfiguration(command, argv) {
103
108
  console.log(`${color.yellow}Restart the AI client so it reloads MCP servers.${color.reset}`);
104
109
  return { provider: provider.id, name, config: result, skill: skillResult };
105
110
  } finally {
106
- rl.close();
111
+ rl?.close();
107
112
  }
108
113
  }
109
114
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aipermission/mcp",
3
- "version": "0.2.56",
3
+ "version": "0.2.57",
4
4
  "mcpName": "io.github.aipermission/aipermission-mcp",
5
5
  "description": "Local-only MCP bridge for the aipermission gateway.",
6
6
  "license": "AGPL-3.0-only",
package/server.json CHANGED
@@ -3,12 +3,12 @@
3
3
  "name": "io.github.aipermission/aipermission-mcp",
4
4
  "title": "AIPermission",
5
5
  "description": "Local-only MCP bridge for the AIPermission gateway.",
6
- "version": "0.2.56",
6
+ "version": "0.2.57",
7
7
  "packages": [
8
8
  {
9
9
  "registryType": "npm",
10
10
  "identifier": "@aipermission/mcp",
11
- "version": "0.2.56",
11
+ "version": "0.2.57",
12
12
  "transport": {
13
13
  "type": "stdio"
14
14
  }