Blog

MCP-native edge agent control plane in Python

Design notes from my ai-engineering-portfolio for a Python control plane—resource-aware scheduling, signed adapters, hash-chained audit logs, and an MCP server—with honest prototype status.

3 min readAwaiting author review

Large language models are commodities; governance on the machine that runs them is not. In my public AI engineering portfolio, I document an edge agent control plane implemented in Python—a prototype that orchestrates existing inference runtimes instead of replacing them. The one-pager “Edge agent control plane (Python, MCP)” is the source for this post; the implementation lives in a private repo with an automated test suite.

Problem framing

Running agents on laptops and edge hardware raises questions inference servers do not answer:

  • Which model tier should serve this request given CPU, memory, battery, thermals, and optional GPU headroom?
  • Which fine-tuned adapter is allowed to act right now?
  • How do you prove afterwards what ran, with which version, and under which policy?

The control plane sits above backends such as a local Ollama server (with extension points for other runtimes) and a mock backend for offline demos and tests.

What the prototype does

Resource-aware scheduling samples machine pressure via a resource monitor, then downgrades requested model tiers under thresholds. If multiple constraints bind, the scheduler can fall back to a cloud tier and record a plain-language reason for the decision.

Adapter lifecycle treats adapters as signed artifacts: register (content hashed and signed), evaluate in shadow against a threshold, promote, and support rollback or revoke. Only the promoted version is applied; a missing promotion is logged rather than silently ignored.

Tamper-evident audit log appends hash-chained entries—each entry embeds the previous hash so verify commands detect edits or deletions.

Three front doors share one orchestrator:

  • A REST API with a small operator console.
  • A Typer-based CLI.
  • An MCP tool server so MCP-speaking agents invoke scheduling and governance without bespoke HTTP clients.

Architecture sketch

flowchart TB
  MCP[MCP-speaking agent] --> SRV[MCP tool server]
  CLI[CLI] --> ORCH[Orchestrator]
  API[REST API] --> ORCH
  SRV --> ORCH
  ORCH --> SCH[Scheduler]
  SCH --> RM[Resource monitor]
  ORCH --> AD[Adapter registry]
  ORCH --> AU[Hash-chained audit log]
  SCH --> LOC[Local runtime]
  SCH --> MOCK[Mock runtime]

Stack and design decisions

The portfolio lists Python 3.10+, FastAPI, Pydantic, psutil, Typer, httpx, cryptography (Ed25519 signing), the MCP Python SDK, OpenTelemetry APIs, pytest, and Docker Compose.

Design choices I stand behind in the write-up:

  • Orchestrate, do not compete with inference engines.
  • Promotion is a gate, not “latest wins.”
  • Audit before execution so crashes still capture intent.
  • Fail closed on signature mismatch—revoke rather than run.
  • Explainable scheduling for human operators reading the console.

Status: prototype, honestly

This is not production. Signing uses a local key as a stand-in for a real supply-chain trust model. Additional inference runtimes are extension points, not finished implementations. Tests cover the resource monitor, scheduler policy, adapter signing and promotion gate, audit tamper detection, orchestrator lifecycle, and HTTP API—with the mock backend so CI does not require a GPU machine.

That honesty matters: the portfolio is a design library, not a launch brochure.

Why MCP

MCP-native exposure means agents that already speak MCP can request a scheduled model run, fetch adapter metadata, or append audit queries without me writing one-off integrations per agent framework. The control plane becomes shared infrastructure for personal projects like View, Stillwater, and future edge tools.

Closing

The MCP edge agent control plane is my experiment in resource-aware scheduling, signed adapter lifecycles, and hash-chained audit logs exposed through REST, CLI, and MCP. Read the portfolio page for diagrams and gap analysis; treat the Python service as a working prototype with tests—not yet a hardened product. That is the right posture for edge AI governance: prove the controls in code first, then harden trust roots when a deployment warrants it.