A Neural-Symbolic Architecture for Reliable Robotic Control via Model Context Protocol (MCP)
Traditional robotic AI (VLAs) suffers from Stochastic Drift: given the same environment and instruction, an LLM-based planner might output different trajectories on different runs. In production robotics, this is unacceptable.
MCP-Robot v3.0 introduces a Deterministic Execution Runtime. By synchronizing every component—from RNG seeds and floating-point precision to system clocks and sensor snapshots—we ensure that identical inputs always produce bit-identical binary motor commands.
The system is organized into seven distinct layers, each separated by strict Pydantic contracts. Data flows unidirectionally from high-level intent to low-level motor signals.
graph TD
%% Input Layer
subgraph "Environmental Context"
P[Perception Snapshot]
S[Robot State Snapshot]
end
%% Tier 1-2
subgraph "Tier 1-2: Cognition"
D[ALOHA Decomposer] --> |Subtasks| PL[ACT Planner]
end
%% Tier 3-4
subgraph "Tier 3-4: Action Synthesis"
PL --> |Action Chunks| E[Visio-Tactile Encoder]
E --> |Augmented Chunks| M[Universal Mapper]
end
%% Safety Layer (Tier 5)
subgraph "Tier 5: The Safety Chip"
M --> |JointTrajectoryChunk| V[Physics Engine]
S --> V
V -- REJECT --> AL[Emergency Halt]
V -- CERTIFY --> EX[Tier 6 Execution]
end
%% Execution (Tier 6-7)
subgraph "Tier 6-7: Physical Loop"
EX --> H[Hardware Control]
EX --> SIM[Kinematic Sim]
H & SIM --> L[Tier 7: Learning Loop]
end
%% Flows
P & S --> D
P & S --> PL
P & S --> E
| Tier | Name | Determinism Primitive | Component Responsibility |
|---|---|---|---|
| 0 | Orchestrator | StableHasher |
Generates immutable plan_id from hashes. |
| 1 | Decomposer | DeterministicRNG |
Breaks intent into semantic subgoals. |
| 2 | Planner | Seeded Latents |
Predicts chunk sequences using frozen weights. |
| 3 | Encoder | Snapshot Logic |
Appends tactile force targets based on perception. |
| 4 | Mapper | Geometric IK |
Converts world-space to joint-space (Anti-teleport). |
| 5 | Verifier | Frozen Physics |
The "Safety Chip" (ZMP, Force, Limits). |
| 6 | Adapter | Tick-Sync |
Real ROS2 Action Client or Deterministic Sim. |
| 7 | Learner | Hindsight Trace |
Relabels failures for future policy updates. |
The entire stack is built on a custom runtime found in mcp_robot/runtime/determinism.py.
To avoid ID collisions and ensure traceability, every plan and chunk is identified by its SHA-256 digest.
- Canonicalization: All Pydantic models are serialized with sorted keys and rounded floats before hashing.
- Traceability: An identical Instruction + State Snapshot will always yield the same
plan_id.
Wall-clock time is the enemy of determinism.
- Implementation: We replace
time.time()with a globalClockinterface. In simulation, the clock only advances when astep()is called. In planning, time is frozen to the moment the Snapshot was captured.
- Seeded Sampling: All internal stochastic processes (ACT latents, noise injection) use a centralized
numpy.random.default_rngseeded by theDeterminismConfig.
The Verification Engine is the most critical component. It acts as a jurisdictional gatekeeper between the AI's "Intent" and the Robot's "Actuators".
- Continuity Check: Ensures the first waypoint of any chunk is within
0.1 radiansof the current hardware state. This prevents "teleportation" jumps that cause motor surge. - Joint Limit Shield: Deterministically checks every waypoint against the
robot_profilemin/max angles. - ZMP (Zero Moment Point) Analysis:
- Computes the stability margin of the robot's center-of-mass trajectory.
- If
score < 0.4, the chunk is rejected as "Unstable" (preventing humanoid falls).
- Force Compliance: Verifies that predicted gripper force does not exceed the hardware's structural safety limits (e.g., 100N).
```python
# Tier 5: The Safety Decision
safety_report = PhysicsEngine.verify_trajectory(
target_chunk,
sim_state,
joint_limits
)
# Resulting in:
# { "valid": False, "reason": "Stability Error: ZMP Critical (0.22)" }
```
<!-- slide -->
```mermaid
graph LR
A[Planned Trajectory] --> B{Safety Chip}
B -->|ZMP < 0.4| C[REJECT]
B -->|Force > 100N| C
B -->|Continuity > 0.1| C
B -->|Within Limits| D[EXECUTE]
```
The bridge between the VLA and the physical world. It operates in two modes:
Important
SIM Mode (Deterministic Mode):
- Instantly updates the
KinematicSimulatorwith the final waypoint. - No
asyncio.sleep(prevents wall-clock drift). - Perfect for regression testing and CI/CD.
Warning
HARDWARE Mode:
- Connects to real ROS2 Action Servers (
FollowJointTrajectory). - Handles network jitter and hardware latency.
- While the decision is deterministic, the execution timing is governed by real-world physics.
We use the Honest Benchmark Suite to prove that our hardening works.
| Test | Input | Pass Condition | Result |
|---|---|---|---|
| Plan Stability | Fresh Restart | Bit-identical JSON | ✅ PASSED |
| Idempotency | Duplicate Call | Cached Result hit | ✅ PASSED |
| Hash Sensitivity | 0.0001 state change | Unique PlanID generated | ✅ PASSED |
| Category | Task | Outcome | Analysis |
|---|---|---|---|
| Pick & Place | Nominal Task | SUCCESS | 100% Success in Nominal Conditions. |
| Force Safety | "Grip with 150N" | REJECTED | Correctly blocked by Safety Chip. |
| Dynamic Stability | "Push while sprinting" | REJECTED | ZMP violation caught in simulation. |
# Clone and install dependencies
git clone https://github.com /Danielfoojunwei/MCP-ROBOT.git
pip install -e .Run the core proof tests to ensure your environmental configuration is stable:
python -m pytest tests/test_determinism.pypython mcp_robot/server.py- v1.0: Mock Pipeline (Heuristics).
- v2.0: Hardened Hardware (Real ROS2 Adapters).
- v3.0: Deterministic Production (Seeded RNG, Frozen Clock, Snapshots).
- v4.0: Whole-Body Control (WBC): Moving from joint-interpolation to real-time torque control.
- v5.0: Multi-Robot Orchestration: Deterministic coordination of fleet-wide clusters.
Developed by Danielfoojunwei for Production-Grade Robotic Autonomy.