sap-datasphere-mcp-server

MarioDeFelipe/sap-datasphere-mcp-server

3.2

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.

Tools
5
Resources
0
Prompts
0

SAP Datasphere MCP Server

License: MIT Python 3.10+ MCP Compatible

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

ToolDescriptionExample Usage
list_spacesList all Datasphere spaces"Show me all available spaces"
get_space_infoGet detailed space information"Tell me about the Sales Analytics space"
search_tablesSearch for tables across spaces"Find tables containing customer data"
list_connectionsList data source connections"What data connections are available?"
execute_queryExecute SQL queries"Run: SELECT * FROM CUSTOMER_DATA LIMIT 10"

📋 MCP Resources

  • datasphere://spaces - Access to all Datasphere spaces
  • datasphere://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:

  1. Get OAuth Credentials from your Datasphere administrator
  2. 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"
        }
    }
    
  3. 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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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! 🚀