MCP Integration
Connect OpenDaemon to MCP clients for AI-driven service operations.
OpenDaemon can run as an MCP stdio server with dmn mcp, allowing AI clients
to inspect status/logs and control services.
Quick setup
- Validate your config:
dmn mcp --check --config /absolute/path/to/dmn.json- Add OpenDaemon to your MCP client config.
- Restart your IDE/client.
- Ask the AI to list services or check status.
Cursor/Kiro config example
{
"mcpServers": {
"opendaemon": {
"command": "dmn",
"args": ["mcp", "--config", "/absolute/path/to/dmn.json"],
"env": {}
}
}
}Use an absolute --config path to avoid working-directory issues.
Available MCP tools
| Tool | Access | Purpose |
|---|---|---|
list_services | Read | List configured services |
get_service_status | Read | Get current service statuses |
read_logs | Read | Read buffered logs for one service |
watch_logs | Read | Stream logs with duration/pattern stop conditions |
start_service | Write | Start one service (+ dependencies) |
stop_service | Write | Stop one running service |
restart_service | Write | Restart one service |
Key parameters
read_logs:service,lines(numberor"all"), optionalcontains,caseSensitive,stream(stdout|stderr|both)watch_logs:service, plus eitherdurationSecondsoruntilPattern; optionaltimeoutSeconds,pollIntervalMs,maxLines,includeExisting,includePatterns,excludePatterns,caseSensitive,streamstart_service/stop_service/restart_service:service
Runtime routing behavior
- If an extension daemon is active for the same config path, MCP tool calls reuse that runtime.
- Otherwise, MCP uses its own orchestrator runtime for the loaded config.
See Runtime Model for cross-interface details.
Practical validation flow
Try asking your AI assistant:
- "List my OpenDaemon services."
- "Start the frontend service."
- "Check status until frontend is running."
- "Restart frontend and show recent frontend logs."
MCP troubleshooting
dmnnot found: use an absolute binary path in MCP config.- No services returned: verify
--configpoints to the rightdmn.json. - Service action appears to do nothing: check if service is already running, then test with
restart_service. - Extension UI and MCP disagree: confirm both target the same absolute config path.