Skip to main content
Glama
frothkoetter

data-marketplace-mcp-server

by frothkoetter
README.md
# Internal Data Marketplace MCP Server

MCP-Agent für einen **internen Data Marketplace** (Data Mesh Store / Internal Data Portal) — optimiert für **Cloudera AI Workbench**.

Der Fokus liegt auf Kollaboration, Governance und Systemintegration: Datensilos aufbrechen, damit Teams Daten self-service finden, prüfen und freigeben lassen können — ohne monatelange IT-Tickets.

## Basisfunktionen

| Bereich | Funktion | MCP-Tool |
|---------|----------|----------|
| **Discovery** | Unternehmensweiter Datenkatalog | `search_data_products` |
| **Discovery** | Metadaten & Ownership | `get_data_product` |
| **UX** | Vorschau & Profiling | `preview_data_product` |
| **Governance** | Business Glossary | `search_glossary` |
| **Governance** | Data Lineage | `get_product_lineage` |
| **Access** | Zugriff anfordern („Warenkorb“) | `request_data_access` |
| **Access** | Anfragen verwalten | `list_access_requests` |
| **Access** | Genehmigen / Ablehnen | `approve_access_request`, `reject_access_request` |
| **Publishing** | Datenprodukt anbieten | `publish_data_product` |
| **Trust** | Zertifizierungs-Badge | `certify_data_product` |
| **Feedback** | Sterne-Bewertung | `submit_product_feedback` |

## Demo-Szenario (Sarah & Thomas)

1. **Suche:** `search_data_products(query="Kundenhistorie Kündigungen", region="DACH", certified_only=true)`
2. **Prüfung:** `get_data_product("DP-SALES-CHURN-HIST")`, `preview_data_product(...)`, `get_product_lineage(...)`
3. **Zugriff:** `request_data_access(...)` mit Nutzungszweck und Zielumgebung
4. **Genehmigung:** Thomas ruft `approve_access_request(...)` auf → automatisches Provisioning
5. **Feedback:** `submit_product_feedback(...)` nach Nutzung

## Lokale Entwicklung

```bash
cd data-marketplace-mcp-server
uv sync
uv run python -m pytest tests/ -q
uv run run-marketplace   # stdio MCP (Cursor / Claude Desktop)
```

## Cloudera AI Workbench Deployment

### Option A: Docker Application

1. Build & push image:
   ```bash
   docker build -t data-marketplace-mcp:0.1.0 .
   ```

2. In **Cloudera AI Workbench** eine neue Application anlegen:
   - Runtime: Docker
   - Port: `8080`
   - Env: siehe `cai-workbench/app.yaml`

3. Persistent volume auf `/data` mounten (`MARKETPLACE_DATA_DIR`).

### Option B: HTTP MCP für Workbench Agents

```bash
export MCP_TRANSPORT=http
export MCP_HOST=0.0.0.0
export MCP_PORT=8080
export MARKETPLACE_DATA_DIR=/data
run-marketplace
```

Workbench-Agents verbinden sich per MCP Streamable HTTP auf Port 8080.

## Konfiguration

| Variable | Default | Beschreibung |
|----------|---------|--------------|
| `MCP_TRANSPORT` | `stdio` | `stdio` oder `http` für Workbench |
| `MCP_HOST` | `0.0.0.0` | Bind-Adresse (HTTP) |
| `MCP_PORT` | `8080` | Port (HTTP) |
| `MARKETPLACE_DATA_DIR` | `./data` | Persistenz für Produkte & Anfragen |
| `ATLAS_GATEWAY_URL` | — | Optional: Atlas-Katalog anreichern |
| `ATLAS_USER` / `ATLAS_PASS` | — | Knox/Atlas Auth |
| `MARKETPLACE_PROVISIONING_WEBHOOK` | — | Optional: Ranger/Entra-ID Automation |

## Atlas-Integration (CDP)

Wenn `ATLAS_*` gesetzt ist:

- `search_data_products` liefert zusätzlich Atlas-Treffer (`hive_table`, `iceberg_table`)
- `get_product_lineage` nutzt Atlas Lineage API
- `search_glossary` durchsucht Atlas Business Glossary

## Provisioning (Erweiterung)

Standardmäßig simuliert `approve_access_request` das Provisioning (Gruppenzuweisung, Zugriff freischalten).
Für echte Automation einen Webhook setzen:

```bash
export MARKETPLACE_PROVISIONING_WEBHOOK=https://your-provisioner/ranger-or-entra
```

Der Webhook erhält JSON mit `request` und `product` und kann Ranger Policies oder Entra-ID-Gruppen steuern.

## MCP in Cursor konfigurieren

```json
{
  "mcpServers": {
    "data-marketplace": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/data-marketplace-mcp-server", "run-marketplace"],
      "env": {
        "ATLAS_GATEWAY_URL": "https://<host>/<topology>/cdp-proxy-api/atlas/api/atlas/",
        "ATLAS_USER": "<user>",
        "ATLAS_PASS": "<pass>"
      }
    }
  }
}
```

## Lizenz

Apache-2.0

TDQS

B3/5.0

Scored across 16 tools

Disambiguation4/5

Most tools have clearly distinct purposes: searching, viewing, requesting access, publishing, and sync operations cover separate concerns. However, list_access_requests and list_product_subscribers both deal with subscribers/access and could cause some confusion about which to use for a given scenario.

Naming Consistency4/5

The naming follows a strong verb_noun pattern (search_data_products, get_data_product, preview_data_product, publish_data_product, certify_data_product). Minor deviations exist: ensure_data_marketplace_typedef and get_product_lineage break the strict pattern but are still readable and descriptive.

Tool Count4/5

At 16 tools, this sits slightly above the ideal sweet spot but is reasonable for a marketplace with search, product lifecycle, access management, and Atlas sync capabilities. Most tools earn their place, though the two ‘WRITE OPERATION’ Atlas sync tools are somewhat operational rather than user-facing.

Completeness4/5

The surface covers search, view, preview, lineage, glossary, access lifecycle (request/list/approve/reject), publishing, certification, and feedback. Minor gaps include no explicit update/delete for data products (only publish/create) and subscription management beyond listing, but the core marketplace workflow is well covered.

Maintenance

ActivitySlowing
ResponsivenessNo issues