This project targets Problem 1: ubiquitous operating-system-native MCP protocol stack design.
The competition asks for an MCP protocol stack integrated into an operating system kernel or user-space service layer, reducing middleware overhead, improving Agent communication efficiency, and adding built-in security.
Project Summary
oh-native-mcp is a runnable user-space service-layer prototype for an OpenHarmony-native MCP transport. It keeps MCP’s JSON-RPC method semantics while replacing verbose framework-side request envelopes with a compact native frame that provides:
JSON-RPC compatible MCP request handling for ping, initialize, tools/list, native tools/schema, and tools/call.
MCP compatibility smoke coverage for structured tool output and method-not-found behavior.
Context digest cache to avoid retransmitting repeated Agent context.
Signed capability policy, audit events, taint flow, and object-handle data plane for large tool results.
Deterministic native MCP capsule manifests that bind tool schema, native-frame ABI, capability policy, SBOM fields, and HMAC-verifiable handoff metadata.
mcpcc capsule package compiler that emits deterministic .mcap directories with signed package index, manifest, policy, native ABI, SPDX SBOM, and typed Python/C++/TypeScript stubs.
Schema-heavy mini-manifest discovery path where native Agent runtimes route with schema hashes and compact argument summaries instead of repeating full JSON Schema catalogs.
Active tool router exposed through native tools/route, ranking candidates by intent, agent role, permission cost, observed latency, schema complexity, and data-plane hints before full schema fetch.
Multi-Agent collaboration scenario where four edge Agents run tools/route -> tools/schema -> signed native tools/call, covering route planning, sensor object handles, health monitoring, and confirmed high-risk actuation.
Manifest-gated host capsule runtime that verifies signed metadata, validates schema/policy, launches a bounded subprocess worker, records audit events, and enforces timeout kill.
Host capsule sandbox profile with minimal inherited environment, isolated temporary working directory, and auditable boundary metadata.
WASI-style capsule permission profile handoff that maps signed manifests to reviewable sandbox allowlists and rejects ambient-authority or filesystem-write preopens.
Two-process host data-plane daemon/client where the client writes payload bytes into a shared mmap arena and the daemon receives only offset/size/checksum control records.
Multi-slot two-process data-plane stress check with 8 concurrent client workers and guard checks for bad checksums, negative offsets, out-of-bounds ranges, unsupported operations, and zero-sized payloads.
Multi-level Agent concurrency matrix that sweeps native MCP calls from 1 to 32 workers and records throughput, p95 worker latency, byte reduction, and errors.
OpenHarmony C++ data-plane handoff now includes source-level control-record guard validation for offset, size, operation, checksum, and registered slot matching.
OpenHarmony C++ control-ring handoff for ordered data-plane control records with sequence, overflow, and malformed-record guards.
OpenHarmony C++ sandbox-profile handoff for capsule permission profiles, including ambient-authority, filesystem-write preopen, sandbox-env, and high-risk confirmation guards.
PR-ready patch apply/rollback verifier that checks the candidate OpenHarmony patch with git apply --check --whitespace=error, applies it in a temporary target tree, verifies all applied file hashes, then verifies and executes git apply -R --whitespace=error.
OpenHarmony port bundle that packages the candidate patch, target-file snapshot, patch manifest, and apply/rollback helpers for reviewer handoff.
Self-contained interactive reviewer dashboard with validation-gate search/filtering, metric bars, evidence matrix, risk boundaries, and a dashboard contract check.
Official submission audit that verifies local CCF deliverables: selected Problem 1, design docs, source code, testing evidence, PPT, 5-minute-limit demo video, package size limits, and GitLink/platform manual-action boundaries.
Local Git history audit that exports recent commits, HEAD, branch, commit count, and worktree status into machine-readable and reviewer-readable evidence.
Verified GitLink release handoff that creates a local git bundle, verifies it with git bundle verify, clones it back, checks HEAD/commit-count parity, and records the remaining account-only upload steps.
Multi-scenario performance matrix covering four repeated-context edge-link workloads.
Deterministic protocol fuzz corpus covering malformed native frames, schema-registry errors, JSON-RPC negative paths, and policy denials.
This is not an OpenHarmony kernel patch yet. It is a complete host-runnable prototype and porting design for the OpenHarmony user-space service layer.
This runs full verification, regenerates the PPT and MP4 from current logs, refreshes dashboard/showcase assets, creates a timestamped package, audits zip contents, reruns competition readiness, and writes:
docs/showcase_pipeline.md
docs/showcase_pipeline_python.md
docs/competitor_alignment_audit.md
docs/package_repro_check.md
docs/active_tool_router.md
docs/agent_collaboration_scenario.md
docs/dashboard_contract_check.md
docs/gitlink_release_handoff.md
docs/reviewer_assets_check.md
logs/showcase_pipeline.json
logs/showcase_pipeline_python.json
logs/competitor_alignment_audit.json
logs/package_repro_check.json
logs/active_router_check.json
logs/agent_collaboration_scenario.json
logs/dashboard_contract_check.json
logs/gitlink_release_bundle.json
logs/reviewer_assets_check.json
logs/showcase_pipeline_console.txt
Use -SkipTests only after a recent full verification run when refreshing media/package evidence.
Expected result:
Unit tests: 64/64 passed.
OpenHarmony handoff static check: passed, including C++ data-plane control-record guard declarations and implementation.
OpenHarmony C++ host smoke: source-level audit passed, including data-plane, control-ring, and sandbox-profile guard source coverage; no C++ compiler was available on this host, so no binary execution is claimed.
OpenHarmony candidate patch bundle: passed.
OpenHarmony patch apply/rollback check: 12/12 files applied with git apply --whitespace=error, matched source hashes, and rolled back with git apply -R --whitespace=error.
OpenHarmony port bundle: 12 target files, patch copy, target-file snapshot, apply/rollback helpers, and bundle manifest audited.
Official submission audit: local deliverables passed, generated MP4 duration verified under 5 minutes, package size limits checked, and GitLink/platform actions documented as manual account steps.
Git history audit: local branch, HEAD, commit count, recent commits, commit stats, and worktree entries exported to docs/git_history.txt and logs/git_history_audit.json.
GitLink release handoff: local git bundle created, git bundle verify passed, clone verification passed, and manual GitLink push boundary recorded.
Demo: native MCP frame decodes and calls route_plan.
MCP conformance smoke: 11/11 assertions passed, including active routing negotiation and tools/route.
Wasmtime capsule execution: Wasmtime 46.0.1 executed 2 modules and rejected 5/5 sandbox cases; optional wheel lives under run/ and is excluded from the submission package.
Two-process data-plane daemon: shared-arena daemon/client passed with payload kept out of control-plane JSON.
Important boundary: pure Python CPU encode/decode latency is slower than the baseline because the prototype performs compression, ChaCha20 encryption, HMAC verification, and replay checks. The performance claim is therefore scoped to resource-limited link transmission efficiency and estimated end-to-end communication latency, not raw CPU micro-latency.
Submission Artifacts
Design document: docs/design.md
Start-here reviewer guide: START_HERE_REVIEWER.md
Technical solution: docs/technical_solution.md
Test report: docs/testing_report.md
Usage guide: docs/usage.md
Problem alignment matrix: docs/problem1_alignment.md
Competition gap analysis: docs/competition_gap_analysis.md
CCF2026 OpenHarmony Track - Native MCP Protocol Stack
Selected Problem
This project targets Problem 1: ubiquitous operating-system-native MCP protocol stack design.
The competition asks for an MCP protocol stack integrated into an operating system kernel or user-space service layer, reducing middleware overhead, improving Agent communication efficiency, and adding built-in security.
Project Summary
oh-native-mcpis a runnable user-space service-layer prototype for an OpenHarmony-native MCP transport. It keeps MCP’s JSON-RPC method semantics while replacing verbose framework-side request envelopes with a compact native frame that provides:ping,initialize,tools/list, nativetools/schema, andtools/call.mcpcccapsule package compiler that emits deterministic.mcapdirectories with signed package index, manifest, policy, native ABI, SPDX SBOM, and typed Python/C++/TypeScript stubs.tools/route, ranking candidates by intent, agent role, permission cost, observed latency, schema complexity, and data-plane hints before full schema fetch.tools/route->tools/schema-> signed nativetools/call, covering route planning, sensor object handles, health monitoring, and confirmed high-risk actuation.git apply --check --whitespace=error, applies it in a temporary target tree, verifies all applied file hashes, then verifies and executesgit apply -R --whitespace=error.git bundle verify, clones it back, checks HEAD/commit-count parity, and records the remaining account-only upload steps.This is not an OpenHarmony kernel patch yet. It is a complete host-runnable prototype and porting design for the OpenHarmony user-space service layer.
Repository Layout
Quick Verification
Run from
C:\CCFOpenSource:\CCFOpenSource\09_OpenHarmony\mcp_native_stack9_OpenHarmony\mcp_native_stack:Cross-platform unit-test smoke:
Full Showcase Pipeline
For a reviewer-style rebuild that mirrors a same-track showcase flow, run:
For reviewers on Linux/macOS or a shell-neutral Windows terminal, use the Python pipeline:
Or through the POSIX wrapper:
This runs full verification, regenerates the PPT and MP4 from current logs, refreshes dashboard/showcase assets, creates a timestamped package, audits zip contents, reruns competition readiness, and writes:
docs/showcase_pipeline.mddocs/showcase_pipeline_python.mddocs/competitor_alignment_audit.mddocs/package_repro_check.mddocs/active_tool_router.mddocs/agent_collaboration_scenario.mddocs/dashboard_contract_check.mddocs/gitlink_release_handoff.mddocs/reviewer_assets_check.mdlogs/showcase_pipeline.jsonlogs/showcase_pipeline_python.jsonlogs/competitor_alignment_audit.jsonlogs/package_repro_check.jsonlogs/active_router_check.jsonlogs/agent_collaboration_scenario.jsonlogs/dashboard_contract_check.jsonlogs/gitlink_release_bundle.jsonlogs/reviewer_assets_check.jsonlogs/showcase_pipeline_console.txtUse
-SkipTestsonly after a recent full verification run when refreshing media/package evidence.Expected result:
git apply --whitespace=error, matched source hashes, and rolled back withgit apply -R --whitespace=error.docs/git_history.txtandlogs/git_history_audit.json.git bundle verifypassed, clone verification passed, and manual GitLink push boundary recorded.route_plan.tools/route..mcaptool packages deterministic, signed, verified, tamper-rejected, and emitted with policy, ABI, SPDX SBOM, and typed stubs.run/and is excluded from the submission package.run/and host checks executed from the extracted package tree.Latest observed benchmark:
Concurrent Agent benchmark:
Concurrency matrix:
docs/concurrency_matrix.md,logs/concurrency_matrix.jsonHandle data-plane benchmark:
End-to-end reviewer story:
docs/e2e_story_demo.mdCapsule manifest handoff:
docs/capsule_manifest.md,logs/capsule_manifest_check.jsonCapsule runtime execution:
docs/capsule_runtime.md,logs/capsule_runtime_check.jsonWASI profile handoff:
docs/wasi_profile_handoff.md,logs/wasi_profile_check.jsonWASM capsule execution:
docs/wasm_capsule_execution.md,logs/wasm_capsule_check.jsonWasmtime capsule execution:
run/wasmtime_vendordocs/wasmtime_capsule_execution.md,logs/wasmtime_capsule_check.jsonReproduce optional Wasmtime evidence after unpacking:
Two-process data-plane daemon:
docs/twoprocess_dataplane.md,logs/twoprocess_dataplane_check.jsonTwo-process data-plane stress:
docs/twoprocess_dataplane_stress.md,logs/twoprocess_dataplane_stress.jsonPerformance matrix:
docs/performance_matrix.md,logs/performance_matrix.jsonSchema-heavy mini-manifest:
tools/listbytesdocs/schema_manifest_benchmark.md,logs/schema_manifest_benchmark.jsonProtocol fuzz corpus:
docs/protocol_fuzz_corpus.md,logs/protocol_fuzz_corpus.jsonEnd-to-end Agent application:
Important boundary: pure Python CPU encode/decode latency is slower than the baseline because the prototype performs compression, ChaCha20 encryption, HMAC verification, and replay checks. The performance claim is therefore scoped to resource-limited link transmission efficiency and estimated end-to-end communication latency, not raw CPU micro-latency.
Submission Artifacts
docs/design.mdSTART_HERE_REVIEWER.mddocs/technical_solution.mddocs/testing_report.mddocs/usage.mddocs/problem1_alignment.mddocs/competition_gap_analysis.mddocs/pr_handoff.mddocs/security_model.mddocs/dataplane_methodology.mddocs/capsule_manifest.mddocs/capsule_runtime.mddocs/wasi_profile_handoff.mddocs/wasm_capsule_execution.mddocs/wasmtime_capsule_execution.mddocs/twoprocess_dataplane.mddocs/twoprocess_dataplane_stress.mddocs/protocol_fuzz_corpus.mddocs/openharmony_porting_plan.mdopenharmony_service/openharmony_service/tests/native_mcp_host_smoke.cppopenharmony_service/include/native_mcp_dataplane.h,openharmony_service/src/native_mcp_dataplane.cppopenharmony_service/include/native_mcp_ring.h,openharmony_service/src/native_mcp_ring.cppopenharmony_service/include/native_mcp_sandbox_profile.h,openharmony_service/src/native_mcp_sandbox_profile.cpppatches/openharmony_native_mcp_service.patchscripts/run_patch_apply_check.py,docs/patch_apply_check.md,logs/patch_apply_check.jsonscripts/build_openharmony_port_bundle.py,docs/openharmony_port_bundle.md,logs/openharmony_port_bundle_audit.json,patches/openharmony_port_bundle/scripts/run_official_submission_audit.py,docs/official_submission_audit.md,logs/official_submission_audit.jsonscripts/run_git_history_audit.py,docs/git_history.txt,logs/git_history_audit.jsonscripts/run_gitlink_release_bundle.py,docs/gitlink_release_handoff.md,logs/gitlink_release_bundle.jsonpatches/patch_manifest.jsonsrc/oh_mcp_native/stdio_server.pyscripts/run_security_attack_matrix.pyscripts/run_protocol_fuzz_corpus.pysrc/oh_mcp_native/capsule_manifest.pysrc/oh_mcp_native/mcpcc.py,scripts/run_mcpcc_check.py,docs/mcpcc.md,logs/mcpcc_check.json,capsules/compiled/src/oh_mcp_native/capsule_runtime.py,src/oh_mcp_native/capsule_worker.pysrc/oh_mcp_native/wasi_profile.py,scripts/run_wasi_profile_check.pysrc/oh_mcp_native/wasm_capsule.py,scripts/run_wasm_capsule_check.pyscripts/bootstrap_wasmtime_vendor.ps1,scripts/run_wasmtime_capsule_check.pysrc/oh_mcp_native/mini_manifest.py,scripts/run_schema_manifest_benchmark.pysrc/oh_mcp_native/router.py,scripts/run_active_router_check.py,docs/active_tool_router.md,logs/active_router_check.jsonsrc/oh_mcp_native/collaboration.py,scripts/run_agent_collaboration_check.py,docs/agent_collaboration_scenario.md,logs/agent_collaboration_scenario.json,tests/test_agent_collaboration.pysrc/oh_mcp_native/dataplane_daemon.pyscripts/run_twoprocess_dataplane_stress.pyscripts/run_performance_matrix.pyscripts/run_concurrency_matrix.pydocs/CCF2026_OpenHarmony_native_mcp_stack.pptxdocs/CCF2026_OpenHarmony_native_mcp_stack_demo.mp4docs/video_script.mdscripts/run_git_history_audit.py,docs/git_history.txt,logs/git_history_audit.jsondocs/platform_submission_guide.mdSUBMISSION_READY_REPORT.mddocs/final_report.mddocs/submission_checklist.mddocs/validation_summary.jsondocs/artifact_manifest.jsondocs/showcase.htmldocs/dashboard.htmldocs/dashboard_contract_check.md,logs/dashboard_contract_check.jsondocs/e2e_story_demo.mddocs/competition_readiness_scorecard.mddocs/reviewer_start_here.mdlogs/test_results.txtlogs/patch_bundle_check.jsonlogs/official_submission_audit.jsonlogs/git_history_audit.jsonlogs/openharmony_cpp_smoke.jsonlogs/demo_output.txtlogs/e2e_story_demo.jsonlogs/competition_readiness_audit.jsonlogs/reviewer_launch_check.jsonlogs/benchmark_results.jsonlogs/mcp_conformance.jsonlogs/stdio_conformance.jsonlogs/security_attack_matrix.jsonlogs/openharmony_port_bundle_audit.jsonlogs/capsule_manifest_check.jsonlogs/capsule_runtime_check.jsonlogs/twoprocess_dataplane_check.jsonlogs/twoprocess_dataplane_stress.jsonlogs/performance_matrix.jsonlogs/concurrency_matrix.jsonlogs/schema_manifest_benchmark.jsonlogs/active_router_check.jsonlogs/agent_collaboration_scenario.jsonlogs/trip_planner_output.jsonlogs/dataplane_results.jsonlogs/openharmony_handoff_check.jsonlogs/concurrency_results.jsonlogs/submission_assets_console.txtPackaging
The package is written to
C:\CCFOpenSource:\CCFOpenSource\09_OpenHarmony\dist9_OpenHarmony\distwith a timestamped name and a.sha256sidecar.