py-canoe
Enables generation of pytest test code for CANoe automation, allowing integration with the pytest testing framework.
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., "@py-canoeopen configuration and start measurement"
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.
为什么是 Agent2Canoe
传统 CANoe 自动化解决了“脚本如何调用工具”,Agent2Canoe 进一步解决“AI 如何理解工程、约束操作并证明结果”。
Related MCP server: TestOps MCP Server
当前开发线能做什么
能力域 | 已集成能力 | 可用入口 |
CANoe 会话 | 打开/附着配置、启动/停止测量、恢复与退出 | Python · REST · MCP |
工程能力发现 | 版本 provider、分区探针、网络、信号、变量、诊断、测试与降级证据 | REST · MCP |
网络管理 | 事务预览、快照冲突检测、批量增删、回读验证与失败回滚 | Python · REST · MCP |
测试结果统计 | 用例快照、通过/失败/其他数量、通过率、报告路径 | Python |
AI 安全编排 | 计划预览、短时单次令牌、幂等重试、持久化审计与恢复检查点 | REST · MCP |
身份与权限 | API Key 摘要、mTLS、五级角色权限、签发者/执行者审计 | REST · MCP |
硬件映射审计 | 检查 Windows、位宽、XL Driver DLL 和开放阻塞项 | Python · REST · MCP |
硬件安全边界
v0.2.0 的物理硬件通道写映射仍保持关闭。该能力依赖可审计的 Vector XL Driver SDK 来源、ABI/位宽验证以及真实 VN 设备回归;当前版本只提供只读前提审计,不打包第三方二进制。
AI 执行闭环
AI 不应直接把一句自然语言变成不可见的 COM 调用。Agent2Canoe 将工作拆成可检查的步骤:
读取
canoe_status,确认会话与测量状态。调用
describe_agent_capabilities,了解接口、约束和确认策略。调用
discover_capabilities,发现当前工程真正存在的对象。受约束命令使用
plan_task;自由工程语言读取get_planning_contract后通过plan_model_output提交受 Schema 约束的候选。用户确认带副作用的步骤;调用
confirm_plan_steps获取参数绑定令牌。将步骤 ID 与短时单次令牌传给
execute_plan。根据结构化返回值复核实际状态、统计与证据。
快速开始
1. 准备环境
Agent2Canoe 运行于 Windows。真实自动化需要本机已安装并获得许可的 Vector CANoe; 没有 CANoe 时仍可使用 Mock 后端开发和验证 AI 工作流。
git clone https://github.com/suzike/Agent2Canoe.git
cd Agent2Canoe
uv sync --all-extras2. 用 Python 控制 CANoe
from agent2canoe import Agent2Canoe
canoe = Agent2Canoe()
canoe.open(r"C:\work\demo.cfg")
canoe.start_measurement()
for network in canoe.list_networks():
print(network)
canoe.stop_measurement()3. 不连接 CANoe 先验证
# 查看命令行入口
uv run agent2canoe --version
# 启动 Mock REST 服务
uv run agent2canoe-api --mock --port 8765
# 启动 Mock MCP 服务
uv run agent2canoe-mcp --mock --principal codex-local --roles viewer,operator,approverAI / MCP 接入
Claude Code、Codex 或其他支持 MCP 的客户端可通过 stdio 启动 Agent2Canoe:
{
"mcpServers": {
"Agent2Canoe": {
"command": "uv",
"args": [
"--directory",
"C:\\path\\to\\Agent2Canoe",
"run",
"agent2canoe-mcp",
"--principal",
"codex-workbench",
"--roles",
"viewer,operator,approver"
]
}
}
}MCP 工具一览
工具组 | 代表工具 | 用途 |
状态与发现 |
| 建立真实工程上下文 |
计划契约 |
| 约束 LLM 输出并绑定真实能力快照 |
计划与执行 |
| 预览、确认并执行确定性计划 |
确认授权 |
| 为已批准的精确参数签发短时单次令牌 |
审计与恢复 |
| 查询脱敏证据,先预览再恢复会话 |
网络事务 |
| 预览差异,确认后批量修改、回读并在失败时回滚 |
兼容网络操作 |
| 单项操作也经事务内核执行 |
工程操作 | 信号、系统变量、诊断、测试相关工具 | 驱动具体 CANoe 工作 |
硬件审计 |
| 只读检查硬件映射开放前提 |
完整配置、确认语义和调用示例参见 AI 智能体集成指南。
REST API
uv run agent2canoe-api --mock --port 8765方法 | 路径 | 用途 |
|
| 返回 AI 能力、约束与接口清单 |
|
| 返回当前主体、角色、权限与认证方式 |
|
| 发现当前 CANoe 工程对象 |
|
| 返回能力指纹和严格 LLM 输出 Schema |
|
| 由自然语言或结构化任务生成计划 |
|
| 校验 LLM 候选并生成不可绕过安全策略的计划 |
|
| 为一个已批准的直接操作签发令牌 |
|
| 为选定计划步骤签发令牌 |
|
| 在确认策略约束下执行计划 |
|
| 按游标、类型或计划查询持久化脱敏审计 |
|
| 查询、预览或确认执行恢复检查点 |
|
| 网络管理 |
|
| 返回写前快照、差异和确认参数 |
|
| 校验快照后提交、回读并按需回滚 |
|
| 只读硬件映射前提审计 |
直接写操作缺少有效令牌时返回 HTTP 428。令牌绑定运行时会话、动作、参数哈希和
有效期,且只能使用一次;详细协议见
短时确认令牌。
REST 可启用 API Key 摘要认证和 mTLS,MCP stdio 可指定进程主体与最小角色;
完整配置见
身份认证、角色权限与 mTLS。
REST 与 MCP 命令行入口默认把审计、计划、幂等结果和检查点保存到本地 SQLite;
可选 JSONL 镜像及恢复流程见
持久化审计、幂等与恢复。
多网络变更应使用预览与提交两阶段接口;完整协议见
可验证网络事务。
版本识别、兼容状态和分区探针语义见
CANoe 版本兼容与能力探针。
自由自然语言的两阶段 Schema、能力指纹和 Provider 接口见
LLM 结构化规划适配器。
项目结构
Agent2Canoe/
├─ src/
│ ├─ agent2canoe/ # 新品牌公共入口
│ └─ py_canoe/ # CANoe 实现与兼容层
│ └─ automation/ # 发现、计划、安全、REST、MCP、硬件审计
├─ tests/ # 单元、Mock 与自动化接口测试
├─ integration_test/ # 需真实 CANoe 许可的集成测试
├─ docs/ # 指南、审计与 API 文档
└─ demo/ # 示例工程与脚本v0.2.0 的首选导入路径是 agent2canoe。底层 py_canoe 暂作为兼容层保留,
已有脚本可渐进迁移;新的 CLI、发布包、文档和 MCP 标识统一使用 Agent2Canoe。
开发与质量门禁
uv run ruff check src/agent2canoe src/py_canoe/automation tests
uv run pytest -q
uv build
uv run mkdocs build --strict真实 CANoe 集成测试不会默认执行,需显式设置:
$env:AGENT2CANOE_RUN_INTEGRATION = "1"
uv run pytest integration_test -m integration当前基线 | 结果 |
默认测试套件 | 334 passed · 27 skipped |
Python 3.10 / 3.14 自动化子集 | 各 85 passed |
文档严格构建 | 通过 |
Wheel 隔离安装与导入 | 通过 |
以上为
0.3.0.dev0本地开发线结果;最新状态以 GitHub Actions 为准。
真实 CANoe 12.0.75 已通过 MCP 打开 Vector Easy.cfg,发现 19 项能力(含 2 个
网络、1 个数据库和 4 个信号),并完成测量启动、Running 回读、测量停止和
Stopped 回读。Codex/Claude Code 仍需分别注册 Agent2Canoe MCP 并重启客户端,
注册前不会在其工具列表中出现。
版本路线
版本 | 主题 | 状态 |
| 本地工程基线、基础自动化与中文文档 | ✅ 已完成 |
| Agent2Canoe 品牌、测试统计、网络管理、AI 发现与 MCP | ✅ 已发布 |
| LLM 结构化规划、确认令牌、审计、认证授权与网络事务 | 🚧 开发中 |
| 硬件实验台验证、版本适配与工程模板 | 🧭 规划中 |
进一步的风险、技术债与能力增强建议见 v0.2.0 工程审计 和 硬件通道映射独立审计。
文档导航
许可证
Agent2Canoe 采用 MIT License。Vector、CANoe 及相关产品名称归其各自权利人所有; 本项目不随包分发 CANoe、Vector SDK 或驱动二进制文件。
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
- Alicense-qualityCmaintenanceMCP server for analyzing ASAM MDF measurement data files, enabling AI assistants to access and analyze automotive and industrial measurement data.Last updated3MIT
- AlicenseAqualityCmaintenanceAn MCP server that connects AI agents to TestOps, enabling test case management, launches, defects, and analytics through natural language.Last updated48213MIT
- Alicense-qualityBmaintenanceMCP server for Raspberry Pi peripheral bus access, enabling AI agents to interact with CAN, I2C, SPI, UART, and GPIO directly through natural language.Last updated1MIT
- Flicense-qualityAmaintenanceAn MCP server that gives an AI agent read and write access to a live SysML v2 model through the vendor-neutral OMG SysML v2 REST API.Last updated
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server for AI dialogue using various LLM models via AceDataCloud
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/suzike/py-canoe'
If you have feedback or need assistance with the MCP directory API, please join our Discord server