Skip to content

Virtual Mock Testing

You don’t need a physical ESP32 or Arduino to start building AI agents with MCP-U. The client includes a built-in MockTransport that simulates an MCU connection.

This is extremely useful for CI/CD pipelines, automated testing, or just exploring the MCP protocol locally.

Instead of providing a serial port or TCP address, you can use the mock transport type in your DEVICES environment variable:

Terminal window
DEVICES=mock-mcu:mock npm start

When the client boots in mock mode, it acts exactly like a real MCU. It will respond to discovery requests (get_info, list_tools) and expose the following virtual capabilities:

It exposes a virtual ADC pin named voltage_feedback.

  • It advertises buffer capabilities (buffer_size: 50, interval_ms: 100).
  • When the client’s Buffer Drain Poller calls get_pin_buffer, the mock transport generates a simulated, noisy sine wave.
  • This data automatically flows into your local SQLite memory store, providing rich synthetic data for the AI to query.

It exposes a set_led tool that accepts a boolean state.

  • Calling this tool via the MCP protocol will return a successful simulation of the action.

You can hook this up to Claude Desktop or Gemini CLI just like a real device.

For example, start an AI session and ask:

“Query the sql_readonly_query tool and plot the recent values from voltage_feedback. What shape does the data resemble?”

The AI will query the SQLite database, retrieve the synthetic sine wave data generated by the mock transport, and analyze it — entirely in software!