@mariodefe/sap-datasphere-mcp 1.0.9
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/CHANGELOG_v1.0.9.md +196 -0
- package/LICENSE +21 -0
- package/README.md +1037 -0
- package/bin/sap-datasphere-mcp.js +116 -0
- package/package.json +51 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SAP Datasphere MCP Server - npm wrapper
|
|
5
|
+
* This script launches the Python-based MCP server
|
|
6
|
+
*
|
|
7
|
+
* @version 1.0.9
|
|
8
|
+
* @license MIT
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const { spawn } = require('child_process');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
|
|
14
|
+
// Check if Python is available
|
|
15
|
+
function checkPython() {
|
|
16
|
+
return new Promise((resolve) => {
|
|
17
|
+
const python = spawn('python', ['--version']);
|
|
18
|
+
python.on('error', () => {
|
|
19
|
+
const python3 = spawn('python3', ['--version']);
|
|
20
|
+
python3.on('error', () => resolve(null));
|
|
21
|
+
python3.on('close', (code) => resolve(code === 0 ? 'python3' : null));
|
|
22
|
+
});
|
|
23
|
+
python.on('close', (code) => resolve(code === 0 ? 'python' : null));
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async function main() {
|
|
28
|
+
console.log('🚀 SAP Datasphere MCP Server v1.0.9');
|
|
29
|
+
console.log('');
|
|
30
|
+
|
|
31
|
+
// Check for Python
|
|
32
|
+
const pythonCmd = await checkPython();
|
|
33
|
+
|
|
34
|
+
if (!pythonCmd) {
|
|
35
|
+
console.error('❌ Error: Python 3.10+ is required but not found.');
|
|
36
|
+
console.error('');
|
|
37
|
+
console.error('Please install Python 3.10 or higher:');
|
|
38
|
+
console.error(' - Windows: https://www.python.org/downloads/');
|
|
39
|
+
console.error(' - macOS: brew install python@3.10');
|
|
40
|
+
console.error(' - Linux: sudo apt install python3.10');
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
console.log(`✓ Python found: ${pythonCmd}`);
|
|
45
|
+
|
|
46
|
+
// Check if sap-datasphere-mcp package is installed
|
|
47
|
+
const checkInstall = spawn(pythonCmd, ['-m', 'pip', 'show', 'sap-datasphere-mcp']);
|
|
48
|
+
|
|
49
|
+
checkInstall.on('close', (code) => {
|
|
50
|
+
if (code !== 0) {
|
|
51
|
+
console.log('');
|
|
52
|
+
console.log('📦 Installing SAP Datasphere MCP Python package...');
|
|
53
|
+
console.log('');
|
|
54
|
+
|
|
55
|
+
const install = spawn(pythonCmd, ['-m', 'pip', 'install', '--upgrade', 'sap-datasphere-mcp'], {
|
|
56
|
+
stdio: 'inherit'
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
install.on('close', (installCode) => {
|
|
60
|
+
if (installCode !== 0) {
|
|
61
|
+
console.error('');
|
|
62
|
+
console.error('❌ Failed to install Python package.');
|
|
63
|
+
console.error('');
|
|
64
|
+
console.error('Please install manually:');
|
|
65
|
+
console.error(' pip install sap-datasphere-mcp');
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
console.log('');
|
|
70
|
+
console.log('✓ Python package installed successfully');
|
|
71
|
+
console.log('');
|
|
72
|
+
startServer(pythonCmd);
|
|
73
|
+
});
|
|
74
|
+
} else {
|
|
75
|
+
console.log('✓ Python package already installed');
|
|
76
|
+
console.log('');
|
|
77
|
+
startServer(pythonCmd);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function startServer(pythonCmd) {
|
|
83
|
+
console.log('🌟 Starting MCP server...');
|
|
84
|
+
console.log('');
|
|
85
|
+
|
|
86
|
+
// Start the MCP server
|
|
87
|
+
const server = spawn(pythonCmd, ['-m', 'sap_datasphere_mcp_server'], {
|
|
88
|
+
stdio: 'inherit',
|
|
89
|
+
env: process.env
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
server.on('error', (err) => {
|
|
93
|
+
console.error('❌ Failed to start server:', err.message);
|
|
94
|
+
process.exit(1);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
server.on('close', (code) => {
|
|
98
|
+
if (code !== 0) {
|
|
99
|
+
console.error(`❌ Server exited with code ${code}`);
|
|
100
|
+
process.exit(code);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// Handle Ctrl+C gracefully
|
|
105
|
+
process.on('SIGINT', () => {
|
|
106
|
+
console.log('');
|
|
107
|
+
console.log('👋 Shutting down server...');
|
|
108
|
+
server.kill('SIGINT');
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Run main function
|
|
113
|
+
main().catch((err) => {
|
|
114
|
+
console.error('❌ Unexpected error:', err);
|
|
115
|
+
process.exit(1);
|
|
116
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mariodefe/sap-datasphere-mcp",
|
|
3
|
+
"version": "1.0.9",
|
|
4
|
+
"description": "Model Context Protocol server for SAP Datasphere integration with 45 tools including Smart Query with enhanced aggregation support",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"sap",
|
|
7
|
+
"datasphere",
|
|
8
|
+
"mcp",
|
|
9
|
+
"model-context-protocol",
|
|
10
|
+
"data-warehouse",
|
|
11
|
+
"etl",
|
|
12
|
+
"odata",
|
|
13
|
+
"oauth",
|
|
14
|
+
"analytics",
|
|
15
|
+
"cloud",
|
|
16
|
+
"claude",
|
|
17
|
+
"ai"
|
|
18
|
+
],
|
|
19
|
+
"author": "Mario DeFelipe <mario.defelipe@example.com>",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/MarioDeFelipe/sap-datasphere-mcp.git"
|
|
24
|
+
},
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/MarioDeFelipe/sap-datasphere-mcp/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/MarioDeFelipe/sap-datasphere-mcp#readme",
|
|
29
|
+
"bin": {
|
|
30
|
+
"sap-datasphere-mcp": "./bin/sap-datasphere-mcp.js"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"postinstall": "python -m pip install --upgrade sap-datasphere-mcp || echo 'Warning: Python package installation failed. Please run: pip install sap-datasphere-mcp'"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18.0.0",
|
|
37
|
+
"python": ">=3.10.0"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"bin/",
|
|
44
|
+
"README.md",
|
|
45
|
+
"LICENSE",
|
|
46
|
+
"CHANGELOG_v1.0.9.md"
|
|
47
|
+
],
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"python": ">=3.10.0"
|
|
50
|
+
}
|
|
51
|
+
}
|