目录

OpenHarmony 原生 MCP 协议栈

本仓库是 OpenHarmony MCP 竞赛项目实现。项目目标不是做一个单独的 Agent Demo,而是实现一套面向 OpenHarmony 的原生 MCP 执行平面:在保持现有 MCP 调用方式兼容的前提下,补上多 Agent 协作、能力安全、上下文共享、传输快路径、OpenHarmony SystemAbility 形态接入和可复现实验证据。

项目做了什么

当前实现已经包含:

  • 原生 NativeMcpManager 执行入口:工具注册、工具调用、结果返回、审计事件和指标统一从同一公共接口输出。
  • MCP 兼容层:支持 initialize、tools/list、tools/call,并接入 stdio JSON-RPC、HTTP JSON-RPC、LangChain 风格 Agent 工具包装。
  • Capability Tuple 安全模型:绑定调用身份、过期时间、策略版本、吊销状态、委托链、风险等级和审计 ID,避免调用方伪造能力。
  • Protocol Fast Path:对高并发和大结果场景做 fast-path 执行与消融验证。
  • Context Plane:实现 schema 版本发现缓存、授权缓存、Context Delta、Shared Context Handle、Drift Guard 和安全上下文句柄路由。
  • OpenHarmony 原生接入源码形态:SystemAbility、IRemoteStub/Proxy、权限门禁、Rust FFI、BUILD.gn,以及 Linux mock IPC/ABI 全链路测试。
  • Edge Operations 端到端案例:多 Agent 监控、诊断、拒绝未授权重启、限定范围修复、审计报告生成。
  • 可复现实验证据:性能、资源受限边缘节点、兼容性、安全攻击套件、OpenHarmony 接入、Context Plane、Evidence Console 和最终提交包。

主要文档在哪里

内容 路径 用途
最终项目书 / 协议栈设计文档 docs/OPENHARMONY_NATIVE_MCP_PROTOCOL_STACK_PROJECT_BOOK.md 最核心文档,说明项目背景、架构、核心实现、性能、安全、OpenHarmony 接入和边界
完整测试报告 reports/final-test-report.md 汇总功能、性能、安全、OpenHarmony native boundary、端到端案例等测试结果
最终答辩 PPT reports/final-presentation.pptx 20 页答辩演示文稿,可由生成脚本复现
OpenHarmony 接入说明 reports/openharmony-integration-explanation.md 给评审看的 SystemAbility、接口、权限、适配器和边界说明
OpenHarmony 接入证据 reports/openharmony-integration-report.json 机器可读的 OpenHarmony service/interface/permission/profile/adapter 证据
架构图源码 reports/architecture-diagram.mmd Mermaid 架构图,可用于文档和 PPT
Edge Operations 场景说明 reports/edge-operations-scenario.md 端到端边缘节点多 Agent 案例说明
Edge Operations 机器证据 reports/edge-operations-report.json 两节点边缘场景的执行计划、步骤结果和审计证据
提交包复现说明 reports/submission-evidence.md 给评审的一键复现和证据索引
提交包 manifest reports/submission-package-manifest.json 每个提交 artifact 的存在性、大小、哈希和来源信息

实验证据在哪里

证据类型 路径
默认性能报告 reports/benchmark-report.json
默认性能原始指标 reports/benchmark-raw-metrics.json
默认性能图表数据 reports/benchmark-summary-charts.json
Prize 深度性能报告 reports/benchmark-prize-report.json
Prize 深度性能原始指标 reports/benchmark-prize-raw-metrics.json
Prize 深度性能图表数据 reports/benchmark-prize-summary-charts.json
资源受限边缘节点 profile reports/container-edge-node-profile.env
Context Plane 报告 reports/context-plane-report.json
Context Plane 原始指标 reports/context-plane-raw-metrics.json
Context Plane 图表数据 reports/context-plane-summary-charts.json
MCP 兼容性报告 reports/compatibility-report.json
安全攻击套件报告 reports/security-report.json
安全攻击原始记录 reports/security-raw-attacks.json
安全图表数据 reports/security-summary-charts.json
Evidence Console 数据 reports/evidence-console.json
Evidence Console 页面 console/web/index.html
LLM Demo 旁白计划 reports/llm-demo-plan.json

设计和过程文档在哪里

  • 产品需求:docs/PRD.md
  • 架构说明:docs/ARCHITECTURE.md
  • benchmark 和攻击计划:docs/BENCHMARK_AND_ATTACK_PLAN.md
  • 里程碑:docs/MILESTONES.md
  • 任务拆解:docs/TASKS.md
  • 架构决策记录:docs/adr/0001-target-topic-1.md 到 docs/adr/0016-delivery-triad.md

ADR 记录了项目关键选择,例如比赛方向、核心创新轴、Edge Operations Demo、MCP 兼容层、benchmark baseline、OpenHarmony 工程形态、攻击套件、Context Plane、Protocol Fast Path 和 Capability Tuple。

常用验证命令

生成所有默认证据:

scripts/generate_all_evidence.sh

生成最终提交包和 PPT:

scripts/generate_submission_package.py

校验提交包完整性:

scripts/verify_submission_package.py

运行提交包校验器的 mutation tests:

scripts/test_submission_verifier.py

运行 Rust 测试:

cargo test

运行 Prize 深度 benchmark:

scripts/generate_prize_benchmark_report.sh

运行容器化边缘节点复现:

container/edge-node/run-container.sh

生成脚本清单

scripts/generate_all_evidence.sh
scripts/generate_benchmark_report.sh
scripts/generate_prize_benchmark_report.sh
scripts/generate_edge_operations_report.sh
scripts/generate_compatibility_report.sh
scripts/generate_openharmony_report.sh
scripts/generate_context_plane_report.sh
scripts/generate_evidence_console.sh
scripts/generate_security_report.sh
scripts/generate_llm_demo_plan.sh
scripts/generate_submission_package.py
scripts/verify_submission_package.py
scripts/test_submission_verifier.py

提交说明

公开提交包包含项目书、测试报告、PPT、证据报告和校验脚本。

关于
16.0 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号