sad-mcp 0.1.0 → 0.1.2
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 +2 -2
- package/dist/index.js +17 -11
- package/package.json +1 -1
package/dist/auth.js
CHANGED
|
@@ -6,8 +6,8 @@ import { createServer } from "http";
|
|
|
6
6
|
import open from "open";
|
|
7
7
|
// OAuth credentials — embedded for desktop app (not secret per Google docs)
|
|
8
8
|
// TODO: Replace with actual credentials from Google Cloud Console
|
|
9
|
-
const CLIENT_ID = "721600472437-
|
|
10
|
-
const CLIENT_SECRET = "GOCSPX-
|
|
9
|
+
const CLIENT_ID = "721600472437-ioeke1596kjm95dph535902me3tgik8v.apps.googleusercontent.com";
|
|
10
|
+
const CLIENT_SECRET = "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";
|
|
11
11
|
const REDIRECT_URI = "http://localhost:3456/oauth2callback";
|
|
12
12
|
const SCOPES = ["https://www.googleapis.com/auth/drive.readonly"];
|
|
13
13
|
const CONFIG_DIR = join(homedir(), ".sad-mcp");
|
package/dist/index.js
CHANGED
|
@@ -4,18 +4,24 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
4
4
|
import { registerResourceHandlers } from "./resources.js";
|
|
5
5
|
import { registerToolHandlers } from "./tools.js";
|
|
6
6
|
import { trackServerStart } from "./tracking.js";
|
|
7
|
-
|
|
8
|
-
capabilities: {
|
|
9
|
-
resources: {},
|
|
10
|
-
tools: {},
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
// Register all handlers
|
|
14
|
-
registerResourceHandlers(server);
|
|
15
|
-
registerToolHandlers(server);
|
|
16
|
-
// Track server startup
|
|
17
|
-
trackServerStart();
|
|
7
|
+
import { getAuthenticatedClient } from "./auth.js";
|
|
18
8
|
async function main() {
|
|
9
|
+
// Authenticate BEFORE connecting to Claude Desktop
|
|
10
|
+
// This prevents timeouts — the OAuth browser flow can take 30+ seconds
|
|
11
|
+
console.error("SAD MCP: Authenticating with Google Drive...");
|
|
12
|
+
await getAuthenticatedClient();
|
|
13
|
+
console.error("SAD MCP: Authentication ready.");
|
|
14
|
+
const server = new Server({ name: "sad-mcp", version: "0.1.1" }, {
|
|
15
|
+
capabilities: {
|
|
16
|
+
resources: {},
|
|
17
|
+
tools: {},
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
// Register all handlers
|
|
21
|
+
registerResourceHandlers(server);
|
|
22
|
+
registerToolHandlers(server);
|
|
23
|
+
// Track server startup
|
|
24
|
+
trackServerStart();
|
|
19
25
|
const transport = new StdioServerTransport();
|
|
20
26
|
await server.connect(transport);
|
|
21
27
|
console.error("SAD MCP server started. Course materials available from Google Drive.");
|