@pi-archimedes/mcp 2.6.2 → 2.7.0
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/package.json +6 -2
- package/src/auth-flow.ts +12 -1
package/package.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-archimedes/mcp",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/danielcherubini/pi-archimedes.git"
|
|
7
|
+
},
|
|
4
8
|
"type": "module",
|
|
5
9
|
"keywords": [
|
|
6
10
|
"pi-package"
|
|
@@ -17,7 +21,7 @@
|
|
|
17
21
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
18
22
|
"@napi-rs/keyring": "^1.3.0",
|
|
19
23
|
"open": "^10.2.0",
|
|
20
|
-
"@pi-archimedes/core": "2.
|
|
24
|
+
"@pi-archimedes/core": "2.7.0"
|
|
21
25
|
},
|
|
22
26
|
"peerDependencies": {
|
|
23
27
|
"@earendil-works/pi-coding-agent": ">=0.1.0",
|
package/src/auth-flow.ts
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
import { auth } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
35
35
|
|
|
36
|
-
import { getAuthEntry } from "./auth-storage.js";
|
|
36
|
+
import { getAuthEntry, saveAuthEntry } from "./auth-storage.js";
|
|
37
37
|
import { ensureCallbackServer, reserveAuthState, waitForCallback } from "./callback-server.js";
|
|
38
38
|
import { McpOAuthProvider, type OAuthCallbacks } from "./oauth-provider.js";
|
|
39
39
|
import { OAUTH_CONFIG_FIELDS, type McpOAuthConfig } from "./types.js";
|
|
@@ -267,6 +267,17 @@ export async function authenticate(
|
|
|
267
267
|
return { status: "needs-interaction" };
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
+
// If there is stored clientInfo but no tokens, the previous DCR
|
|
271
|
+
// registration was never completed (or tokens were cleared). Wipe the
|
|
272
|
+
// clientInfo so the SDK runs a fresh DCR with the current boundPort —
|
|
273
|
+
// otherwise it reuses the old redirectUri (a different port) and
|
|
274
|
+
// Atlassian/other servers redirect back to a listener that isn't running.
|
|
275
|
+
const existing = getAuthEntry(serverName);
|
|
276
|
+
if (existing?.clientInfo && !existing.tokens) {
|
|
277
|
+
const { clientInfo: _drop, ...withoutClient } = existing;
|
|
278
|
+
saveAuthEntry(serverName, withoutClient, serverUrl);
|
|
279
|
+
}
|
|
280
|
+
|
|
270
281
|
const provider = new McpOAuthProvider(
|
|
271
282
|
serverName,
|
|
272
283
|
serverUrl,
|