@focus.matters/console-monitor
v0.2.3
Published
Run and monitor long-lived console commands from agents over TCP and MCP.
Readme
@focus.matters/console-monitor
Run long-lived commands and expose their recent console output to local agents.
Install
cm installThis creates:
~/.mcp/console-monitor/server.mjs
~/.mcp/console-monitor/run.mjsserver.mjs starts the local console index on 127.0.0.1:9500.
run.mjs runs a command, registers it in that index, and refreshes its entry
every 5 seconds while the command is alive.
CLI
cm server
cm run -- pnpm dev
cm run --cwd /path/to/project -- npm run watchcm run starts the index automatically when the installed server.mjs is
available. Each monitor keeps recent output in memory and exposes reads through
the index. The index removes consoles that have not refreshed their state in
the last 15 seconds.
The index list only returns:
[
{
"pwd": "/path/to/project",
"command": "pnpm dev",
"id": "..."
}
]MCP
Start the MCP server with:
console-monitor-mcp
cm mcpIt exposes these tools:
index: returns the current console index withpwd,command, andid.read: reads recent output from a console usingidandlines.restart: stops and starts the console's original command using itsid.console_index: alias forindex.console_read: alias forread.console_restart: alias forrestart.
Example MCP config:
{
"mcpServers": {
"console-monitor": {
"command": "npx",
"args": ["-y", "@focus.matters/console-monitor", "mcp"]
}
}
}