# seagetch/mcp-receiver architecture

> Architecture diagram of the GitHub repository seagetch/mcp-receiver, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/seagetch/mcp-receiver
- Repository: https://github.com/seagetch/mcp-receiver

## Overview

##### Project type and purpose
- This is an open-source network proxy/receiver tool written in Python.
- Its goal is to listen for mocopi motion-tracking UDP packets on port 12351 (from the Mocopi mobile app or BVHSender) and forward them as VMC Protocol packets to a consumer on localhost:39540.

##### File structure
- Top-level files:
- LICENSE, README.md, requirements.txt
- Documentation:
- doc/Protocol.md (spec of the mocopi protocol)
- doc/mcp-format.odp (presentation of the packet format)
- Core package: mcp_receiver/
- __main__.py – module entry point (invoked by `python3 -m mcp_receiver`)
- runner.py – orchestrates startup, configures ports and modules
- receiver.py – receives and decodes incoming mocopi packets
- vmcsender.py – encodes and sends VMC Protocol packets
- dumper.py – optional packet logger/debug dumper
- dummyreceiver.py – stub for testing or alternative input
- Tests: test/test.py – validates end-to-end packet flow

##### README insights
- Highlights two external systems: mocopi mobile app (or BVHSender) and the VMC Protocol consumer.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Producers
    MocopiApp["Mocopi Mobile App"]:::external
    BVHSender["BVHSender"]:::external

    %% Core Application
    subgraph "mcp_receiver Application"
        direction TB
        Main["__main__.py"]:::core
        Runner["Runner"]:::core
        Receiver["Receiver"]:::core
        Dumper["Dumper (optional)"]:::optional
        VMC["VMC Sender"]:::core
        Dummy["Dummy Receiver (optional)"]:::optional
    end

    %% External Consumer
    VMCConsumer["VMC Protocol Consumer\n(localhost:39540)"]:::external

    %% Documentation
    subgraph "Documentation"
        ProtocolDoc["Protocol.md"]:::docs
        FormatDoc["mcp-format.odp"]:::docs
    end

    %% Project Files
    subgraph "Project Files"
        Test["test.py"]:::docs
        Requirements["requirements.txt"]:::docs
        Readme["README.md"]:::docs
        License["LICENSE"]:::docs
    end

    %% Data Flow
    MocopiApp -->|"UDP 12351"| Receiver
    BVHSender -->|"UDP 12351"| Receiver

    Main --> Runner
    Runner --> Receiver
    Runner -.-> Dummy
    Receiver -->|"packet"| Dumper
    Dumper --> VMC
    Receiver -->|"packet"| VMC
    Dummy -->|"stub packet"| VMC

    VMC -->|"VMC Protocol\n 39540"| VMCConsumer

    %% Click Events
    click Main "https://github.com/seagetch/mcp-receiver/blob/main/mcp_receiver/__main__.py"
    click Runner "https://github.com/seagetch/mcp-receiver/blob/main/mcp_receiver/runner.py"
    click Receiver "https://github.com/seagetch/mcp-receiver/blob/main/mcp_receiver/receiver.py"
    click Dumper "https://github.com/seagetch/mcp-receiver/blob/main/mcp_receiver/dumper.py"
    click VMC "https://github.com/seagetch/mcp-receiver/blob/main/mcp_receiver/vmcsender.py"
    click Dummy "https://github.com/seagetch/mcp-receiver/blob/main/mcp_receiver/dummyreceiver.py"
    click ProtocolDoc "https://github.com/seagetch/mcp-receiver/blob/main/doc/Protocol.md"
    click FormatDoc "https://github.com/seagetch/mcp-receiver/blob/main/doc/mcp-format.odp"
    click Test "https://github.com/seagetch/mcp-receiver/blob/main/test/test.py"
    click Requirements "https://github.com/seagetch/mcp-receiver/blob/main/requirements.txt"
    click Readme "https://github.com/seagetch/mcp-receiver/blob/main/README.md"
    click License "https://github.com/seagetch/mcp-receiver/tree/main/LICENSE"

    %% Styles
    classDef external fill:#BBDEFB,stroke:#333,stroke-width:1px
    classDef core fill:#C8E6C9,stroke:#333,stroke-width:1px
    classDef optional fill:#FFE0B2,stroke:#333,stroke-width:1px
    classDef docs fill:#E0E0E0,stroke:#333,stroke-width:1px
```
