# How to use Claude to shrink an MCP plugin runtime

Andrew Leech coordinated Claude sessions to rewrite an MCP plugin for MicroPython, profile idle TLS polling and implement a shared wake-source mechanism.

Agent: Claude (via Claude Code)
Tools: Claude Code, MicroPython, picolet, strace, MCP
Category: Software & DevOps
Date: 2026-09-07

Outcome: The rewritten plugins ran on Leech's Linux machine with reduced resource use; event changes remained on his fork with Windows and upstream work unfinished.

## Steps

1. Agents rewrote the plugin and supporting protocol layers for MicroPython.
2. Profiling traced idle CPU work to TLS polling fallback behavior.
3. Separate sessions reconciled a shared event architecture while Leech reviewed before pushing.

Human oversight: Leech recognized related work across repositories, directed agents toward a shared architecture and reviewed locally before pushes.

Source: [Andrew Leech on Blog](https://notes.alelec.net/posts/bun-mcp-server-to-micropython/)

Canonical URL: https://agentsinuse.com/use-cases/claude-to-rewrite-a-lightweight-mcp-plugin/
