enigma-python-mcp
Enigma Python MCP Server
Ein MCP-Server (Model Context Protocol), der die Funktionen der enigmapython-Bibliothek für LLMs bereitstellt und es ihnen ermöglicht, Nachrichten mithilfe historisch akkurater Enigma-Maschinen-Emulatoren zu verschlüsseln und zu entschlüsseln.

Dieser MCP-Server ist auf Glama.ai mit dieser Bewertung gelistet:
Funktionen
Unterstützt alle bekannten Enigma-Maschinenmodelle: Enigma M3, Enigma M4, Enigma I, Enigma K, Enigma Z, Enigma D und mehr.
Dynamische Konfiguration: LLMs können Rotoren, Anfangspositionen, Ringeinstellungen, Reflektoren und Steckerbrettverbindungen für die Verschlüsselung festlegen.
Lokal- und Netzwerkmodus: Unterstützt sowohl den
stdio-Transport für lokale MCP-Integrationen (wie Claude Desktop) als auch densse-Transport, um die Tools über ein Netzwerk bereitzustellen.Dockerisiert: Einfache Portabilität und Ausführung auf verschiedenen Plattformen.
Related MCP server: MCP Server Example
Verfügbare Tools
encrypt_message
Verschlüsselt oder entschlüsselt eine Nachricht mithilfe einer konfigurierten Enigma-Maschine.
Argumente:
machine_model(str): Modellname. Unterstützt:'M3','M4','I','I_Norway','I_Sondermaschine','K','K_Swiss','D','Z','B_A133'.message(str): Der zu verarbeitende Klartext oder Geheimtext.rotors(list[object]): Liste vonRotorConfig-Objekten. Jedes Objekt spezifiziertrotor_type(str),ring_setting(int, Standard=0) undinitial_position(int | str, Standard=0). WICHTIG: Die Liste MUSS exakt wie folgt geordnet sein:[Schnellster/Rechts, Mitte, Langsamster/Links, Griechisch (falls M4)].reflector(object): EinReflectorConfig-Objekt, dasreflector_type(str) sowie optionalring_setting(int) undinitial_position(int | str) für rotierende Reflektoren spezifiziert.plugboard_pairs(dict, optional): Wörterbuch, das Steckerbrettverbindungen zuordnet (z. B.{"A": "B", "C": "D"}).
Ausführen des Servers
Mit Python
Erfordert Python 3.11+.
Installieren Sie das Paket von PyPI:
pip install enigmapython-mcp(Alternativ können Sie einfach
uvx enigmapython-mcpausführen, fallsuvinstalliert ist!)Ausführung via stdio (für lokale MCP-Clients):
enigmapython-mcp --transport stdioAusführung via SSE (Bereitstellung über Netzwerk):
enigmapython-mcp --transport sse --host 0.0.0.0 --port 8000
Mit Docker
Bauen Sie den Container:
docker build -t enigmapython-mcp .Ausführung via stdio (Standard):
docker run -i enigmapython-mcpAusführung via SSE:
docker run -p 8000:8000 enigmapython-mcp --transport sse --host 0.0.0.0 --port 8000
Client-Konfiguration (Claude Desktop)
Wir bieten zwei verschiedene mcpb-Bundles für die 1-Klick-Installation auf Claude Desktop an. Laden Sie einfach das gewünschte Bundle von der GitHub Releases-Seite herunter und ziehen Sie es per Drag-and-Drop in das Erweiterungsmenü von Claude Desktop:
enigmapython-mcp-docker.mcpb: Extrem leichtgewichtig, nutzt Ihren lokalen Docker-Daemon, um den Server in einem isolierten Container auszuführen. (Empfohlen)enigmapython-mcp-python.mcpb: Enthält den vollständigen Python-Quellcode. Claude Desktop erstellt nativ eine virtuelle Umgebung und führt den Server ohne Docker aus.
Wenn Sie die manuelle Konfiguration über claude_desktop_config.json bevorzugen, verwenden Sie die folgenden Einstellungen:
Mit Python (uvx empfohlen)
{
"mcpServers": {
"enigma": {
"command": "uvx",
"args": ["enigmapython-mcp", "--transport", "stdio"]
}
}
}Mit Docker
(Hinweis: Stellen Sie sicher, dass Sie das Docker-Image zuerst erstellt haben: docker build -t enigmapython-mcp .)
{
"mcpServers": {
"enigma": {
"command": "docker",
"args": ["run", "-i", "--rm", "enigmapython-mcp"]
}
}
}Client-Konfiguration (OpenCode)
Um diesen Server mit OpenCode zu verwenden, fügen Sie Folgendes zu Ihrer ~/.config/opencode/opencode.json (global) oder opencode.json (auf Projektebene) unter dem Abschnitt mcp hinzu:
Mit Python (uvx empfohlen)
{
"mcp": {
"enigma": {
"type": "local",
"command": [
"uvx",
"enigmapython-mcp",
"--transport",
"stdio"
],
"enabled": true
}
}
}Mit Docker
(Hinweis: Stellen Sie sicher, dass Sie das Docker-Image zuerst erstellt haben: docker build -t enigmapython-mcp .)
{
"mcp": {
"enigma": {
"type": "local",
"command": [
"docker",
"run",
"-i",
"--rm",
"enigmapython-mcp"
],
"enabled": true
}
}
}Beispiel-Prompts
Sobald der Server konfiguriert ist, können Sie ihn testen, indem Sie die folgenden Prompts an Ihr LLM senden:
Beispiel 1: Einfache Verschlüsselung (Enigma M3)
"Ich muss die Nachricht 'TOPSECRET' mit einer Enigma M3 verschlüsseln. Die Rotoren, geordnet von schnell nach langsam, sind III, II und I. Alle starten auf Position 0 mit Ringeinstellungen auf 0. Verwende den Reflektor 'UKWB' und kein Steckerbrett. Was ist der Geheimtext?"
Beispiel 2: Historische Entschlüsselung (Enigma I)
"Entschlüssele diese Enigma I-Nachricht von 1930. Der Geheimtext lautet 'GCDSEAHUGWTQGRK'. Die Maschineneinstellungen, streng geordnet von Schnell nach Langsam, sind: Rotoren III, I und II. Ihre jeweiligen Ringeinstellungen sind 21, 12 und 23. Ihre Anfangspositionen sind 11, 1 und 0. Der Reflektor ist 'UKWA'. Die Steckerbrettverbindungen sind: A/M, F/I, N/V, P/S, T/U, W/Z."
Beispiel 3: Komplexe M4-Konfiguration
"Verwende die Enigma M4, um die Nachricht 'DIVE DIVE DIVE' zu verschlüsseln. Die Maschine verwendet den 'UKWBThin'-Reflektor. Die Rotoren, explizit geordnet als [Schnell, Mitte, Langsam, Griechisch], sind: VIII (Pos 2), III (Pos 6), IV (Pos 12) und Gamma (Pos 21). Alle Ringeinstellungen sind 0. Bitte verarbeite dies."
Tests
Eine umfassende Testsuite ist in tests/test_server.py enthalten. Sie testet die Umkehrbarkeit von Verschlüsselung und Entschlüsselung für alle 10 unterstützten Enigma-Modelle.
So führen Sie die Tests aus:
# Activate your virtual environment first
source .venv/bin/activate
pip install pytest
export PYTHONPATH=$PYTHONPATH:$(pwd)/src/enigmapython_mcp && pytest tests/* Interaktives Testen des SSE-Servers
Da das Model Context Protocol einen zustandsbehafteten Initialisierungs-Handshake erfordert, bevor Tools aufgerufen werden können, ist das manuelle Testen des SSE-Endpunkts mit curl recht komplex.
Der einfachste und offiziell empfohlene Weg zum Testen des Servers ist die Verwendung des MCP Inspector:
Stellen Sie sicher, dass Ihr Server im SSE-Modus läuft:
uv run enigmapython-mcp --transport sse --host 0.0.0.0 --port 8000Starten Sie in einem zweiten Terminal den Inspector:
npx @modelcontextprotocol/inspectorEine Weboberfläche öffnet sich in Ihrem Browser (normalerweise unter
http://localhost:5173).Ändern Sie den Transport Type auf SSE.
Geben Sie
http://localhost:8000/sseals URL ein und klicken Sie auf Connect.Sie können nun das Tool
encrypt_messagevisuell konfigurieren und ausführen!
Available Tools
1 toolencrypt_messageA
Encrypt or decrypt a message using a specified Enigma machine configuration.
Args:
machine_model: Exact machine model name. MUST be one of: 'M3', 'M4', 'I', 'I_Norway', 'I_Sondermaschine', 'K', 'K_Swiss', 'D', 'Z', 'B_A133', 'T'. Do not add 'Enigma' prefix.
Supported models and their explicitly required reflectors:
- 'M3', 'I': UKWA, UKWB, UKWC
- 'M4': UKWBThin, UKWCThin
- 'I_Norway': UKW_EnigmaINorway
- 'I_Sondermaschine': UKW_EnigmaISonder
- 'K', 'K_Swiss', 'D': UKW_EnigmaCommercial
- 'Z': UKW_EnigmaZ
- 'B_A133': UKW_EnigmaB_A133
- 'T': UKW_EnigmaT
message: The plaintext or ciphertext to process.
- For Enigma Z: MUST contain ONLY digits (1234567890).
- For Enigma B_A133: MUST contain ONLY Swedish letters (abcdefghijklmnopqrstuvxyzåäö). Note: 'w' is strictly forbidden.
- For all other machines: MUST contain ONLY standard letters (A-Z).
- Spaces, punctuation, and special characters are strictly forbidden in all machines.
rotors: List of RotorConfig objects. MUST be ordered exactly as: [Fastest/Rightmost, Middle, Slowest/Leftmost, Greek (if M4)].
reflector: The ReflectorConfig object.
plugboard_pairs: Optional dict for plugboard connections (e.g. {"A": "B", "C": "D"}). Ignored if the machine has no plugboard.
| Name | Required | Description | Default |
|---|---|---|---|
| rotors | Yes | ||
| message | Yes | ||
| reflector | Yes | ||
| machine_model | Yes | ||
| plugboard_pairs | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It adds valuable behavioral context such as message character restrictions per machine model, rotor ordering, and plugboard being ignored when absent. However, it does not disclose return behavior, error handling, or side effects, leaving some transparency gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the core purpose, then structured as an 'Args' list. It is lengthy due to the complexity, but each line adds necessary value. A slightly more compressed format could be achieved without losing information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complex nested schema and no output schema, the description covers all input parameters thoroughly, including valid values and constraints. It does not explicitly state the return value, but that is implied by the encrypt/decrypt purpose. Overall, it is complete enough for a well-equipped agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% top-level description coverage, but the description provides exhaustive semantics for every parameter: allowed machine models, per-model message constraints, rotor ordering, reflector guidance, and plugboard behavior. This fully compensates for the missing schema documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Encrypt or decrypt a message using a specified Enigma machine configuration,' which clearly states the verb and resource. However, there are no sibling tools to differentiate from, so it loses a point for not distinguishing alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives (though there are none), nor any prerequisites, exclusions, or context beyond the first sentence. The detailed parameter constraints are helpful but do not address usage scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.1.4- Changed
encrypt_message1 field changed- changed
Input schema / $defs / ReflectorConfig / properties / reflector_type / descriptionPrevious value: -"Exact Reflector identifier. Valid options: 'UKWA', 'UKWB', 'UKWC', 'UKWBThin', 'UKWCThin', 'UKW_EnigmaCommercial', 'UKW_EnigmaINorway', 'UKW_EnigmaISonder', 'UKW_EnigmaB_A133'."New value: +"Exact Reflector identifier. Valid options: 'UKWA', 'UKWB', 'UKWC', 'UKWBThin', 'UKWCThin', 'UKW_EnigmaCommercial', 'UKW_EnigmaINorway', 'UKW_EnigmaISonder', 'UKW_EnigmaB_A133', 'UKW_EnigmaT'."
1 tool update
v0.1.0- First observed
encrypt_message
TDQS
Scored across 1 tool
Only one tool exists, so there is no ambiguity between tools. The single tool's purpose is clear from its description.
The single tool name 'encrypt_message' follows a clear verb_noun pattern, and there are no other tools to create inconsistency. The name is slightly misleading as it also performs decryption, but this does not affect consistency across tools.
With only one tool, the server feels very thin for an Enigma machine library. However, the single tool is comprehensive, covering encryption and decryption for many machine models.
The tool covers both encryption and decryption, which are the core operations. It also supports a wide range of Enigma models. There could be additional tools for listing models or validating configurations, but these are minor gaps.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
MCP server for AI dialogue using various LLM models via AceDataCloud
Related MCP Servers
- AlicenseDqualityDmaintenanceA Model Context Protocol server that gives LLMs the ability to interact with Ethereum networks, manage wallets, query blockchain data, and execute smart contract operations through a standardized interface.5412 npm14MIT
- AlicenseBqualityDmaintenanceAn educational implementation of a Model Context Protocol server that demonstrates how to build a functional MCP server for integrating with various LLM clients like Claude Desktop.1164MIT
- AlicenseBqualityDmaintenanceAn educational implementation of a Model Context Protocol server that demonstrates how to build a functional MCP server integrating with various LLM clients.2MIT
- FlicenseNot gradedqualityDmaintenanceA foundational implementation of a Model Context Protocol (MCP) server designed for educational purposes. It demonstrates the complete interaction between an LLM, an inference engine, and a client during an agentic call.-