@fitchmultz/pi-mcp-adapter 8.0.4 → 8.0.6

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/CHANGELOG.md CHANGED
@@ -7,6 +7,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## 8.0.6 - 2026-11-02
11
+
12
+ <!-- npm-release:unreleased:start -->
13
+ <!-- npm-release:unreleased:end -->
14
+
15
+ - Raise the Pi floor to 1.5.0 (#122) ([fc9bed1](https://github.com/fitchmultz/pi-mcp-adapter/commit/fc9bed1ac87fcfaabeca626115dbe107c0e63ac9))
16
+
17
+ ### What's Changed
18
+ * Raise the Pi floor to 1.5.0 by @fitchmultz in https://github.com/fitchmultz/pi-mcp-adapter/pull/122
19
+
20
+
21
+ **Full Changelog**: https://github.com/fitchmultz/pi-mcp-adapter/compare/v8.0.5...v8.0.6
22
+
23
+ ## 8.0.5 - 2026-11-02
24
+
25
+ <!-- npm-release:unreleased:start -->
26
+ <!-- npm-release:unreleased:end -->
27
+
28
+ - Reconnect all MCP servers concurrently (#120) ([50b4a32](https://github.com/fitchmultz/pi-mcp-adapter/commit/50b4a326471d724f42e2318e97c685c76f418f20))
29
+
30
+ ### What's Changed
31
+ * Reconnect all MCP servers concurrently by @fitchmultz in https://github.com/fitchmultz/pi-mcp-adapter/pull/120
32
+
33
+
34
+ **Full Changelog**: https://github.com/fitchmultz/pi-mcp-adapter/compare/v8.0.4...v8.0.5
35
+
10
36
  ## 8.0.4 - 2026-11-01
11
37
 
12
38
  <!-- npm-release:unreleased:start -->
package/dist/commands.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { isServerDisabled, isNonInteractiveOAuth } from "./types.js";
2
2
  import { ensureCompatibilityImports, getMcpDiscoverySummary, getProjectConfigPath, getServerProvenance, previewCompatibilityImports, previewSharedServerEntry, previewStarterProjectConfig, writeDirectToolsConfig, writeSharedServerEntry, writeStarterProjectConfig, } from "./config.js";
3
- import { markKeepAliveAfterConnect, notifyToolMetadataUpdated, updateMetadataCache, updateStatusBar, getFailureAgeSeconds, getFailureMessage, clearFailure, recordFailure } from "./init.js";
3
+ import { MAX_CONCURRENT_SERVER_CONNECTS, markKeepAliveAfterConnect, notifyToolMetadataUpdated, updateMetadataCache, updateStatusBar, getFailureAgeSeconds, getFailureMessage, clearFailure, recordFailure } from "./init.js";
4
4
  import { loadMetadataCache, reconstructPromptMetadata } from "./metadata-cache.js";
5
5
  import { buildToolMetadata } from "./tool-metadata.js";
6
6
  import { supportsOAuth } from "./mcp-oauth-runtime.js";
7
7
  import { getAuthStorageOptions, inspectAuthForUrl } from "./mcp-auth.js";
8
8
  import { loadOnboardingState, markSetupCompleted as persistSetupCompleted, markSharedConfigHintShown } from "./onboarding-state.js";
9
- import { openPath, resolveServerUrl, sanitizeTerminalText } from "./utils.js";
9
+ import { openPath, parallelLimit, resolveServerUrl, sanitizeTerminalText } from "./utils.js";
10
10
  import { isAbortError } from "./runtime-owner.js";
11
11
  import { createMcpPanel } from "./mcp-panel.js";
12
12
  import { createMcpSetupPanel } from "./mcp-setup-panel.js";
@@ -192,9 +192,7 @@ export async function reconnectServers(state, ctx, targetServer) {
192
192
  return;
193
193
  }
194
194
  const names = targetServer ? [targetServer] : Object.keys(state.config.mcpServers);
195
- for (const name of names) {
196
- await reconnectServer(state, ctx, name);
197
- }
195
+ await parallelLimit(names, MAX_CONCURRENT_SERVER_CONNECTS, name => reconnectServer(state, ctx, name));
198
196
  updateStatusBar(state);
199
197
  }
200
198
  export async function authenticateServer(serverName, config, ctx, signal, runtime) {
package/dist/init.d.ts CHANGED
@@ -3,6 +3,8 @@ import type { McpExtensionState } from "./state.ts";
3
3
  import { type McpAdapterOptions, type McpConfig } from "./types.ts";
4
4
  import { type McpOAuthRuntime } from "./mcp-oauth-runtime.ts";
5
5
  import { type McpRuntimeOwner } from "./runtime-owner.ts";
6
+ /** Most servers one multi-server pass connects at once. */
7
+ export declare const MAX_CONCURRENT_SERVER_CONNECTS = 10;
6
8
  export declare function clearFailure(state: McpExtensionState, serverName: string): void;
7
9
  export declare function recordFailure(state: McpExtensionState, serverName: string, message: string): void;
8
10
  type McpInitializationOptions = McpAdapterOptions & {
package/dist/init.js CHANGED
@@ -15,6 +15,8 @@ import { combineAbortSignals, createMcpRuntimeOwner, createOwnedUi, isAbortError
15
15
  import { publishMcpStatusSnapshot } from "./mcp-status.js";
16
16
  const FAILURE_BACKOFF_MS = 60 * 1000;
17
17
  const MAX_FAILURE_MESSAGE_CHARS = 8 * 1024;
18
+ /** Most servers one multi-server pass connects at once. */
19
+ export const MAX_CONCURRENT_SERVER_CONNECTS = 10;
18
20
  const failureExpiryTimers = new WeakMap();
19
21
  function getFailureExpiryTimers(state) {
20
22
  let timers = failureExpiryTimers.get(state);
@@ -208,7 +210,7 @@ export async function initializeMcp(pi, ctx, owner = createMcpRuntimeOwner(), op
208
210
  const status = formatMcpStatus(state.config, `connecting to ${startupServers.length} servers...`);
209
211
  ui.setStatus("mcp", status);
210
212
  }
211
- const results = await parallelLimit(startupServers, 10, async ([name, definition]) => {
213
+ const results = await parallelLimit(startupServers, MAX_CONCURRENT_SERVER_CONNECTS, async ([name, definition]) => {
212
214
  try {
213
215
  const connection = await manager.connect(name, definition, runtimeSignal);
214
216
  if (connection.status === "needs-auth") {
@@ -286,7 +288,7 @@ export async function initializeMcp(pi, ctx, owner = createMcpRuntimeOwner(), op
286
288
  const envDirectToolOverride = envDirect?.split(",").map(selector => selector.trim()).filter(Boolean);
287
289
  const missingCacheServers = getMissingConfiguredDirectToolServers(config, currentCache, envDirectToolOverride);
288
290
  if (missingCacheServers.length > 0) {
289
- const bootstrapResults = await parallelLimit(missingCacheServers.filter(name => !results.some(r => r.name === name && r.connection)), 10, async (name) => {
291
+ const bootstrapResults = await parallelLimit(missingCacheServers.filter(name => !results.some(r => r.name === name && r.connection)), MAX_CONCURRENT_SERVER_CONNECTS, async (name) => {
290
292
  try {
291
293
  const definition = config.mcpServers[name];
292
294
  if (!definition)
@@ -1,4 +1,4 @@
1
- import type { AgentToolResult, Theme, ToolRenderResultOptions } from "@earendil-works/pi-coding-agent";
1
+ import type { AgentToolResult, KeybindingHints, Theme, ToolRenderResultOptions } from "@earendil-works/pi-coding-agent";
2
2
  import { type Component, Text } from "@earendil-works/pi-tui";
3
3
  type McpToolResultDetails = Record<string, unknown> & {
4
4
  error?: unknown;
@@ -17,7 +17,7 @@ export interface McpProxyToolCallInput {
17
17
  server?: string;
18
18
  action?: string;
19
19
  }
20
- interface McpToolRenderContext {
20
+ interface McpToolRenderContext extends Pick<KeybindingHints, "keyHint"> {
21
21
  isError: boolean;
22
22
  }
23
23
  export interface McpToolResultDisplay {
@@ -34,7 +34,7 @@ declare class CollapsibleText implements Component {
34
34
  private readonly ellipsis;
35
35
  private readonly expandHint;
36
36
  private readonly preTruncated;
37
- constructor(text: string, expanded: boolean, maxCollapsedLines: number, ellipsis: string, expandHint: string, preTruncated?: boolean);
37
+ constructor(text: string, expanded: boolean, maxCollapsedLines: number, ellipsis: string, expandHint: string | undefined, preTruncated?: boolean);
38
38
  render(width: number): string[];
39
39
  invalidate(): void;
40
40
  }
@@ -1,4 +1,4 @@
1
- import { getKeybindings, Text } from "@earendil-works/pi-tui";
1
+ import { Text } from "@earendil-works/pi-tui";
2
2
  const plainTheme = {
3
3
  fg: (_name, text) => text,
4
4
  bold: (text) => text,
@@ -25,7 +25,7 @@ class CollapsibleText {
25
25
  this.expandHint = expandHint;
26
26
  this.preTruncated = preTruncated;
27
27
  this.fullText = new Text(text, 0, 0);
28
- this.footerText = new Text(`${ellipsis}\n${expandHint}`, 0, 0);
28
+ this.footerText = new Text(expandHint === undefined ? ellipsis : `${ellipsis}\n${expandHint}`, 0, 0);
29
29
  }
30
30
  render(width) {
31
31
  if (this.expanded) {
@@ -53,14 +53,6 @@ class CollapsibleText {
53
53
  }
54
54
  invalidate() { }
55
55
  }
56
- // Read the shared TUI keybinding registry without importing the entire host SDK.
57
- function expandHint(theme) {
58
- const keys = getKeybindings().getKeys("app.tools.expand").join("/")
59
- .split("/").map(key => key.split("+")
60
- .map(part => process.platform === "darwin" && part.toLowerCase() === "alt" ? "option" : part)
61
- .join("+")).join("/");
62
- return theme.fg("dim", keys) + theme.fg("muted", " to expand");
63
- }
64
56
  function truncateText(value, maxChars) {
65
57
  if (value.length <= maxChars)
66
58
  return value;
@@ -232,5 +224,9 @@ export function renderMcpToolResult(result, options, theme, context) {
232
224
  ...(identity ? [activeTheme.fg("muted", identity)] : []),
233
225
  ...display.lines.map((line) => activeTheme.fg("toolOutput", line)),
234
226
  ].join("\n");
235
- return new CollapsibleText(output, expanded, DEFAULT_MAX_COLLAPSED_LINES + (identity ? 1 : 0), activeTheme.fg("muted", "…"), activeTheme.fg("muted", `(${expandHint(activeTheme)})`), display.truncated);
227
+ // Pi injects keyHint so the hint shows the user's configured keys.
228
+ const expandHint = context
229
+ ? `${activeTheme.fg("muted", "(")}${context.keyHint("app.tools.expand", "to expand")}${activeTheme.fg("muted", ")")}`
230
+ : undefined;
231
+ return new CollapsibleText(output, expanded, DEFAULT_MAX_COLLAPSED_LINES + (identity ? 1 : 0), activeTheme.fg("muted", "…"), expandHint, display.truncated);
236
232
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fitchmultz/pi-mcp-adapter",
3
- "version": "8.0.4",
3
+ "version": "8.0.6",
4
4
  "description": "Token-efficient MCP adapter for the Pi coding agent",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -105,9 +105,9 @@
105
105
  }
106
106
  },
107
107
  "devDependencies": {
108
- "@earendil-works/pi-ai": "1.4.0",
109
- "@earendil-works/pi-coding-agent": "1.4.0",
110
- "@earendil-works/pi-tui": "1.4.0",
108
+ "@earendil-works/pi-ai": "1.5.0",
109
+ "@earendil-works/pi-coding-agent": "1.5.0",
110
+ "@earendil-works/pi-tui": "1.5.0",
111
111
  "@modelcontextprotocol/server": "2.3.1",
112
112
  "@types/cross-spawn": "6.0.6",
113
113
  "@types/node": "24.19.1",