forked from JumenEngels/sap_analytics_cloud_mcp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.js
More file actions
44 lines (37 loc) · 1.44 KB
/
Copy pathsetup.js
File metadata and controls
44 lines (37 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env node
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Define paths
const projectRoot = __dirname;
const buildPath = path.join(projectRoot, 'build', 'index.js');
const configPath = path.join(projectRoot, 'mcp_config.json');
// Check if build exists
if (!fs.existsSync(buildPath)) {
console.warn(`\x1b[33mWarning: Build file not found at ${buildPath}\x1b[0m`);
console.warn(`Make sure to run 'npm run build' before using the server.`);
}
// Config template
const config = {
"mcpServers": {
"sac": {
"command": "node",
"args": [buildPath],
"env": {
"SAC_BASE_URL": "https://YOUR_TENANT.YOUR_DC.sapanalytics.cloud",
"SAC_TOKEN_URL": "PASTE_TOKEN_URL_FROM_SAC_ADMIN_APP_INTEGRATION",
"SAC_CLIENT_ID": "YOUR_OAUTH_CLIENT_ID",
"SAC_CLIENT_SECRET": "YOUR_OAUTH_CLIENT_SECRET"
}
}
}
};
// Write config
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
console.log(`\x1b[32m✅ Successfully generated mcp_config.json\x1b[0m`);
console.log(`Server path set to: \x1b[36m${buildPath}\x1b[0m`);
console.log(`\nNext steps:`);
console.log(`1. Edit \x1b[1mmcp_config.json\x1b[0m to add your SAC credentials.`);
console.log(`2. Copy the content to your Claude Desktop config.`);