KY.AI.Browser
1.0.1
Prefix Reserved
See the version list below for details.
dotnet tool install --global KY.AI.Browser --version 1.0.1
dotnet new tool-manifest
dotnet tool install --local KY.AI.Browser --version 1.0.1
#tool dotnet:?package=KY.AI.Browser&version=1.0.1
nuke :add-package KY.AI.Browser --version 1.0.1
ky-ai-browser
Read a served front-end's browser/runtime console from an AI agent over MCP — the runtime
counterpart to ky-ai-ng's build tools. It captures
console.log/info/warn/error, uncaught exceptions and unhandled promise rejections (with source
location + stack) so the agent can read them via console_tail instead of you copy-pasting from
devtools.
How it works
ky-ai-browser is a process you run next to a running ky-ai-ng serve — its lifetime is the
on/off switch, so you control the (reversible) manipulation:
- On start it finds the running
ky-ai-ngfrontend (via the hub's registry) and — after a confirmation (default yes) — asksky-ai-ngto inject a tiny capture<script>into the app'sindex.html(wrapped inky-ai-ng-injectmarkers, at/html/head). - The dev server reloads the page; the snippet patches
console.*+ the error events and POSTs them back toky-ai-browser(loopback, cross-origin). No proxy, HMR stays native. - The agent reads them with the
console_tailMCP tool (andconsole_clearto reset). - On Ctrl+C the script is removed and
index.htmlis restored. Ifky-ai-browserever dies without cleaning up,ky-ai-ngstrips the leftover marker automatically on its next start (self-heal), and reverts on its own shutdown — so the file is never left modified.
Injection only ever captures from page-load forward (it can't read console history that printed
before the script loaded), and a strict script-src 'self' CSP would block the cross-origin
snippet — both inherent to in-page capture.
Usage
ky-ai-browser [options] # run alongside `ky-ai-ng serve`
--project <id> Which ky-ai-ng frontend to attach to (default: the only one registered)
--port <N> ky-ai-browser's own MCP + ingest port (default: 5104)
--ng-hub-port <N> ky-ai-ng hub port to discover the frontend (default: 5101)
-y, --yes Skip the inject confirmation (default answer is yes anyway)
MCP tools (for agents)
| Tool | Args | Purpose |
|---|---|---|
console_tail |
lines?, level?, sinceSeq?, grep?, pageLoad? |
recent browser console events: {seq, level, args, text, source, line, col, stack, timestamp, pageLoadId} + dropped + enabled |
console_clear |
— | clear the buffer (e.g. before reproducing an issue) |
Add the server to .mcp.json and allow the tools:
{ "mcpServers": { "ky-ai-browser": { "type": "http", "url": "http://127.0.0.1:5104/mcp" } } }
{ "permissions": { "allow": [
"mcp__ky-ai-browser__console_tail", "mcp__ky-ai-browser__console_clear"
] } }
All HTTP is loopback-only; nothing leaves the machine. The capture buffer, event types and the
snippet live in this project; the reversible inject mechanism it drives is a generic
POST /inject { file?, path, content } (+ /uninject) on the ky-ai-ng supervisor's control API.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.