pi-mcp-adapter 2.6.0 → 2.6.1

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,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.6.1] - 2026-05-13
11
+
12
+ ### Added
13
+ - Added `/mcp logout <server>` to clear stored OAuth credentials and disconnect the server. Thanks @mattzcarey for PR #96.
14
+
15
+ ### Fixed
16
+ - Cancel pending OAuth callbacks when logging out of an MCP server.
17
+
10
18
  ## [2.6.0] - 2026-05-10
11
19
 
12
20
  ### Added
package/README.md CHANGED
@@ -347,6 +347,7 @@ Tool names are fuzzy-matched on hyphens and underscores — `context7_resolve_li
347
347
  | `/mcp tools` | List all tools |
348
348
  | `/mcp reconnect` | Reconnect all servers |
349
349
  | `/mcp reconnect <server>` | Connect or reconnect a single server |
350
+ | `/mcp logout <server>` | Clear stored OAuth credentials for a server and disconnect it |
350
351
  | `/mcp-auth` | Open an OAuth server picker in interactive UI sessions |
351
352
  | `/mcp-auth <server>` | OAuth setup for a specific server |
352
353
 
package/commands.ts CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  import { lazyConnect, updateMetadataCache, updateStatusBar, getFailureAgeSeconds } from "./init.ts";
16
16
  import { loadMetadataCache } from "./metadata-cache.ts";
17
17
  import { buildToolMetadata } from "./tool-metadata.ts";
18
- import { supportsOAuth, authenticate } from "./mcp-auth-flow.ts";
18
+ import { supportsOAuth, authenticate, removeAuth } from "./mcp-auth-flow.ts";
19
19
  import { getAuthForUrl } from "./mcp-auth.ts";
20
20
  import { loadOnboardingState, markSetupCompleted as persistSetupCompleted, markSharedConfigHintShown } from "./onboarding-state.ts";
21
21
  import { openPath } from "./utils.ts";
@@ -192,6 +192,27 @@ export async function authenticateServer(
192
192
  }
193
193
  }
194
194
 
195
+ export async function logoutServer(
196
+ serverName: string,
197
+ state: McpExtensionState,
198
+ ctx: ExtensionContext
199
+ ): Promise<{ ok: boolean; message: string }> {
200
+ const definition = state.config.mcpServers[serverName];
201
+ if (!definition) {
202
+ const message = `Server "${serverName}" not found in config`;
203
+ if (ctx.hasUI) ctx.ui.notify(message, "error");
204
+ return { ok: false, message };
205
+ }
206
+
207
+ await removeAuth(serverName);
208
+ await state.manager.close(serverName);
209
+ updateStatusBar(state);
210
+
211
+ const message = `OAuth credentials cleared for "${serverName}". Run /mcp-auth ${serverName} to authenticate again.`;
212
+ if (ctx.hasUI) ctx.ui.notify(message, "info");
213
+ return { ok: true, message };
214
+ }
215
+
195
216
  export interface PanelFlowResult {
196
217
  configChanged: boolean;
197
218
  }
package/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { ExtensionAPI, ToolInfo } from "@earendil-works/pi-coding-agent";
2
2
  import type { McpExtensionState } from "./state.ts";
3
3
  import { Type } from "typebox";
4
- import { showStatus, showTools, reconnectServers, authenticateServer, openMcpAuthPanel, openMcpPanel, openMcpSetup } from "./commands.ts";
4
+ import { showStatus, showTools, reconnectServers, authenticateServer, logoutServer, openMcpAuthPanel, openMcpPanel, openMcpSetup } from "./commands.ts";
5
5
  import { loadMcpConfig } from "./config.ts";
6
6
  import { buildProxyDescription, createDirectToolExecutor, getMissingConfiguredDirectToolServers, resolveDirectTools } from "./direct-tools.ts";
7
7
  import { flushMetadataCache, initializeMcp, updateStatusBar } from "./init.ts";
@@ -172,6 +172,7 @@ export default function mcpAdapter(pi: ExtensionAPI) {
172
172
  const parts = args?.trim()?.split(/\s+/) ?? [];
173
173
  const subcommand = parts[0] ?? "";
174
174
  const targetServer = parts[1];
175
+ const rest = parts.slice(1).join(" ");
175
176
 
176
177
  switch (subcommand) {
177
178
  case "reconnect":
@@ -188,6 +189,15 @@ export default function mcpAdapter(pi: ExtensionAPI) {
188
189
  }
189
190
  break;
190
191
  }
192
+ case "logout": {
193
+ const serverName = rest;
194
+ if (!serverName) {
195
+ if (ctx.hasUI) ctx.ui.notify("Usage: /mcp logout <server>", "error");
196
+ return;
197
+ }
198
+ await logoutServer(serverName, state, ctx);
199
+ break;
200
+ }
191
201
  case "status":
192
202
  case "":
193
203
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-mcp-adapter",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "MCP (Model Context Protocol) adapter extension for Pi coding agent",
5
5
  "type": "module",
6
6
  "license": "MIT",