Skip to content

Commit 67263f6

Browse files
committed
chore: revoke access tokens on server shutdown [MCP-53]
1 parent 27c52b4 commit 67263f6

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/common/atlas/apiClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ export class ApiClient {
9595
await this.getAccessToken();
9696
}
9797

98+
public async close(): Promise<void> {
99+
if (this.accessToken) {
100+
await this.accessToken.revokeAll();
101+
}
102+
}
103+
98104
public async getIpInfo(): Promise<{
99105
currentIpv4Address: string;
100106
}> {

src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ export class Server {
101101
}
102102

103103
async close(): Promise<void> {
104+
await this.mcpServer.close();
104105
await this.telemetry.close();
105106
await this.session.close();
106-
await this.mcpServer.close();
107107
}
108108

109109
/**

src/session.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export class Session extends EventEmitter<{
9393

9494
async close(): Promise<void> {
9595
await this.disconnect();
96+
await this.apiClient.close();
9697
this.emit("close");
9798
}
9899

0 commit comments

Comments
 (0)