mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-22 23:00:31 +03:00
The previous implementation buffered stderr from the native mcp-server process and only logged the full buffer content when the process exited. This prevented real-time viewing of logs from the server. This change modifies the native process startup logic (`startProcess_locked`) to use `cmd.StderrPipe()` instead of assigning `cmd.Stderr` to a buffer. A separate goroutine is now launched within the process monitoring goroutine. This new goroutine uses a `bufio.Scanner` to continuously read lines from the stderr pipe and logs them using the Navidrome logger (`log.Info`) with an `[MCP-SERVER]` prefix. This ensures logs from the native mcp-server appear in Navidrome's logs immediately as they are written. (Note: Also includes update to McpServerPath constant to point to the native binary.) Signed-off-by: Deluan <deluan@navidrome.org>
This folder abstracts metadata lookup into "agents". Each agent can be implemented to get as much info as the external source provides, by using a granular set of interfaces (see interfaces).
A new agent must comply with these simple implementation rules:
- Implement the
AgentName()
method. It just returns the name of the agent for logging purposes. - Implement one or more of the
*Retriever()
interfaces. That's where the agent's logic resides. - Register itself (in its
init()
function).
For an agent to be used it needs to be listed in the Agents
config option (default is "lastfm,spotify"
). The order dictates the priority of the agents
For a simple Agent example, look at the local_agent agent source code.