MCP (Model Context Protocol)¶
Daemonitor includes a local, read-only Model Context Protocol (MCP) server inside the Desktop application binary (src/.../mcp/), providing an interface for querying locally collected process measurements, JVM and OS telemetry, and retained history without terminating processes or modifying state.
Supported transports¶
1. Stdio transport (--mcp)¶
Launch the Daemonitor binary with --mcp:
- Speaks JSON-RPC 2.0 over
stdin/stdout(accepts bothContent-Length: N\r\n\r\nLSP-style framing and single-line JSON; writesContent-Lengthframed UTF-8 responses). - Supported JSON-RPC methods:
initialize(default protocol version2026-07-28),notifications/initialized,server/discover,tools/list,tools/call, andping.
Example MCP client configuration (stdio):
{
"mcpServers": {
"daemonitor": {
"command": "/Applications/Daemonitor.app/Contents/MacOS/Daemonitor",
"args": ["--mcp"]
}
}
}
2. Optional local HTTP transport¶
Disabled by default (mcpEnabled = false). Enable it in Desktop → Settings → Enable MCP:
- Binds strictly to
127.0.0.1onmcpPort(default17333):http://127.0.0.1:17333/mcp. - Accepts
POSTonly (GETand other methods return405; SSE streams are not supported). - Requires authentication via either:
Authorization: Bearer <token>X-Daemonitor-MCP-Token: <token>- Copy both the endpoint URL and the auto-generated 32-byte Base64URL token directly from Settings.
Registered MCP tools¶
All registered tools carry readOnlyHint: true, destructiveHint: false, and additionalProperties: false (DaemonitorMcpServer.kt).
daemonitor_current_processes¶
Return currently visible build processes with defense-in-depth redacted command lines and build_system, runtime, and toolchain classification fields.
| Parameter | Type | Required | Allowed values | Description |
|---|---|---|---|---|
build_system |
string | No | gradle, bazel, xcode, amper, unknown |
Filter live processes by build system |
runtime |
string | No | jvm, native, unknown |
Filter live processes by runtime |
toolchain |
string | No | java, kotlin, swift, clang, cpp, go, rust, unknown |
Filter live processes by toolchain |
Invalid filter values return JSON-RPC error -32602.
- Returns: JSON
{ "processes": [...] }.
daemonitor_builds_for_process¶
Find retained builds executed by a daemon PID or matching process text.
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
process |
string | Yes | — | Numeric PID, daemon identity, project path, working directory, or command-line substring |
limit |
integer | No | 1..200 (default 50) |
Maximum matched builds and process samples |
include_metrics |
boolean | No | Requires limit <= 20 |
Attach persisted bazelDetails BEP telemetry on Bazel builds |
- Behavior: If
processparses as a numeric PID, queriesbuilds.findByDaemon(pid, limit)andsamples.findByPid(pid, limit). Otherwise searches builds and scans the 200 most recent process samples for case-insensitive substring matches. - Returns: JSON
{ "process": "...", "matchedBuilds": [...], "matchedProcessSamples": [...] }.
daemonitor_search_history¶
Search retained build history by build ID, command, project, status, source, or coding agent.
| Parameter | Type | Required | Constraints | Description |
|---|---|---|---|---|
query |
string | No | Empty returns most recent builds | Free-text search query |
limit |
integer | No | 1..200 (default 50) |
Maximum builds returned |
include_metrics |
boolean | No | Requires limit <= 20 |
Attach persisted bazelDetails BEP telemetry on Bazel builds |
- Returns: JSON
{ "query": "...", "builds": [...] }.
Security and privacy¶
- Read-only: No process termination or mutation tools are exposed.
- Localhost only: HTTP binds exclusively to
127.0.0.1. - Origin validation: If an
Originheader is present on HTTP requests, onlylocalhost,127.0.0.1,::1, or[::1]is allowed (otherwise403 Forbidden). - Token auth: Requests without a valid per-install 32-byte random token receive
401 Unauthorized. - Redaction:
daemonitor_current_processesappliesRedactor.redactCommandLinebefore serializing process arguments.