Skip to main content

fega-schmitt-mcp

Publish License: MIT uv Ruff

Status: v1 implementiert (Preis-/Verfügbarkeitsabfrage), noch nicht auf PyPI veröffentlicht.

Ein dünner MCP-Server, der KI-Assistenten (z. B. Claude) Zugriff auf Daten von FEGA & Schmitt Elektrogroßhandel gibt — Preis- und Verfügbarkeitsabfragen für Artikel.

Die gesamte Protokoll-/API-Logik (SOAP, Auth, Fehlercodes, XML) lebt nicht in diesem Repo, sondern in der eigenständigen Python-Library fega-schmitt-client (Repo unter GIT/Python/, auf PyPI veröffentlicht). Dieses Repo bildet nur die Brücke zwischen MCP-Protokoll und dieser Library.

graph LR
    Host["MCP-Host<br/>(Claude Desktop / Claude Code / ...)"] -->|stdio, JSON-RPC| MCP["fega-schmitt-mcp<br/>(dieses Repo)"]
    MCP -->|Python-Aufruf| LIB["fega-schmitt-client<br/>(eigenes Repo + PyPI-Paket)"]
    LIB -->|SOAP/HTTPS| API["FEGA & Schmitt<br/>Preis-/Verfügbarkeitsservice"]

    style MCP fill:#2b6cb0,color:#fff

Suchst du die Python-Library oder das CLI-Tool? Siehe fega-schmitt-client — die eigenständige Library, die dieser MCP-Server verpackt.

Warum zwei Pakete?

  • fega-schmitt-client: reine Python-Library, kein MCP-/KI-spezifischer Code. Eigenständig nutzbar (Skripte, andere Services), unabhängig testbar, unabhängig versionierbar.
  • fega-schmitt-mcp (dieses Repo): übersetzt die Library-Funktionen in MCP-Tools (stdio-Transport, Tool-Schemas, Fehler-Serialisierung für MCP-Clients). Enthält selbst keine SOAP-/XML-Logik.

Tools

Tool Beschreibung
get_price_availability Preis und Verfügbarkeit für bis zu 999 Artikel je Anfrage. Eingabe: Liste von Artikelnummern mit Menge und optionaler Mengeneinheit. Ausgabe je Artikel: Verfügbarkeitsstatus, Nettopreis, Listenpreis, Zu-/Abschläge, Lagerzuordnung. Fehlerfälle (unbekannte Artikelnummer, ungültige Mengeneinheit, Mengenüberlauf) werden je Position gemeldet, ohne die gesamte Anfrage abzubrechen.

Installation

Voraussetzungen

  • Python ≥ 3.10
  • uv

Dependencies installieren

uv sync

Server starten (Entwicklung)

export FEGA_CUSTOMER_NUMBER=9920
export FEGA_SHOP_PASSWORD=...
uv run fega-schmitt-mcp
# oder
uv run python -m fega_schmitt_mcp.server

Mit dem MCP Inspector testen

uv run mcp dev src/fega_schmitt_mcp/server.py

Konfiguration in VS Code / Claude Desktop

Server in der MCP-Konfiguration eintragen (.vscode/mcp.json bzw. claude_desktop_config.json):

Installation von PyPI (empfohlen, sobald veröffentlicht):

{
  "servers": {
    "fega-schmitt": {
      "command": "bash",
      "args": ["-l", "-c", "uvx fega-schmitt-mcp"],
      "env": {
        "FEGA_CUSTOMER_NUMBER": "9920",
        "FEGA_SHOP_PASSWORD": "..."
      }
    }
  }
}

Installation von GitHub (noch unveröffentlicht):

{
  "servers": {
    "fega-schmitt": {
      "command": "bash",
      "args": [
        "-l",
        "-c",
        "uvx --from git+https://github.com/the78mole/fega-schmitt-mcp.git fega-schmitt-mcp"
      ],
      "env": {
        "FEGA_CUSTOMER_NUMBER": "9920",
        "FEGA_SHOP_PASSWORD": "..."
      }
    }
  }
}

Lokale Entwicklung (Workspace-Checkout):

{
  "servers": {
    "fega-schmitt": {
      "command": "bash",
      "args": ["-l", "-c", "uv --directory ${workspaceFolder} run fega-schmitt-mcp"],
      "env": {
        "FEGA_CUSTOMER_NUMBER": "9920",
        "FEGA_SHOP_PASSWORD": "..."
      }
    }
  }
}

Hinweis: bash -l lädt das Login-Shell-Profil, damit uvx/uv in ~/.local/bin gefunden werden, ohne dass eine zusätzliche env/PATH-Konfiguration nötig ist.

Umgebungsvariablen

Variable Default Beschreibung
FEGA_CUSTOMER_NUMBER – (erforderlich) FEGA & Schmitt-Kundennummer (PARTNER_PURCHASER)
FEGA_SHOP_PASSWORD – (erforderlich) Shop-Kennwort (LEGITIMATION_ID)
FEGA_ENDPOINT https://soap.fega.de/priceavail.php Abweichende Service-URL, z. B. für Tests gegen einen Mock-Server
FEGA_TIMEOUT 30 HTTP-Timeout in Sekunden

Fehlen FEGA_CUSTOMER_NUMBER/FEGA_SHOP_PASSWORD, liefert das Tool {"error": ...} statt eine Exception zu werfen — Secrets werden nie geloggt oder im Code hinterlegt (siehe docs/architecture.md, Abschnitt 3).

Beispiel

get_price_availability(items=[
    {"material_number": "0815", "quantity": "200", "unit": "MTR"},
    {"material_number": "4711"},
])

liefert:

{
  "results": [
    {
      "line_item_number": 1,
      "material_number": "0815",
      "status": "ok",
      "return_code": "I720",
      "return_code_text": "OK",
      "availability_status": "V",
      "warehouse_number": "10",
      "warehouse_name": "Zentrallager",
      "price_amount": "12.50",
      "net_amount": "13.20",
      "list_amount": "15.00",
      "surcharges": [{"code": "CU", "text": "Kupferzuschlag", "amount": "0.70"}]
    },
    {
      "line_item_number": 2,
      "material_number": "4711",
      "status": "error",
      "return_code": "E999",
      "return_code_text": "Bitte pruefen Sie Ihre Anmeldedaten",
      "availability_status": null,
      "warehouse_number": null,
      "warehouse_name": null,
      "price_amount": null,
      "net_amount": null,
      "list_amount": null,
      "surcharges": []
    }
  ]
}

Über FEGA & Schmitt

FEGA & Schmitt ist ein deutscher Elektrogroßhändler. Details zu den verfügbaren Schnittstellen (SOAP-Preisservice, IDS-Branchenstandard, UGL4-Branchenstandard) und warum aktuell nur der SOAP-Preisservice angebunden wird, siehe die Architekturbeschreibung der Library: fega-schmitt-client/docs/architecture.md.

Lokale Entwicklung

# Projektumgebung einrichten
uv sync

# Linting & Formatting
uv run ruff format .
uv run ruff check --fix .

# Tests
uv run pytest

Offene Punkte

  • Test-/Produktivzugangsdaten für den SOAP-Service (siehe fega-schmitt-client-Repo)
  • Zielumgebung des MCP-Servers (lokal per stdio, oder als gehosteter Dienst?)
  • Endgültiger PyPI-/Paketname (fega-schmitt-mcp ist ein Arbeitstitel)
  • PyPI Trusted Publishing muss einmalig manuell auf pypi.org eingerichtet werden (Workflow-Datei publish.yml, Environment pypi), bevor der Release-Workflow tatsächlich veröffentlichen kann

Related Projects

Project Description
fega-schmitt-client Python-Library, die dieser MCP-Server verpackt. Enthält die gesamte SOAP-/Protokoll-Logik sowie ein eigenständiges CLI.

Lizenz

MIT, siehe LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fega_schmitt_mcp-0.0.9.tar.gz (93.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fega_schmitt_mcp-0.0.9-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file fega_schmitt_mcp-0.0.9.tar.gz.

File metadata

  • Download URL: fega_schmitt_mcp-0.0.9.tar.gz
  • Upload date:
  • Size: 93.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for fega_schmitt_mcp-0.0.9.tar.gz
Algorithm Hash digest
SHA256 2d9ad79a01f0ff7297907e1a3686e911f5f471cfdece3fdb86d1d82f5ef708f8
MD5 fe7daeab7f33589f50004cc3f046f12c
BLAKE2b-256 f3cc6b96180549f0c41be50c3dbbf8127b073c0a733a70414251eb0d091b494c

See more details on using hashes here.

Provenance

The following attestation bundles were made for fega_schmitt_mcp-0.0.9.tar.gz:

Publisher: publish.yml on the78mole/fega-schmitt-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fega_schmitt_mcp-0.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for fega_schmitt_mcp-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1eeedc0556c80b9f2fbc6657fad87645c3480a85cdeed4736bb93e396f21dc34
MD5 ef2c849ff1b1b702ee81e5f0d4d9afc7
BLAKE2b-256 80be2aa64a7b102892f6133e163aa4e71f81661163ab55d84b663a3d23d8e1aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for fega_schmitt_mcp-0.0.9-py3-none-any.whl:

Publisher: publish.yml on the78mole/fega-schmitt-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.1

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

This release

0.0.9 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page