pybme-mcp
pybme-mcp
一个 Model Context Protocol (MCP) 服务器,封装了 pyBME —— 使 LLM 智能体能够通过自然语言意图而非代码执行贝叶斯最大熵(BME)地统计分析。
功能概述
该服务器提供了 7 个工具、6 个资源 和 4 个提示词,构成了一个不确定性推理流水线:
ingest_external_scenario_evidence → inspect_modeling_context
→ fit_uncertainty_model → run_uncertainty_update
→ explain_uncertainty_drivers
→ compare_operator_approaches
→ design_next_observation_or_scenario工具
工具 | 用途 |
| 导入硬/软观测数据和网络拓扑 |
| 检测问题类型并推荐模型族 |
| 通过交叉验证拟合空间或网络协方差模型 |
| 在估计目标处运行 BME 预测 |
| 识别特定位置不确定性的驱动因素 |
| 比较欧几里得、图论与物理信息驱动算子 |
| 按方差缩减程度对候选传感器位置进行排序 |
支持的模型族
spatial — 欧几里得协方差(指数、高斯、球形等)
space_time — 可分离时空协方差
graph_laplacian — 网络拓扑上的图扩散核
physics_informed_network — 物理一致性网络协方差
spectral_hodge — 流网络的谱霍奇分解
Related MCP server: groundstation
安装
首先安装 pyBME(尚未发布至 PyPI):
pip install git+https://github.com/wiesnerfriedman/pybme.git然后安装 MCP 服务器:
pip install git+https://github.com/wiesnerfriedman/pybme-mcp.git或者从本地克隆安装:
git clone https://github.com/wiesnerfriedman/pybme-mcp.git
cd pybme-mcp
pip install -e ".[dev]"配置
Claude Desktop
添加到 claude_desktop_config.json:
{
"mcpServers": {
"pybme": {
"command": "pybme-mcp"
}
}
}VS Code (Copilot)
添加到 .vscode/mcp.json:
{
"servers": {
"pybme": {
"type": "stdio",
"command": "pybme-mcp"
}
}
}使用方法
配置完成后,您可以向智能体询问如下问题:
“为我的 PM2.5 观测数据拟合一个不确定性模型”
“在这个雨水管网系统上运行一次网络感知 BME 更新”
“比较欧几里得算子与图拉普拉斯算子”
“为了最大程度降低不确定性,我应该在哪里放置下一个传感器?”
请参阅 examples/mcp_agent_demo.ipynb 获取完整工具链的分步演示。
开发
git clone https://github.com/wiesnerfriedman/pybme-mcp.git
cd pybme-mcp
pip install -e ".[dev]"
pytest布局
pybme-mcp/
├── docs/
│ ├── pybme-openswmm-integration.md
│ └── v1-mcp-spec.md
├── examples/
│ └── mcp_agent_demo.ipynb
├── pyproject.toml
├── src/pybme_mcp/
│ ├── __init__.py
│ ├── __main__.py
│ ├── registry.py
│ ├── schemas.py
│ ├── serialisation.py
│ ├── server.py
│ └── services/
│ ├── catalog.py
│ ├── comparison.py
│ ├── context.py
│ ├── explanation.py
│ ├── fitting.py
│ ├── hodge.py
│ ├── ingest.py
│ ├── scenario_design.py
│ └── update.py
└── tests/
├── conftest.py
├── test_ingest.py
└── test_integration.py许可证
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Verifiable Earth ground truth for AI agents: water, hazard, ground stability, resource, with proof.
Deterministic reasoning stack for AI agents: simulate, decide & compute, plus cross-domain tools.
Agent-to-agent reasoning-as-a-service: chain-of-thought, analysis, and decision support.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables natural language interaction with the DSSAT crop model for simulation, calibration, and sensitivity analysis through LLM agents.1MIT
- AlicenseAqualityBmaintenanceEnables AI agents to query Earth observation data, satellite imagery, active fires, and weather via natural language, returning interactive maps and briefs.12MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to perform spatial analysis in ArcGIS Pro using natural language by exposing all ArcGIS Pro toolboxes as MCP tools.9MIT

MapSmithofficial
AlicenseAqualityAmaintenanceEnables AI agents to perform professional-grade geoprocessing tasks such as buffers, overlays, reprojections, and terrain analysis with deterministic tools and verifiable provenance.29396 PyPI2AGPL 3.0