Feature: return web-console remarks from the Go MCP host tools

list_hosts and get_host_detail now include the remark an admin set in the
web console, and the name/query filters match it like the Win32 server
(name: hostname + remark; query: hostname + remark + IP). The text-only
host table gains a remark column, and the MCP instructions stop claiming
the Go server keeps no remarks.

The remark table is injected through a small Note() interface so the mcp
package still does not import web. An optional Notes() snapshot
capability is borrowed once per call, so a listing neither takes a read
lock per device nor mixes labels across a concurrent save. The design
docs are updated to match the new fields and table column.

Verified: go build ./..., go vet, gofmt and the full go test ./... pass;
new tests cover remark projection, both filters and the snapshot path.

Co-Authored-By: deepseek-flash
This commit is contained in:
yuanyuanxianganddeepseek-flash committed 2026-11-27 14:51:15 +01:00
1 parent 95d2bbc1b6
commit 5f764b2425
8 files changed
+136 -28

No files matched your search

+2
View File
@@ -1292,6 +1292,8 @@ func main() {
Bind: bindAddr,
// Devices bound to a web user are invisible/unreachable through MCP.
DeviceACL: deviceACL,
// Web-console remarks are returned by list_hosts/get_host_detail.
DeviceRemarks: deviceNotes,
})
if mcpSrv.Enabled() {
// Terminal tools need the hub's shell events (ready/data/closed).