mcp-google-multi 5.4.0-alpha.1 → 5.4.0-beta.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/dist/auth.js +10 -7
- package/package.json +1 -3
package/dist/auth.js
CHANGED
|
@@ -3,7 +3,6 @@ import http from 'node:http';
|
|
|
3
3
|
import { URL } from 'node:url';
|
|
4
4
|
import { randomBytes } from 'node:crypto';
|
|
5
5
|
import open from 'open';
|
|
6
|
-
import destroyer from 'server-destroy';
|
|
7
6
|
import { ACCOUNTS, ACCOUNT_CONFIG } from './accounts.js';
|
|
8
7
|
import { writeToken } from './token-store.js';
|
|
9
8
|
// Personal (non-Workspace) accounts 403 on admin scopes; ADMIN_SCOPES stays per-account opt-in, never granted by default.
|
|
@@ -155,7 +154,8 @@ export async function runAuthFlow(args) {
|
|
|
155
154
|
if (error) {
|
|
156
155
|
res.writeHead(400, { 'Content-Type': 'text/plain' });
|
|
157
156
|
res.end(`Authorization denied: ${error}`);
|
|
158
|
-
server.
|
|
157
|
+
server.close();
|
|
158
|
+
server.closeAllConnections();
|
|
159
159
|
reject(new Error(`Authorization denied: ${error}`));
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
@@ -163,7 +163,8 @@ export async function runAuthFlow(args) {
|
|
|
163
163
|
if (!code) {
|
|
164
164
|
res.writeHead(400, { 'Content-Type': 'text/plain' });
|
|
165
165
|
res.end('No authorization code received.');
|
|
166
|
-
server.
|
|
166
|
+
server.close();
|
|
167
|
+
server.closeAllConnections();
|
|
167
168
|
reject(new Error('No authorization code received'));
|
|
168
169
|
return;
|
|
169
170
|
}
|
|
@@ -171,7 +172,8 @@ export async function runAuthFlow(args) {
|
|
|
171
172
|
if (returnedState !== expectedState) {
|
|
172
173
|
res.writeHead(400, { 'Content-Type': 'text/plain' });
|
|
173
174
|
res.end('State mismatch — possible CSRF attempt. Aborting.');
|
|
174
|
-
server.
|
|
175
|
+
server.close();
|
|
176
|
+
server.closeAllConnections();
|
|
175
177
|
reject(new Error('OAuth state token mismatch'));
|
|
176
178
|
return;
|
|
177
179
|
}
|
|
@@ -179,7 +181,8 @@ export async function runAuthFlow(args) {
|
|
|
179
181
|
writeToken(alias, tokens);
|
|
180
182
|
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
181
183
|
res.end('<h2>Authentication successful!</h2><p>You can close this tab.</p>');
|
|
182
|
-
server.
|
|
184
|
+
server.close();
|
|
185
|
+
server.closeAllConnections();
|
|
183
186
|
console.log(`Token saved (encrypted) for ${alias}.`);
|
|
184
187
|
console.log('Next: authenticate your other aliases, then verify with: mcp-google-multi config check');
|
|
185
188
|
resolve();
|
|
@@ -188,7 +191,8 @@ export async function runAuthFlow(args) {
|
|
|
188
191
|
catch (e) {
|
|
189
192
|
res.writeHead(500, { 'Content-Type': 'text/plain' });
|
|
190
193
|
res.end('Internal error during authentication.');
|
|
191
|
-
server.
|
|
194
|
+
server.close();
|
|
195
|
+
server.closeAllConnections();
|
|
192
196
|
reject(e);
|
|
193
197
|
}
|
|
194
198
|
})
|
|
@@ -198,7 +202,6 @@ export async function runAuthFlow(args) {
|
|
|
198
202
|
console.log(`Opening your browser to authorize "${alias}". If nothing opens, visit:\n${authorizeUrl}`);
|
|
199
203
|
open(authorizeUrl, { wait: false }).then((cp) => cp.unref());
|
|
200
204
|
});
|
|
201
|
-
destroyer(server);
|
|
202
205
|
server.on('error', (err) => {
|
|
203
206
|
if (err.code === 'EADDRINUSE') {
|
|
204
207
|
console.error('Port 4242 is already in use. Close the process using it and retry.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-google-multi",
|
|
3
|
-
"version": "5.4.0-
|
|
3
|
+
"version": "5.4.0-beta.1",
|
|
4
4
|
"description": "Local MCP server for Google Workspace (Gmail, Drive, Calendar, Sheets, Docs, Contacts, Tasks, Meet, Search Console, +Forms/Chat/Admin) across multiple accounts — OAuth-only, encrypted token storage, deny-by-default writes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -79,14 +79,12 @@
|
|
|
79
79
|
"googleapis-common": "^8.0.3",
|
|
80
80
|
"mime-types": "^3.0.2",
|
|
81
81
|
"open": "^11.0.0",
|
|
82
|
-
"server-destroy": "^1.0.1",
|
|
83
82
|
"zod": "^4.3.6"
|
|
84
83
|
},
|
|
85
84
|
"devDependencies": {
|
|
86
85
|
"@eslint/js": "^10.0.1",
|
|
87
86
|
"@types/mime-types": "^3.0.1",
|
|
88
87
|
"@types/node": "^25.6.0",
|
|
89
|
-
"@types/server-destroy": "^1.0.3",
|
|
90
88
|
"eslint": "^10.2.1",
|
|
91
89
|
"semantic-release": "^25.0.3",
|
|
92
90
|
"tsx": "^4.23.1",
|