MarioDeFelipe/sap-datasphere-mcp-server
If you are the rightful owner of sap-datasphere-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A Model Context Protocol (MCP) server that provides AI assistants with seamless access to SAP Datasphere capabilities including space management, data discovery, and analytics operations.
SAP Datasphere MCP Server
A Model Context Protocol (MCP) server that provides AI assistants with seamless access to SAP Datasphere capabilities including space management, data discovery, and analytics operations.
🚀 Quick Start
# Clone the repository
git clone https://github.com/yourusername/sap-datasphere-mcp-server.git
cd sap-datasphere-mcp-server
# Install dependencies
pip install mcp pydantic requests
# Test the server
python test_simple_server.py
✨ Features
🏢 Space Management
- List all Datasphere spaces with status and metadata
- Get detailed space information including tables and views
- Explore space configurations and permissions
🔍 Data Discovery
- Search tables and views across all spaces
- Get detailed table schemas with column information
- Explore data catalog and metadata
🔗 Connection Management
- List and monitor data source connections
- Check connection status and health
- View connection configurations
📊 Data Querying
- Execute SQL queries against Datasphere data
- View query results and performance metrics
- Simulate analytical operations
🛒 Marketplace Integration
- Browse available data packages
- Search marketplace content by category
- View package details and installation options
🎯 MCP Tools Available
| Tool | Description | Example Usage |
|---|---|---|
list_spaces | List all Datasphere spaces | "Show me all available spaces" |
get_space_info | Get detailed space information | "Tell me about the Sales Analytics space" |
search_tables | Search for tables across spaces | "Find tables containing customer data" |
list_connections | List data source connections | "What data connections are available?" |
execute_query | Execute SQL queries | "Run: SELECT * FROM CUSTOMER_DATA LIMIT 10" |
📋 MCP Resources
datasphere://spaces- Access to all Datasphere spacesdatasphere://connections- Data source connection information
⚙️ Configuration
Claude Desktop Setup
Add to your Claude Desktop MCP configuration:
{
"mcpServers": {
"sap-datasphere": {
"command": "python",
"args": ["path/to/sap_datasphere_mcp_simple.py"],
"env": {}
}
}
}
Mock vs Live Mode
The server supports two modes:
Mock Mode (Default): Uses realistic sample data for development and testing
- 2 sample spaces (Sales Analytics, Finance DWH)
- Sample tables with proper schemas
- Simulated connections and query results
Live Mode: Connects to real SAP Datasphere APIs (requires OAuth2 setup)
🔧 Installation
Prerequisites
- Python 3.10 or higher
- MCP-compatible AI assistant (Claude Desktop, etc.)
Dependencies
pip install mcp>=1.0.0 pydantic>=2.0.0 requests>=2.31.0
Optional: SAP HANA Client
For direct database access:
pip install hdbcli>=2.26.0
💡 Usage Examples
Basic Queries
"List all Datasphere spaces"
"Show me tables in the Sales Analytics space"
"What's the schema of the CUSTOMER_DATA table?"
"List all data connections and their status"
Advanced Operations
"Search for all tables containing sales data"
"Execute: SELECT COUNT(*) FROM CUSTOMER_DATA"
"Show me connection details for SAP ERP"
"What data packages are available in the marketplace?"
🔐 OAuth2 Setup (For Live Mode)
To connect to real SAP Datasphere APIs:
- Get OAuth Credentials from your Datasphere administrator
- Update Configuration in the server file:
DATASPHERE_CONFIG = { "use_mock_data": False, "oauth_config": { "client_id": "your-client-id", "client_secret": "your-client-secret", "token_url": "https://your-tenant.eu10.hcs.cloud.sap/oauth/token" } } - Restart the MCP server
🧪 Testing
Run the test suite to validate functionality:
python test_simple_server.py
Expected output:
- ✅ Mock data validation
- ✅ MCP configuration generation
- ✅ Usage examples and setup instructions
🏗️ Architecture
The MCP server follows clean architecture principles:
- Mock Data Layer: Realistic sample data for development
- MCP Protocol Layer: Standard MCP tools and resources
- SAP Integration Layer: OAuth2 and API connectivity (ready for live mode)
- Error Handling: Comprehensive error handling and logging
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📝 License
This project is licensed under the MIT License - see the file for details.
🆘 Support
- 📋 Open an issue
- 📚 Check SAP Datasphere documentation
- 💬 Join the discussion in Issues
🙏 Acknowledgments
- SAP Datasphere team for the excellent platform
- Model Context Protocol community
- Contributors and users of this project
Ready to explore your SAP Datasphere data with AI assistants! 🚀