enigma-python-mcp
Enigma Python MCP Server
enigmapythonライブラリの機能をLLMに提供し、歴史的に正確なエニグマ暗号機エミュレーターを使用してメッセージの暗号化と復号化を可能にするMCP(Model Context Protocol)サーバーです。

このMCPサーバーはGlama.aiに掲載されており、以下のスコアを獲得しています。
機能
既知のエニグマ暗号機モデルをすべて公開: Enigma M3、Enigma M4、Enigma I、Enigma K、Enigma Z、Enigma Dなど。
動的設定: LLMは暗号化のためにローター、初期位置、リング設定、リフレクター、プラグボードのペアを指定できます。
ローカルおよびネットワークモード: ローカルMCP統合(Claude Desktopなど)用の
stdioトランスポートと、ネットワーク経由でツールを公開するためのsseトランスポートの両方をサポートしています。Docker化: プラットフォーム間での移植と実行が容易です。
Related MCP server: MCP Server Example
公開ツール
encrypt_message
設定されたエニグマ暗号機を使用してメッセージを暗号化または復号化します。
引数:
machine_model(str): モデル名。サポート対象:'M3','M4','I','I_Norway','I_Sondermaschine','K','K_Swiss','D','Z','B_A133'。message(str): 処理する平文または暗号文。rotors(list[object]):RotorConfigオブジェクトのリスト。各オブジェクトはrotor_type(str)、ring_setting(int, デフォルト=0)、initial_position(int | str, デフォルト=0)を指定します。重要: リストは必ず[最速/右端, 中央, 最遅/左端, ギリシャ文字(M4の場合)]の順序である必要があります。reflector(object):reflector_type(str)、およびオプションで回転リフレクター用のring_setting(int)とinitial_position(int | str)を指定するReflectorConfigオブジェクト。plugboard_pairs(dict, オプション): プラグボード接続をマッピングする辞書(例:{"A": "B", "C": "D"})。
サーバーの実行
Pythonを使用する場合
Python 3.11以上が必要です。
PyPIからパッケージをインストールします:
pip install enigmapython-mcp(
uvがインストールされている場合は、単にuvx enigmapython-mcpを実行することもできます!)stdio経由で実行(ローカルMCPクライアント用):
enigmapython-mcp --transport stdioSSE経由で実行(ネットワーク経由で公開):
enigmapython-mcp --transport sse --host 0.0.0.0 --port 8000
Dockerを使用する場合
コンテナをビルドします:
docker build -t enigmapython-mcp .stdio経由で実行(デフォルト):
docker run -i enigmapython-mcpSSE経由で実行:
docker run -p 8000:8000 enigmapython-mcp --transport sse --host 0.0.0.0 --port 8000
クライアント設定 (Claude Desktop)
Claude Desktopにワンクリックでインストールできる2つの異なるmcpbバンドルを提供しています。GitHub Releasesページからお好みのバンドルをダウンロードし、Claude Desktopの拡張機能メニューにドラッグ&ドロップしてください:
enigmapython-mcp-docker.mcpb: 非常に軽量で、ローカルのDockerデーモンを使用して隔離されたコンテナ内でサーバーを実行します。(推奨)enigmapython-mcp-python.mcpb: Pythonソースコード全体が含まれています。Claude Desktopがネイティブに仮想環境を構築し、Dockerなしでサーバーを実行します。
claude_desktop_config.jsonによる手動設定を希望する場合は、以下の設定を使用してください:
Pythonを使用する場合 (uvx推奨)
{
"mcpServers": {
"enigma": {
"command": "uvx",
"args": ["enigmapython-mcp", "--transport", "stdio"]
}
}
}Dockerを使用する場合
(注: 事前にDockerイメージをビルドしていることを確認してください: docker build -t enigmapython-mcp .)
{
"mcpServers": {
"enigma": {
"command": "docker",
"args": ["run", "-i", "--rm", "enigmapython-mcp"]
}
}
}クライアント設定 (OpenCode)
OpenCodeでこのサーバーを使用するには、~/.config/opencode/opencode.json(グローバル)またはopencode.json(プロジェクトレベル)のmcpセクションに以下を追加してください:
Pythonを使用する場合 (uvx推奨)
{
"mcp": {
"enigma": {
"type": "local",
"command": [
"uvx",
"enigmapython-mcp",
"--transport",
"stdio"
],
"enabled": true
}
}
}Dockerを使用する場合
(注: 事前にDockerイメージをビルドしていることを確認してください: docker build -t enigmapython-mcp .)
{
"mcp": {
"enigma": {
"type": "local",
"command": [
"docker",
"run",
"-i",
"--rm",
"enigmapython-mcp"
],
"enabled": true
}
}
}プロンプト例
サーバーの設定が完了したら、LLMに以下のプロンプトを送信してテストできます:
例1: 基本的な暗号化 (Enigma M3)
"Enigma M3を使用してメッセージ'TOPSECRET'を暗号化する必要があります。ローターは最速から最遅の順にIII、II、Iです。すべて位置0から開始し、リング設定は0です。リフレクター'UKWB'を使用し、プラグボードはなしです。暗号文は何ですか?"
例2: 歴史的な復号化 (Enigma I)
"この1930年のEnigma Iメッセージを復号してください。暗号文は'GCDSEAHUGWTQGRK'です。マシンの設定は、最速から最遅の順に、ローターIII、I、IIです。それぞれのリング設定は21、12、23です。初期位置は11、1、0です。リフレクターは'UKWA'です。プラグボードの交換はA/M、F/I、N/V、P/S、T/U、W/Zです。"
例3: 複雑なM4設定
"Enigma M4を使用してメッセージ'DIVE DIVE DIVE'を暗号化してください。マシンは'UKWBThin'リフレクターを使用します。ローターは[最速, 中央, 最遅, ギリシャ文字]の順で、VIII(位置2)、III(位置6)、IV(位置12)、Gamma(位置21)です。すべてのリング設定は0です。処理してください。"
テスト
包括的なテストスイートがtests/test_server.pyに含まれています。サポートされている10種類すべてのエニグマモデルについて、暗号化と復号化の可逆性をテストします。
テストを実行するには:
# Activate your virtual environment first
source .venv/bin/activate
pip install pytest
export PYTHONPATH=$PYTHONPATH:$(pwd)/src/enigmapython_mcp && pytest tests/* SSEサーバーの対話的なテスト
Model Context Protocolではツールを呼び出す前にステートフルな初期化ハンドシェイクが必要なため、curlを使用してSSEエンドポイントを手動でテストするのは非常に複雑です。
サーバーをテストする最も簡単で公式に推奨される方法は、MCP Inspectorを使用することです:
サーバーがSSEモードで実行されていることを確認します:
uv run enigmapython-mcp --transport sse --host 0.0.0.0 --port 80002つ目のターミナルでInspectorを起動します:
npx @modelcontextprotocol/inspectorブラウザでWebインターフェースが開きます(通常は
http://localhost:5173)。Transport TypeをSSEに変更します。
URLとして
http://localhost:8000/sseを入力し、Connectをクリックします。これで
encrypt_messageツールを視覚的に設定して実行できるようになります!
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.-