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.10.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.10-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fega_schmitt_mcp-0.0.10.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.10.tar.gz
Algorithm Hash digest
SHA256 d7f278ebafc0624303094e5a8961c431a42d9c2c2eae4a272ac9267f28b0d5de
MD5 5e39d0a50638d065600c187458e23d2f
BLAKE2b-256 5d7e0313cdaf5db1f5385132a779d516a92f84eb8755a71be86c2f5f31bb7d83

See more details on using hashes here.

Provenance

The following attestation bundles were made for fega_schmitt_mcp-0.0.10.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.10-py3-none-any.whl.

File metadata

File hashes

Hashes for fega_schmitt_mcp-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 ce51072f9ef8539c744995b0f33391a5adf1dfedccb3b3fb46d3b56e3871ff56
MD5 fca1fed7cf655608abb130e47a30c9db
BLAKE2b-256 ebd8bbf0682dff2eed78d2f712161d1dd864716a4f3aeca856bae505e12ef4b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for fega_schmitt_mcp-0.0.10-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

This release

0.0.10 This release

2 files

0.0.9

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