When I wrote about twenty years of mod_wsgi and why I had started on Muru, part of the answer was AI coding tools. They are what made it practical for me to build something this size. The flip side is that coding agents are now often the ones running a web application while it is being worked on. They start it, poke at it, read what went wrong and change the code, and they do all of that through whatever the server gives them.With gunicorn or uvicorn, what the server gives them is not much. An agent starts the server in the background, sends it some requests with curl, and reads whatever the server happened to print. If a request hangs, the agent sees a timeout and nothing else, so it goes back to reading the code and guessing. Seeing what a stuck thread is doing means reaching for something like py-spy, which may need privileges the agent doesn't have. And when it wants to try a change, it restarts the server and the old version is gone.The earlier posts in this series covered what the Muru daemon knows while an application runs: releases, events, logs and tracebacks per release, what every worker thread is doing, and rollback as a routing change. This post is about handing all of that to a coding agent.The MCP servermuructl mcp serve speaks the Model Context Protocol on its standard input and output, and talks to the daemon over its admin socket the same way the other muructl commands do. For Claude Code, it goes in .mcp.json at the top of the project:{ "mcpServers": { "muru": { "command": "muructl", "args": ["mcp", "serve", "--up"] } }}The --up option starts the user's daemon if none is answering, so the first tool call works on a fresh checkout.The server offers a few dozen tools. Each one runs the muructl command of the same name with --json and returns what it prints, and each is marked for the client as either only reading or changing something. Deploying, rolling back, draining and running canary rollouts are there. Stopping or upgrading the daemon, running arbitrary code in a worker and one-off commands with muructl exec deliberately aren't, and run_command only runs the commands an application declares in its [tool.muru] settings.What an agent may do can be cut down further. With --read-only the server lists only the tools which read, so an agent can watch and diagnose but not change anything. With --allow rollback,drain it adds just those two. A tool left out isn't hidden by convention, it doesn't exist as far as the client is concerned. Calling deploy against a server started with --read-only:{"jsonrpc": "2.0", "id": 3, "error": {"code": -32602, "message": "no tool named deploy"}}The skillTools let an agent operate Muru, but don't tell it what a release is, what each operation does to traffic, or what to check afterwards. That is what the skill is for. It is embedded in muructl, so it always matches the version being used, and is written into the project so it travels with the code:muructl mcp skill installmuru: wrote the skill for muructl 1.0.0 to .claude/skills/muru/SKILL.mdThe skill describes applications, releases, traffic and overlays, has a table of each operation and what it does to traffic, and lays out a development loop: check the status, deploy the working tree, run the tests against the daemon's listener, and when something fails, find out why from events, logs, the requests in flight and worker stacks before changing any code. It works through the MCP tools when the agent has them, and through muructl --json when it doesn't.muructl mcp skill status says whether the project's copy is current, and exits with a non-zero status when it isn't, so a CI job can check it after muructl is upgraded. The MCP server checks as well. In a project without the skill, the instructions it gives the agent at the start of a session end with:The Muru skill: the project carries no skill at .claude/skills/muru/SKILL.md; `muructl mcp skill install` writes it.An agent and a broken changeTo see how this works in practice, I set up a small WSGI shop application in a git repository, with a few JSON pages over a dictionary of orders, guarded by a lock, and a tests.py which runs against the daemon's listener. That version was deployed as shop@r1 and passed its tests.For the scenario, I then pulled down a change which a colleague had committed to the repository before rushing out in a hurry, leaving it for me to test. It added an /orders/summary page and a test for it, and along the way changed get_order() to index the dictionary rather than call .get(). The new summary() function took the lock and then called all_orders(), which takes the same lock. A plain threading.Lock isn't reentrant, so that is a deadlock.I then ran Claude Code headless in the project, with the MCP server above, the skill installed, and permission to use only the Muru tools, python3 tests.py, and tools for reading files. The prompt was:A colleague committed a quick change to our repo that adds an order summary page, and left it for me to test. I've pulled it into this checkout. Deploy the working tree as a new release of the shop application using the muru tools, then run python3 tests.py against it. If tests fail, use the muru tools to find out why rather than guessing from the code alone, roll the application back to the previous release so the shop keeps working, and report what you found. Don't change any code yet.Everything that follows comes from the session's record of tool calls and their results.The agent loaded the muru skill, looked at what the commit changed, then called status and list to see which release was serving. It then deployed:mcp__muru__deploy {"app": "shop", "source": ".../s7/shop"}The tool waits until the release is ready or has failed, and returned the release, trimmed here:{ "app": "shop", "id": "r2", "state": "ready", "message": "", "serving": true, "processes": 2, "threads": 4, "python_version": "3.15.0", ...}Running the tests, three of the five failed:test_home (__main__.ShopTests.test_home) ... oktest_missing_order (__main__.ShopTests.test_missing_order) ... ERRORtest_order (__main__.ShopTests.test_order) ... oktest_orders (__main__.ShopTests.test_orders) ... ERRORtest_summary (__main__.ShopTests.test_summary) ... ERRORMost of the errors were five second timeouts in the test client, which say nothing about the cause. The agent's next call was the one that mattered:mcp__muru__debug {"what": "stacks", "target": "shop@r2"}The result lists, for each worker, the requests in flight and the stack of every thread, with the request each thread is serving. For worker 0 it reported three requests in flight, /orders/summary for 29.9 seconds, /orders/99 for 19.2 seconds and /orders for 14.2 seconds. The thread serving the summary, trimmed to the last of its frames:{ "name": "muru-app-0", "request": {"method": "GET", "path": "/orders/summary", "elapsed_ms": 29878, ...}, "frames": [ ... {"file": ".../shop/app.py", "line": 19, "function": "application", "text": "return respond(start_response, \"200 OK\", orders.summary())"}, {"file": ".../shop/orders.py", "line": 23, "function": "summary", "text": "orders = all_orders()"}, {"file": ".../shop/orders.py", "line": 12, "function": "all_orders", "text": "with _lock:"} ]}The other two threads were stuck on the same lock, at orders.py lines 12 and 17. One request for the summary page had taken the lock and never let it go, and every other request touching orders in that worker then queued up behind it. That explained why the set of failing tests grew between the agent's two test runs, which otherwise looks like a flaky test.It then read the release's output with logs, which had the traceback for the other failure:muru.worker[1]: Traceback (most recent call last):muru.worker[1]: File ".../shop/app.py", line 21, in applicationmuru.worker[1]: File ".../shop/orders.py", line 18, in get_ordermuru.worker[1]: KeyError: 99and logs with access set, where the same request showed up on r2 as a 500 with the reason app_error, where r1 had answered 404. It read the events, read orders.py to confirm what the stacks and traceback said, and rolled back:mcp__muru__rollback {"app": "shop"}which returned r1, with "state": "ready" and "serving": true, and a list of releases showed r2 kept warm, not serving. The agent ran the tests once more to check the rollback. The four original tests passed, and the summary test failed as you would expect, since r1 predates the page.Its report named both defects, with the file and line for each, and pointed out that the deadlock wasn't confined to the new page, but took down every order endpoint in a worker once it happened. The session took 23 turns and about a minute and three quarters.Fixing itI then resumed the same session:Thanks. Go ahead and fix both problems, deploy the fix as a new release, and run the tests against it. If they pass, leave the new release serving and drain the release with the deadlock, since nothing should go back to it.This time it was allowed to edit files. It changed get_order() back to .get(), and moved the call to all_orders() in summary() out from under the lock. It deployed the result as shop@r3, and the tests passed:test_home ... oktest_missing_order ... oktest_order ... oktest_orders ... oktest_summary ... okRan 5 tests in 0.013sOKBefore draining anything, it called debug with status on r3 to check that no thread was left holding a request. It then drained r2, and the releases ended up as:r3 ready Truer2 stopped False superseded againr1 retained False warm until 12:30 UTC; a rollback to it is instantIt also noted, without being asked, that r1 was now the instant rollback target and didn't have the summary page, which is the kind of thing worth knowing before you reach for a rollback. That took eight turns and 45 seconds.None of what the agent did needed it to restart anything, and at every point there was a working release it could go back to. The two releases being separate is what let it look at the broken one's workers while the hang was still in progress, rather than reconstructing it from the code afterwards.Without MCPAn agent working through a shell, or a script, gets the same answers from muructl directly. Every command which reports something takes --json and prints exactly what the corresponding tool returns:muructl release list shop --json | python3 -c 'import json,sys; [print(r["id"], r["state"], r["serving"], r["message"]) for r in json.load(sys.stdin)["releases"]]'That is where the release list above came from. A failure prints an error object, with a non-zero exit status:muructl rollback blog --json{ "error": "application blog does not exist"}and muructl events --json --after 28 returns only the events after a given sequence number, so a script can keep up with what has happened without parsing text.An experiment as much as a featureAI is changing how we develop code, of that there is little doubt, but exactly how it is changing it isn't real clear yet. The tools, and the ways of working with them, keep shifting. What looked like the obvious way for an agent to talk to other software a year ago may not be how it is done a year from now, and MCP itself is still young enough that it could end up being a stepping stone to something else.So adding an MCP server to Muru is a bit of an experiment on my part, to see how much a server which knows what an application is doing can help an agent working on that application. The approach may turn out to be wrong. That said, I am sure lessons will be learnt along the way, and as new paradigms emerge for using AI to do coding, what was learnt here about which operations an agent needs, and what it has to be told about them, should still be helpful.What's nextThe posts so far have covered the core features of Muru worth knowing about. The first ones were about what is different in development mode, then the daemon with releases and canaries, then containers and Kubernetes, then scaling and overlays acting on a schedule or on what Muru sees, then back to development mode with the toolbar, tracing and import timings, and this one ties it back to the reason I started. Muru was built with a coding agent, and it turns out the things that make it easier for me to see what an application is doing, such as stacks for every thread, logs and events for each release, and rollback as a routing change, are just as useful when the one looking is an agent.The next post will be an update on where Muru is up to, along with my current thinking on the timeline for when you can expect a release I deem suitable for local development and testing, and later on, a release for production.