Skip to sessions and notes

These session notes are AI-generated and may contain mistakes. Verify important details against the original recording.

Give Your .NET Agent a Face: Building an AI Desk Companion with M5Stack

Bruno Capuano

Session · 25:43 recording · 7 min read

At a glance

  • Physical AI agent embodiment: giving .NET agents a face, voice, neck servo movement & camera vision
  • Hardware: Stack-Chan powered by M5Stack ESP32 with color LCD, mic, speaker & dual servos
  • C# Model Context Protocol (MCP) Server: bridging robot to Aspire eShopLite catalog via WebSockets
  • Semantic search & vector embeddings executed on device requests, answering spoken questions out loud
  • Custom C++ firmware authored via GitHub Copilot App & Copilot Fusion (delivery monitor canvas)

Executive Summary

While most developers interact with AI agents through text chat consoles or IDE sidebars, Bruno Capuano demonstrates how to bring AI agents into the physical realm. By giving software agents a physical face, voice synthesis, pan/tilt servo movement, camera vision, and tactile buttons, developers can transform abstract LLM workers into an embodied, animated AI Desk Companion.

Using Stack-Chan—an open-source desktop robot powered by the M5Stack ESP32 hardware module—Bruno demonstrates two complete integration architectures:

  1. Cloud-Connected Robot + C# Model Context Protocol (MCP) Server: Running stock M5Stack firmware connected to cloud models (Qwen, Llama), bridged over WebSockets to a local C# MCP server in .NET. The physical robot executes tools provided by .NET Aspire (eShopLite), running vector embedding queries and semantic searches to answer spoken questions out loud through its speaker.
  2. Autonomous Custom C++ Firmware + .NET Blazor Companion ("Robot Hub"): Bruno authored a custom C++ ESP32 firmware using the GitHub Copilot App and Copilot Fusion (monitoring flashing and hash checks on an interactive delivery canvas). The robot hosts a custom .NET Bot avatar (capable of smiling, winking, blinking, and sleeping), runs on private local Wi-Fi without cloud dependencies, and connects to an ASP.NET Core Blazor companion app.
  3. Proactive Worker Agents & Telemetry in .NET Aspire: Background worker agents in Aspire (monitoring Outlook/M365 Work IQ emails or GitHub Actions CI build failures) proactively push alert cards to the robot's screen with audio chimes. Physical touch inputs on the robot screen ("Discard", "Open") dispatch actions back to .NET Aspire, capturing end-to-end OpenTelemetry traces from the microcontroller all the way to backend LLM inference.

Hardware & Software Embodiment Architecture

The complete system bridges physical ESP32 microcontrollers to local and cloud .NET AI pipelines orchestrated by .NET Aspire:

flowchart TD
    subgraph Physical ["Physical Hardware (Stack-Chan / M5Stack ESP32)"]
        LCD["Color LCD Display<br/>(Custom .NET Bot Avatar / Alert Cards)"]
        Camera["Front-Facing Camera<br/>(Face & Gesture Tracking)"]
        Audio["Microphone & Speaker<br/>(Spoken Voice Interactivity)"]
        Servo["Dual-Axis Pan/Tilt Servos<br/>(Physical Movement & Gaze)"]
        Touch["Capacitive Touchscreen<br/>(Accept / Discard Prompts)"]
    end

    subgraph Network ["Bi-Directional Communication Layer"]
        WS["WebSocket Client / Server"]
        MCP["Model Context Protocol (C# MCP SDK)"]
        LocalWiFi["Private Local Wi-Fi (No External Cloud)"]
    end

    subgraph Backend ["Aspire-Orchestrated .NET Backend"]
        Companion["Blazor 'Robot Hub' App<br/>(Brightness, Gestures, Controls)"]
        WorkerAgent["Proactive Worker Agent<br/>(M365 Work IQ Emails & GitHub Alerts)"]
        SemanticSearch["eShopLite Catalog API<br/>(Vector Embeddings & Semantic Search)"]
        Telemetry["Aspire Dashboard<br/>(OpenTelemetry: LLM Traces + ESP32 Events)"]
    end

    Camera --> Physical
    Audio --> Physical
    Touch --> Physical
    Servo --> Physical
    LCD --> Physical

    Physical <--> WS
    Physical <--> LocalWiFi
    WS <--> MCP

    MCP <--> SemanticSearch
    LocalWiFi <--> Companion
    Companion <--> WorkerAgent
    WorkerAgent <--> Telemetry
    Companion <--> Telemetry
    SemanticSearch <--> Telemetry

Key Technical Innovations

1. Physical Hardware: Stack-Chan & M5Stack

Stack-Chan is an open-source companion robot based on the M5Stack ecosystem:

  • Processor: Espressif ESP32 dual-core microcontroller with Wi-Fi and Bluetooth.
  • Peripherals: 2.0-inch color LCD display, front-facing camera for face detection, digital microphone, internal speaker, dual serial bus servo motors for head movement, capacitive touch screen, and battery module.
  • In factory mode, the robot boots, connects to Wi-Fi, tracks the developer's face using on-device computer vision, and speaks using cloud LLM backends.

Session Introduction
Session Introduction

Bruno Capuano presents 'Give Your .NET Agent a Face' at .NET Conf 2026.

Stack-Chan Hardware
Stack-Chan Hardware

Physical Stack-Chan robot tracking face and interacting on developer desk.


2. C# Model Context Protocol (MCP) Server Integration

To empower the physical robot with private enterprise data, Bruno uses the official C# Model Context Protocol (MCP) SDK:

  • The robot connects over WebSockets to an MCP endpoint provided by a local .NET application using a token handshake.
  • The C# MCP server exposes tools from the eShopLite sample (an outdoor equipment catalog orchestrated in .NET Aspire).
  • When the user asks: "I want to go camping and need outdoor cooking gear. What can you suggest?":
    1. The robot streams spoken audio to the cloud LLM.
    2. The LLM determines it needs product search tools and invokes the C# MCP tool.
    3. The C# MCP tool generates text embeddings, queries the vector database in Aspire, and returns matched products (e.g. TrailSpark compact stove for $54).
    4. The robot speaks the answer aloud through its speaker.
    5. The entire multi-turn tool execution is captured in .NET Aspire Distributed Tracing.

MCP Architecture
MCP Architecture

Architecture: M5Stack cloud agent calling local C# MCP tools over WebSockets.

C# MCP WebSocket Code
C# MCP WebSocket Code

C# implementation connecting to robot WebSocket endpoint with MCP authentication tokens.

eShopLite Aspire Traces
eShopLite Aspire Traces

Aspire Dashboard displaying GenAI distributed traces and text embedding queries.

Robot Answering Camping Query
Robot Answering Camping Query

Physical robot speaking product recommendations retrieved from local C# MCP tools.

Aspire Semantic Search Telemetry
Aspire Semantic Search Telemetry

OpenTelemetry traces showing the exact semantic search query dispatched by the robot.


3. Custom Firmware Engineering with GitHub Copilot App & Fusion

To eliminate external cloud dependencies and render custom .NET branding, Bruno rewrote the robot firmware in C++:

  • Copilot App & Copilot Fusion: Bruno leveraged specialized agents (C++ developer, test agent, and deployment agent) inside the GitHub Copilot App to generate embedded ESP32 code.
  • Delivery Monitor Canvas: A custom canvas UI tracks the 15-minute OTA deployment lifecycle: environment checks, firmware compilation, hash integrity verification, over-the-air deployment, and robot ping verification.
  • Custom .NET Bot Avatar: Features a custom .NET Bot face with animated eyes that wink, smile, track movement, and sleep when idle.

Custom Firmware Architecture
Custom Firmware Architecture

Custom C++ firmware architecture communicating directly with a local Blazor Companion app.

Copilot App Canvas Pipeline
Copilot App Canvas Pipeline

GitHub Copilot App Delivery Monitor Canvas tracking the multi-step firmware build and flashing pipeline.

Custom .NET Bot Avatar on Device
Custom .NET Bot Avatar on Device

The custom animated .NET Bot avatar running on the physical M5Stack display.


4. Blazor Companion App ("Robot Hub") & Aspire Telemetry

Bruno built an ASP.NET Core Blazor application named Robot Hub orchestrated inside .NET Aspire:

  • Connects directly to the robot's local IP address over Wi-Fi.
  • Provides real-time sliders for LCD brightness, servo gaze angles, battery level monitoring, and triggers for emotional expressions (wink, smile, neutral).
  • ESP32 Device Telemetry in Aspire: Telemetry spans from the microcontroller (smile_requested, brightness_change) are forwarded directly into the Aspire OpenTelemetry collector, merging IoT device events into the same timeline as web API requests.

Robot Hub Blazor Companion
Robot Hub Blazor Companion

Blazor 'Robot Hub' web dashboard managing robot connection state and diagnostics.

Controlling Gestures and Brightness
Controlling Gestures and Brightness

Triggering physical facial gestures (wink, smile) and adjusting LCD brightness in real time.

ESP32 Telemetry in Aspire
ESP32 Telemetry in Aspire

Aspire Dashboard capturing OpenTelemetry spans emitted directly from the ESP32 microcontroller.


5. Proactive Alerts & Physical Human-in-the-Loop Interaction

The true power of an embodied agent is proactive interruption:

  • Worker Agent: A background agent in Aspire listens for events (e.g. high-priority manager emails via Microsoft 365 Copilot SDK / Work IQ, or critical GitHub Actions workflow failures).
  • Physical Disruption: Instead of getting lost in inbox notifications, the desk robot beeps, turns its head toward the developer, and renders an interactive alert card on its screen.
  • Touch Interaction: The developer taps "Discard" or "Open" on the physical robot screen. The tap event streams back to the worker agent in Aspire, resolving the event and logging telemetry.

Agent Alert Notification Screen
Agent Alert Notification Screen

Physical robot displaying an interactive alert card for an urgent email notification.

Full Agent Telemetry Lifecycle
Full Agent Telemetry Lifecycle

Aspire traces showing the complete cycle: Worker Agent invocation, chat reasoning, tool call, and alert dispatch.


Upcoming 3-Part Live Build Series

Bruno announces an open-source, 3-part live build series hosted on the official .NET channel:

  1. Session 1 (Firmware): Building the custom C++ ESP32 firmware, servos, display buffer, and touch drivers.
  2. Session 2 (AI Brain): Connecting Microsoft Foundry models, C# MCP servers, and local SLMs.
  3. Session 3 (Sentient Desk Companion): Integrating the Blazor companion app, Copilot SDK, Work IQ, and proactive GitHub alerts.

Conclusion & Impact

By bridging physical hardware with .NET Aspire, the C# Model Context Protocol SDK, and modern AI agents, Bruno Capuano demonstrates that software agents don't have to live solely in terminal windows. A physical desk robot running C# tooling delivers intuitive human-in-the-loop interactions, tactile feedback, and undeniable personality to modern developer workspaces.