Principia Robotica
Integrates with ROS2 middleware to bridge AI commands to physical robots, providing real-time CBF-QP safety filtering and sensor feedback.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Principia RoboticaFilter velocity command v=0.8, w=0.2 through CBF safety layer"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
โก PRINCIPIA ROBOTICA
Lex Prima: Safety is not a feature. It is the law.
World-first unified MCP gateway + Control Barrier Function (CBF-QP) safety engine for agentic robotics.
Give Claude, GPT-4o, Gemini, and any LLM mathematically proven safe control over physical robots via ROS2.
Created: July 29, 2026 ยท Author: Abdullah Bin Zafar ยท UET Lahore, Pakistan
"What Newton's Principia was to classical mechanics, this is to the laws governing AI-controlled machines."
๐ Why This Exists (The Problem)
Every AI agent โ Claude, GPT-4o, Gemini โ can be told to drive a robot. But none of them can mathematically guarantee safety. They can crash, over-accelerate, collide, or violate physical limits. There was no open-source bridge between LLM intelligence and control-theoretic safety.
Until now.
Related MCP server: Nonead Universal-Robots MCP Server
๐ฌ What This Is (The World-First Innovation)
Existing World | After Principia Robotica |
AI sends | AI's command is intercepted by CBF-QP solver. Safe command issued. |
No formal safety guarantee | โtโฅ0: h(x(t)) โฅ 0 โ mathematically proven forward invariance |
Safety = hope + testing | Safety = formal theorem (Ames et al., proven 2017) |
MCP server = passive sensor reader | MCP server = active safety enforcer |
Pre-simulation not available | Certify trajectory BEFORE hardware moves |
๐ The Mathematics (The Core Law)
The CBF-QP Safety Filter solves this problem in real-time (< 1ms in Python):
$$u^* = \arg\min_{u \in \mathcal{U}} \frac{1}{2}|u - u_{\text{AI}}|^2$$
$$\text{subject to:} \quad L_f h(x) + L_g h(x) u \geq -\alpha(h(x))$$
Where:
$u_{\text{AI}}$ = command from AI agent (Claude, GPT-4o, Gemini...)
$h(x)$ = Control Barrier Function (encodes obstacle avoidance)
$L_f h$, $L_g h$ = Lie derivatives along robot dynamics
$\alpha: \mathbb{R} \to \mathbb{R}$ = class-K function (typically $\alpha(h) = \gamma h$)
Result: The robot receives the closest safe command to what the AI wanted. Formally proven optimal by KKT conditions.
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ AI Agent (Claude / GPT-4o / Gemini) โ
โ Tools: cbf_filter_velocity, โ
โ predict_safe_trajectory, โ
โ lyapunov_stability_check, ... โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MCP stdio (JSON-RPC 2.0)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PRINCIPIA ROBOTICA MCP SERVER โ
โ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ CBF-QP Solver โ โ Kinematic World โ โ Lyapunov โ โ
โ โ (CVXPY + OSQP) โ โ Model (1000Hz) โ โ Stability โ โ
โ โ < 1ms Python โ โ Trajectory Sim โ โ Analyzer โ โ
โ โโโโโโโโโโฌโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโโ โโโโโโโฌโโโโโโโ โ
โ โโโโโโโโโโโโโโโโโโโโโโฌโโ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ROS2 Bridge (optional)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ROS2 Middleware โ /cmd_vel_raw โ [CBF] โ /cmd_vel โ
โ โ /odom (live state) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PHYSICAL ROBOT (TurtleBot4 / Spot / Custom) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ๐จ Interactive Web Visualizer Dashboard (1-Second Demo)
Launch the 60 FPS live HTML5 Canvas + Web GL simulator in your browser with a single command:
python -m principia.server --uiLive Obstacle Field: Drag and drop circular obstacles in real-time.
AI Command Interceptor: Adjust AI linear/angular velocity sliders to observe real-time CBF-QP minimal perturbation filtering.
Multi-Mode Support: Unicycle differential drive, Quadrotor 2D altitude floor, Swarm fleet inter-robot collision check, and Dynamic moving obstacles.
Visual Telemetry: Real-time $h(x)$ safety gauge, Lyapunov energy $V(x)$ plot, and predicted trajectory path.
๐ ๏ธ 1-Second Installation & Setup
git clone https://github.com/EngineerAbdullahBinZafar/principia-robotica
cd principia-robotica
pip install -e .Verify everything works instantly:
python -m principia.server --doctorโก Quickstart (3 Commands)
1. Run the MCP server:
python -m principia.server2. Test the CBF filter directly in Python:
import numpy as np
from principia.cbf_engine import (
DifferentialDriveModel, CircularObstacleCBF, CBFQPSafetyFilter
)
robot = DifferentialDriveModel()
obstacle = CircularObstacleCBF(obstacle_x=2.0, obstacle_y=0.0, obstacle_radius=0.5)
safety_filter = CBFQPSafetyFilter(
robot=robot,
cbfs=[obstacle],
u_min=np.array([-0.5, -2.5]),
u_max=np.array([1.5, 2.5]),
)
# Robot at (1.2, 0) heading toward obstacle at (2.0, 0)
x = np.array([1.2, 0.0, 0.0])
u_ai = np.array([1.5, 0.0]) # AI wants full speed ahead
result = safety_filter.solve(x, u_ai)
print(f"AI proposed: v={u_ai[0]:.2f} m/s")
print(f"Safe command: v={result['u_safe'][0]:.2f} m/s")
print(f"Was modified: {result['was_modified']}")
print(f"Solve time: {result['solve_time_ms']:.2f} ms")3. Add to your AI client (Claude Desktop / Cursor):
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"principia-robotica": {
"command": "python",
"args": ["-m", "principia.server"],
"cwd": "/path/to/principia-robotica"
}
}
}๐ง MCP Tools (13 Total)
Tool | Type | Description |
| ๐ด WORLD-FIRST | Real-time CBF-QP safety filter for velocity commands |
| ๐ด WORLD-FIRST | Pre-simulate + certify trajectory before hardware moves |
| ๐ด WORLD-FIRST | Real-time Lyapunov stability verification |
| ๐ด WORLD-FIRST | CBF altitude safety for quadrotors |
| ๐ด WORLD-FIRST | Formal KKT proof of minimum-norm safety correction |
| ๐ด WORLD-FIRST | Unified Control Lyapunov + Control Barrier QP solver |
| ๐ด WORLD-FIRST | Multi-robot swarm inter-agent collision & barrier check |
| ๐ด WORLD-FIRST | CBF safety filter for dynamic moving obstacles |
| ๐ด WORLD-FIRST | ASCII radar safety map of surrounding obstacle space |
| ๐ด WORLD-FIRST | Parallel batch CBF velocity filter for multi-robot fleets |
| โ | Full safety audit of current robot state |
| โ | Server status and capability report |
| โ | QP solver performance benchmark |
๐งฌ File Structure
principia-robotica/
โโโ principia/
โ โโโ __init__.py # Package metadata
โ โโโ server.py # MCP JSON-RPC 2.0 server (entry point)
โ โโโ cbf_engine.py # CBF-QP solver + robot models
โ โโโ world_model.py # Kinematic trajectory predictor + Lyapunov
โ โโโ tools.py # MCP tool handler functions
โ โโโ ros2_bridge.py # ROS2 live integration (optional)
โ โโโ theory_and_proofs.py # Complete mathematical derivations
โโโ tests/
โ โโโ test_principia.py # Full test suite
โโโ docs/
โ โโโ THEORY.md # LaTeX-formatted mathematical proofs
โโโ mcp_config.json # MCP client configuration template
โโโ pyproject.toml # Package metadata + build config
โโโ LICENSE # MIT + attribution clause
โโโ README.md # This file๐ Performance Benchmarks
Operation | Time | Frequency |
CBF margin evaluation | < 0.01 ms | > 100,000 Hz |
Early exit (safe command) | < 0.05 ms | > 20,000 Hz |
CBF-QP solve (CVXPY/OSQP) | < 2 ms | > 500 Hz |
Trajectory pre-simulation (3s horizon) | < 5 ms | > 200 Hz |
Lyapunov check | < 0.1 ms | > 10,000 Hz |
Real-time control loops run at 50โ200 Hz. This engine operates at > 500 Hz. โ
๐ Mathematical References
Ames, A.D., Xu, X., Grizzle, J.W., Tabuada, P. (2017). Control barrier function based quadratic programs for safety critical systems. IEEE Transactions on Automatic Control, 62(8), 3861โ3876.
Ames, A.D., Coogan, S., Egerstedt, M., et al. (2019). Control barrier functions: Theory and applications. European Control Conference.
Zafar, A.B. (2026). Principia Robotica: World-first unified MCP+CBF-QP agentic safety engine. GitHub. https://github.com/EngineerAbdullahBinZafar/principia-robotica
๐ค Author
Abdullah Bin Zafar
UET Lahore, Pakistan
GitHub: @EngineerAbdullahBinZafar
If this helped you, please โญ the repo. It costs you nothing and means everything.
ยฉ 2026 Abdullah Bin Zafar โ MIT License
All derivative works must attribute the original author.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseCqualityCmaintenanceAn intelligent middleware system that enables natural language interactive control of Universal Robots collaborative robots, allowing users to connect to and control industrial robots through voice/text commands with MCP-compatible LLMs.Last updated397
- FlicenseCqualityCmaintenanceEnables natural language control of Universal Robots cobots through LLM integration, supporting real-time motion commands, data collection, multi-robot coordination, and URScript generation without traditional teach pendant programming.Last updated397
- AlicenseAqualityBmaintenanceUniversal governance layer for AI agents โ MCP-native, fail-closed, LNN interpretability. Governed receipts, IPFS audit proofs, and rollback for any agent in any framework.Last updated3231Apache 2.0
- AlicenseAqualityBmaintenanceMCP server for controlling the Noetix Bumi humanoid robot via ROS 2, with support for autonomous mission planning using LLMs and computer vision.Last updated24MIT
Related MCP Connectors
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
Coordinate multiple AI agents over MCP: atomic claims, leases, shared ledger, handoffs, tasks.
Phone, SMS & email for AI agents โ one remote MCP endpoint, OAuth login, zero install.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/EngineerAbdullahBinZafar/principia-robotica'
If you have feedback or need assistance with the MCP directory API, please join our Discord server