Files
WeKnora/internal/mcpserver
lyingbug 2e712a97a1 fix(mcp): return accessible image URLs from existing tools (#3650)
* fix(mcp): return accessible image URLs from existing tools

* fix(mcp): resolve resource URLs via binding lookup and cover shared KBs

- Look up the KBs that bind each reference instead of scanning every
  allowed KB, and cache per-KB grants for the call. Unrestricted
  endpoints accept any KB the caller can view, so ask answers drawing
  on agent-selected shared KBs get links too.
- Share grant/owner-tenant resolution with scopedKBContext via
  authorizeKB; log non-denial authorization errors.
- Drop the redundant resource-catalog re-wrap; both sources are
  already wrapped.
- Skip the structured-content round trip when no storage reference is
  present, rewrite non-object results, and log marshal/decode failures.
- Quote ask image lines with strconv.Quote so & stays literal, and
  never cut an excerpt inside a storage reference.
2026-09-24 11:56:25 +08:00
..