mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 20:34:19 +00:00
The dashboard needs to phrase each finding in the reader's language, so a finding now names what it is about (variable name, command, or host) in a separate subject field instead of only inside the English message. The value of a variable is still never included. GET /api/mcp/check serves the same report as `mcp check --json` so the MCP page can run the check on demand. It is read-only, writes no oplog entry, returns 200 when findings include errors, and accepts ?dns=0 to skip host lookups.
22 lines
612 B
Go
22 lines
612 B
Go
package server
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"skillshare/internal/mcp"
|
|
)
|
|
|
|
// handleMCPCheck answers `skillshare mcp check --json` for the dashboard. It is read-only
|
|
// and writes no operation log entry. Findings that are errors still return 200; only a
|
|
// check that cannot run fails the request. ?dns=0 skips host lookups.
|
|
func (s *Server) handleMCPCheck(w http.ResponseWriter, r *http.Request) {
|
|
s.mu.RLock()
|
|
defer s.mu.RUnlock()
|
|
report, err := s.mcpService().Check(mcp.CheckOptions{SkipDNS: r.URL.Query().Get("dns") == "0"})
|
|
if err != nil {
|
|
writeError(w, 400, err.Error())
|
|
return
|
|
}
|
|
writeJSON(w, report)
|
|
}
|