Skip to main content
Glama
denismaggior8

enigma-python-mcp

Enigma Python MCP 서버

enigmapython 라이브러리의 기능을 LLM에 제공하여, 역사적으로 정확한 에니그마 머신 에뮬레이터를 사용하여 메시지를 암호화하고 복호화할 수 있게 해주는 MCP(모델 컨텍스트 프로토콜) 서버입니다.

Claude Desktop Integration

PyPI version Python Versions Downloads License: MIT Publish Status

이 MCP 서버는 Glama.ai에 다음 점수로 등록되어 있습니다.

enigma-python-mcp MCP server

기능

  • 모든 알려진 에니그마 머신 모델 지원: 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)을 지정하는 ReflectorConfig 객체이며, 선택적으로 회전 반사판을 위한 ring_setting (int) 및 initial_position (int | str)을 포함할 수 있습니다.

  • plugboard_pairs (dict, 선택 사항): 플러그보드 연결을 매핑하는 딕셔너리 (예: {"A": "B", "C": "D"}).

서버 실행

Python 사용

Python 3.11+가 필요합니다.

  1. PyPI에서 패키지 설치:

    pip install enigmapython-mcp

    (또는 uv가 설치되어 있다면 uvx enigmapython-mcp를 실행할 수 있습니다!)

  2. stdio를 통해 실행 (로컬 MCP 클라이언트용):

    enigmapython-mcp --transport stdio
  3. SSE를 통해 실행 (네트워크를 통해 노출):

    enigmapython-mcp --transport sse --host 0.0.0.0 --port 8000

Docker 사용

  1. 컨테이너 빌드:

    docker build -t enigmapython-mcp .
  2. stdio를 통해 실행 (기본값):

    docker run -i enigmapython-mcp
  3. SSE를 통해 실행:

    docker run -p 8000:8000 enigmapython-mcp --transport sse --host 0.0.0.0 --port 8000

클라이언트 구성 (Claude Desktop)

Claude Desktop에 원클릭으로 설치할 수 있는 두 가지 mcpb 번들을 제공합니다. GitHub 릴리스 페이지에서 원하는 번들을 다운로드하여 Claude Desktop의 확장 프로그램 메뉴로 드래그 앤 드롭하세요:

  1. enigmapython-mcp-docker.mcpb: 매우 가벼우며, 로컬 Docker 데몬을 사용하여 격리된 컨테이너에서 서버를 실행합니다. (권장)

  2. 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 서버 대화형 테스트

모델 컨텍스트 프로토콜은 도구를 호출하기 전에 상태 저장 초기화 핸드셰이크가 필요하므로, curl을 사용하여 SSE 엔드포인트를 수동으로 테스트하는 것은 매우 복잡합니다.

서버를 테스트하는 가장 쉽고 공식적으로 권장되는 방법은 MCP Inspector를 사용하는 것입니다:

  1. 서버가 SSE 모드에서 실행 중인지 확인하세요:

    uv run enigmapython-mcp --transport sse --host 0.0.0.0 --port 8000
  2. 두 번째 터미널에서 Inspector를 실행하세요:

    npx @modelcontextprotocol/inspector
  3. 브라우저에서 웹 인터페이스가 열립니다 (보통 http://localhost:5173).

  4. Transport Type을 SSE로 변경하세요.

  5. URL로 http://localhost:8000/sse를 입력하고 Connect를 클릭하세요.

  6. 이제 encrypt_message 도구를 시각적으로 구성하고 실행할 수 있습니다!

Available Tools

1 tool
encrypt_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.
ParametersJSON Schema
NameRequiredDescriptionDefault
rotorsYes
messageYes
reflectorYes
machine_modelYes
plugboard_pairsNo

TDQS

A3.6/5.0
Behavior3/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters5/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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. 1 tool updatev0.1.4
    • Changedencrypt_message1 field changed
      • changedInput schema / $defs / ReflectorConfig / properties / reflector_type / description
        Previous 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'."
  2. 1 tool updatev0.1.0
    • First observedencrypt_message

TDQS

A3.8/5.0

Scored across 1 tool

Disambiguation5/5

Only one tool exists, so there is no ambiguity between tools. The single tool's purpose is clear from its description.

Naming Consistency5/5

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.

Tool Count3/5

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.

Completeness4/5

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

ActivitySlowing
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers