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
..
grep_pattern_test.go refactor(agent): consolidate knowledge retrieval tools into search_knowledge, read_document, list_documents (#3381) 2026-09-18 14:12:22 +08:00
resource_urls.go fix(mcp): return accessible image URLs from existing tools (#3650) 2026-09-24 11:56:25 +08:00
resource_urls_test.go fix(mcp): return accessible image URLs from existing tools (#3650) 2026-09-24 11:56:25 +08:00
scope.go fix(mcp): return accessible image URLs from existing tools (#3650) 2026-09-24 11:56:25 +08:00
scope_test.go fix(mcp): return accessible image URLs from existing tools (#3650) 2026-09-24 11:56:25 +08:00
server.go fix(mcp): return accessible image URLs from existing tools (#3650) 2026-09-24 11:56:25 +08:00
server_test.go fix(mcp): return accessible image URLs from existing tools (#3650) 2026-09-24 11:56:25 +08:00
tools_ask.go fix(mcp): return accessible image URLs from existing tools (#3650) 2026-09-24 11:56:25 +08:00
tools_ask_image_test.go fix(mcp): return accessible image URLs from existing tools (#3650) 2026-09-24 11:56:25 +08:00
tools_ingest.go feat(mcp): add built-in MCP server with per-workspace endpoints (#3371) 2026-09-17 22:40:05 +08:00
tools_retrieve.go refactor(agent): consolidate knowledge retrieval tools into search_knowledge, read_document, list_documents (#3381) 2026-09-18 14:12:22 +08:00
tools_wiki.go fix(mcp): expose wiki output in structured content (#3590) 2026-09-24 11:49:57 +08:00
tools_wiki_test.go fix(mcp): expose wiki output in structured content (#3590) 2026-09-24 11:49:57 +08:00