Architecture
Component Overview
┌─────────────────────────────────────────────────────────┐
│ AI Assistant / MCP Client │
└─────────────────────────┬───────────────────────────────┘
│ MCP protocol
┌─────────────────────────▼───────────────────────────────┐
│ MCP Server │
└─────────────────────────┬───────────────────────────────┘
│
┌─────────────────────────▼───────────────────────────────┐
│ ActionAdapter │
│ ┌──────────────────┐ ┌──────────────────────────┐ │
│ │ ActionRegistry │ │ ActionDispatcher │ │
│ │ (Rust/PyO3) │ │ (Rust/PyO3) │ │
│ └──────────────────┘ └──────────────────────────┘ │
│ ▲ │
│ │ registers │
│ ┌────────────┴─────────────────────────────────────┐ │
│ │ SkillManager │ │
│ │ ┌─────────────────┐ ┌────────────────────────┐ │ │
│ │ │ SkillScanner │ │ SkillWatcher (FSEvents)│ │ │
│ │ └─────────────────┘ └────────────────────────┘ │ │
│ └──────────────────────────────────────────────────┘ │
└─────────────────────────┬───────────────────────────────┘
│
┌─────────────────┼─────────────────┐
│ │ │
RPyC Transport IPC Transport HTTP Transport
│ │ │
DCC Application DCC Application REST API
(Maya/Houdini/ (Rust plugin) (Unreal/Unity)
Blender)Package Layout
src/dcc_mcp_ipc/
├── __init__.py # Lazy-import public API (37 exports)
├── action_adapter.py # ActionAdapter + get_action_adapter()
├── adapter/ # DCCAdapter, ApplicationAdapter
├── client/ # BaseDCCClient, ConnectionPool, AsyncDCCClient
├── server/ # DCCServer, BaseRPyCService, factories
├── transport/ # Transport factory + RPyC/HTTP/WS/IPC impl.
├── discovery/ # ServiceDiscoveryFactory, ZeroConf, file-based
├── skills/ # SkillManager, SkillScanner
├── scene/ # Scene interface (RPyC + HTTP)
├── snapshot/ # Snapshot interface (RPyC + HTTP)
├── application/ # ApplicationAdapter/Service/Client
├── testing/ # MockDCCService
└── utils/ # Errors, DI, decorators, rpyc_utilsLayers
1. Action Layer (action_adapter.py)
The ActionAdapter is the central registry for callable operations:
- Wraps
ActionRegistry(Rust) for storing handler metadata - Wraps
ActionDispatcher(Rust) for dispatching calls with JSON-serialised parameters - Factory function
get_action_adapter(name)returns a cached adapter per DCC name ActionResultModel(fromdcc-mcp-core) is the uniform return type
2. Skills Layer (skills/)
SkillManager automates action registration from filesystem:
SkillScannerwalks directories looking forSKILL.mdfilesSkillWatcheruses OS filesystem events (debounced) to detect changes- Each skill corresponds to a
run.pyscript executed with injected parameters - Hot-reload: file changes trigger re-scan and re-registration without DCC restart
3. Transport Layer (transport/)
| Transport | Protocol | Target DCCs |
|---|---|---|
RpycTransport | RPyC (TCP) | Maya, Houdini, Blender, 3ds Max, Nuke |
IpcClientTransport / IpcServerTransport | Rust FramedChannel (named pipe / Unix socket) | Rust-based DCC plugins |
HttpTransport | REST over HTTP | Unreal Engine, Unity |
WebSocketTransport | WebSocket | Any WebSocket-capable DCC |
The TransportFactory resolves the correct transport from a protocol string.
4. Discovery Layer (discovery/)
ServiceDiscoveryFactory selects a strategy:
- ZeroConf (
ZeroConfDiscoveryStrategy): mDNS/DNS-SD — requireszeroconfextra - File-based (
FileDiscoveryStrategy): JSON registry file atget_config_dir()— cross-platform fallback
ServiceRegistry holds discovered ServiceInfo objects (DCC name, host, port, metadata).
5. Server Layer (server/)
DCCServer: owns the RPyCThreadedServer, manages start/stop lifecycleBaseRPyCService: abstract base for all RPyC servicesDCCRPyCService: concrete service with standardexposed_*API- Factory functions:
create_service_factory,create_shared_service_instance,create_raw_threaded_server - Lifecycle helpers:
start_server,stop_server,is_server_running
6. Client Layer (client/)
BaseDCCClient: connects to a named DCC server via auto-discovery or explicit host/portConnectionPool: manages a pool ofBaseDCCClientconnectionsClientRegistry: global registry of all named clientsAsyncDCCClient/AsyncBaseClient: asyncio variants for non-blocking operations
7. Adapter Layer (adapter/)
DCCAdapter: abstract base — subclass and implement_initialize_client()for DCC-specific client setupApplicationAdapter: generic app adapter for non-DCC use casesget_adapter(name)factory — returns cached adapter instance
Data Flow: Action Dispatch
MCP Tool Call ("create_sphere", {radius: 2.0})
│
▼
ActionAdapter.call_action("create_sphere", radius=2.0)
│
▼
ActionDispatcher.dispatch("create_sphere", json_params) [Rust]
│
▼
Registered handler function:
create_sphere(radius=2.0)
│
▼
ActionResultModel(success=True, message="...", context={...}) [Rust]
│
▼
Result returned to MCP client