io.github.JonesRobM/physbound
编码与调试by jonesrobm
物理层 Linter,用于校验 RF 链路预算、Shannon capacity 与 noise floor 等关键指标。
什么是 io.github.JonesRobM/physbound?
物理层 Linter,用于校验 RF 链路预算、Shannon capacity 与 noise floor 等关键指标。
README
Physical Layer Linter — An MCP server that validates RF and physics calculations against hard physical limits. Catches AI hallucinations in engineering workflows.
What LLMs Get Wrong
LLMs routinely hallucinate physics. PhysBound catches it:
| # | Category | LLM Hallucination | PhysBound Truth | Verdict |
|---|---|---|---|---|
| 1 | Shannon-Hartley | "20 MHz 802.11n at 15 dB SNR achieves 500 Mbps" | Shannon limit: 100.6 Mbps | CAUGHT |
| 2 | Shannon-Hartley | "100 MHz 5G channel at 20 dB SNR delivers 2 Gbps" | Shannon limit: 665.8 Mbps | CAUGHT |
| 3 | Antenna Aperture | "30 cm dish at 1 GHz provides 45 dBi gain" | Aperture limit: 7.4 dBi | CAUGHT |
| 4 | Thermal Noise | "Noise floor of -180 dBm/Hz at room temperature" | Actual: -174.0 dBm/Hz at 290K | CAUGHT |
| 5 | Link Budget | "Wi-Fi at 2.4 GHz reaches 10 km at -40 dBm" | Actual RX power: -94.1 dBm | CAUGHT |
| 6 | Link Budget | "1W to GEO with 0 dBi antennas at -80 dBm" | Actual RX power: -175.1 dBm | CAUGHT |
| 7 | Link Budget | "Bluetooth reaches 1 km at -60 dBm" | Actual RX power: -100.1 dBm | CAUGHT |
| 8 | Shannon-Hartley | "10 MHz LTE at 10 dB SNR supports 1 Gbps" | Shannon limit: 34.6 Mbps | CAUGHT |
| 9 | Noise Cascade | "Stage order doesn't affect system NF" | LNA first: 1.66 dB vs mixer first: 8.03 dB | CAUGHT |
| 10 | Antenna Aperture | "10 cm patch at 900 MHz provides 20 dBi" | Aperture limit: -3.1 dBi | CAUGHT |
| 11 | Radar Range | "Doubling TX power doubles radar range" | Range increases by 1.189x (2^(1/4)), not 2x | CAUGHT |
| 12 | Radar Range | "Drone (0.01 m^2 RCS) at 200 km by 1 kW X-band" | Max range: 2.7 km | CAUGHT |
Generated automatically by pytest tests/test_marketing.py -s
Quick Start
Install
pip install physbound
MCP Client Configuration
Add PhysBound to any MCP-compatible client. For example, in Claude Desktop (claude_desktop_config.json), Cursor, or Windsurf:
{
"mcpServers": {
"physbound": {
"command": "uvx",
"args": ["physbound"]
}
}
}
First run:
uvxdownloads ~60 MB of dependencies (scipy, numpy) on first launch. Runuvx physboundonce in your terminal to pre-cache them — subsequent starts will be instant.
Your AI assistant now has access to physics-validated RF calculations.
Tools
rf_link_budget
Computes a full RF link budget using the Friis transmission equation. Validates antenna gains against aperture limits.
Example: "What's the received power for a 2.4 GHz link at 100 m with 20 dBm TX, 10 dBi TX gain, 3 dBi RX gain?"
Returns: FSPL, received power, wavelength, and optional aperture limit checks. Rejects antenna gains that violate G_max = eta * (pi * D / lambda)^2.
shannon_hartley
Computes Shannon-Hartley channel capacity C = B * log2(1 + SNR) and validates throughput claims.
Example: "Can a 20 MHz channel with 15 dB SNR support 500 Mbps?"
Returns: Theoretical capacity, spectral efficiency, and whether the claim is physically possible. Flags violations with the exact percentage by which the claim exceeds the Shannon limit.
noise_floor
Computes thermal noise power N = k_B * T * B, cascades noise figures through multi-stage receivers using the Friis noise formula, and calculates receiver sensitivity.
Example: "What's the noise floor for a 1 MHz receiver at 290K with a two-stage LNA chain?"
Returns: Thermal noise in dBm and watts, cascaded noise figure, system noise temperature, and receiver sensitivity.
radar_range
Computes the monostatic radar range equation R_max = [P_t G^2 lambda^2 sigma / ((4pi)^3 S_min L)]^(1/4) and validates detection range claims.
Example: "Can a 1 kW X-band radar with 30 dBi gain detect a 0.01 m^2 drone at 200 km?"
Returns: Maximum detection range, minimum detectable signal, wavelength, and intermediate values. Catches the common fourth-root fallacy where doubling power is incorrectly assumed to double range.
Physics Guarantees
Every calculation is validated against hard physical limits:
- Speed of light:
c = 299,792,458 m/s— no exceptions - Thermal noise floor:
N = -174 dBm/Hzat 290K — the IEEE standard reference - Shannon limit:
C = B * log2(1 + SNR)— no throughput claim exceeds this - Aperture limit:
G_max = eta * (pi * D / lambda)^2— antenna gain is bounded by physics - Radar range equation:
R_max = [P_t G^2 lambda^2 sigma / ((4pi)^3 S_min)]^(1/4)— range obeys the fourth-root law
Violations return structured PhysicalViolationError responses with LaTeX explanations, not silent failures.
Examples
See PhysBound catching hallucinations in real time:
- Catching Hallucinations — walkthrough of four real LLM failure modes with full JSON responses
- Interactive Demo Notebook — hands-on Jupyter notebook calling the physics engines directly
Development
# Clone and install
git clone https://github.com/JonesRobM/physbound.git
cd physbound
uv sync --all-extras
# Run tests
uv run pytest tests/ -v
# Print hallucination delta table
uv run pytest tests/test_marketing.py -s
# Start MCP server locally
uv run physbound
Why PhysBound?
AI coding assistants are increasingly used in RF engineering, telecommunications, and signal processing workflows. But LLMs have no intrinsic understanding of physics. They generate plausible-sounding numbers that can violate fundamental laws like Shannon-Hartley, thermodynamic noise limits, and antenna aperture bounds.
PhysBound acts as a physics guardrail for any MCP-compatible AI assistant. Every calculation is checked against CODATA physical constants via SciPy, with dimensional analysis enforced through Pint. Violations return structured errors with LaTeX explanations, not silent failures.
Use cases
- RF system design review — validate link budgets, receiver sensitivity, and noise cascades
- Telecom proposal vetting — catch impossible throughput claims before they reach a customer
- Educational tools — teach Shannon-Hartley, Friis transmission, and thermal noise with verified calculations
- CI/CD for physics — integrate as a validation step in engineering pipelines
Support
If PhysBound is useful in your work, consider buying me a coffee.
License
MIT License. See LICENSE.
Related
- Model Context Protocol — the open standard for AI tool integration
- MCP Server Registry — official directory of MCP servers
- FastMCP — Python framework for building MCP servers
常见问题
io.github.JonesRobM/physbound 是什么?
物理层 Linter,用于校验 RF 链路预算、Shannon capacity 与 noise floor 等关键指标。
相关 Skills
网页构建器
by anthropics
面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。
✎ 在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。
前端设计
by anthropics
面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。
✎ 想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。
网页应用测试
by anthropics
用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。
✎ 借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。
相关 MCP Server
GitHub
编辑精选by GitHub
GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。
✎ 这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。
Context7 文档查询
编辑精选by Context7
Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。
✎ 它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。
by tldraw
tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。
✎ 这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。