Commit Graph

9 Commits

Author SHA1 Message Date
moze
943a38fd36 fix(mcp): relax library id and name matching
All checks were successful
Build and publish Docker image / Build and push CPU image (push) Successful in 2m11s
Build and publish Docker image / Build and push GPU image (push) Successful in 3m1s
- accept single-segment library ids like /whisper-rtx2080 returned by
  resolve-library-id in get-library-docs
- accept common owner-qualified aliases such as /mozempk/whisper-rtx2080
  when the indexed repo is stored as a single-segment name
- accept single-segment ids with explicit versions such as
  /whisper-rtx2080/v0.0.1
- relax resolve-library-id scoring across separator-only differences so
  queries like whisperrtx2080 still match whisper-rtx2080
- update MCP tool descriptions to document the accepted id formats

Validated with focused regression tests:
- TrueRefMcpToolsTest
- LibraryResolverTest
2026-05-06 10:53:09 +02:00
moze
bfb6bb5e8c fix(mcp): harden malformed transport error bodies
All checks were successful
Build and publish Docker image / Build and push CPU image (push) Successful in 2m16s
Build and publish Docker image / Build and push GPU image (push) Successful in 3m4s
- register a Jackson mixin for io.modelcontextprotocol.spec.McpError
- strip Throwable internals such as stackTrace, cause and suppressed
  from SDK-owned MCP HTTP error responses
- keep malformed Streamable HTTP requests bounded to a minimal JSON body
  like {"message":"Session ID missing"}

Validated locally:
- POST /mcp tools/list without Mcp-Session-Id -> 400 {"message":"Session ID missing"}
- POST /mcp initialize -> 200
2026-05-06 09:18:46 +02:00
moze
e54e1dd33b fix(mcp): align SDK and wire streamable server manually
All checks were successful
Build and publish Docker image / Build and push CPU image (push) Successful in 2m10s
Build and publish Docker image / Build and push GPU image (push) Successful in 3m2s
- align all io.modelcontextprotocol.sdk artifacts to 0.18.1 via
  dependencyManagement so Spring AI transitives no longer pull mcp 0.10.0
- exclude Spring AI's legacy MCP server/webmvc auto-config, which is binary-
  incompatible with the 0.18.1 streamable transport APIs
- build McpSyncServer directly against WebMvcStreamableServerTransportProvider
  and adapt Spring AI ToolCallbacks to MCP SyncToolSpecifications manually
- keep /mcp as the sole Streamable HTTP endpoint for both initialize/tool calls
  and optional SSE event streams
- update MCP transport documentation to match the new runtime

Validated locally with:
- POST /mcp initialize -> HTTP 200 + Mcp-Session-Id
- POST /mcp tools/list -> returns resolve-library-id + get-library-docs
2026-05-06 03:05:22 +02:00
moze
343a4ff3c3 feat(mcp): migrate to Streamable HTTP transport (MCP spec 2025-03-26)
All checks were successful
Build and publish Docker image / Build and push CPU image (push) Successful in 2m7s
Build and publish Docker image / Build and push GPU image (push) Successful in 2m56s
- Upgrade mcp-spring-webmvc from 0.10.0 to 0.18.1 (adds
  WebMvcStreamableServerTransportProvider alongside the legacy SSE provider)
- Add mcp-json-jackson2 0.18.1 for JacksonMcpJsonMapper adapter
- Exclude McpWebMvcServerAutoConfiguration (SSE transport) via
  spring.autoconfigure.exclude; register WebMvcStreamableServerTransportProvider
  and its RouterFunction manually in McpConfig so Spring AI's
  McpServerAutoConfiguration picks up the correct transport bean
- Remove sse-message-endpoint / sse-endpoint from application.yml;
  all MCP traffic now flows through POST+GET /mcp
- Remove McpSseMethodNotAllowed workaround from WebConfig and drop
  'sse' from SPA fallback exclusions (no longer needed)

Clients should connect with type: http at https://trueref.sal.giize.com/mcp
2026-05-06 02:34:27 +02:00
moze
c3e657e2a1 fix: return 405 on POST /sse so MCP clients fall back to legacy SSE transport
All checks were successful
Build and publish Docker image / Build and push CPU image (push) Successful in 2m8s
Build and publish Docker image / Build and push GPU image (push) Successful in 3m1s
Modern MCP clients (Claude Code, etc.) probe for Streamable HTTP transport by
POSTing an InitializeRequest to the server URL first. Per MCP spec 2025-11-25,
they fall back to legacy HTTP+SSE only on 400/404/405.

Previously, POST /sse fell through the SPA resource resolver (which had 'sse'
missing from EXCLUDED_PREFIXES) and returned 500, causing clients to abort
instead of retrying with the GET-based SSE handshake.

Fix:
- Add 'sse' to EXCLUDED_PREFIXES so the SPA resolver ignores that path
- Add explicit @PostMapping("/sse") returning 405 Method Not Allowed with
  Allow: GET header — the correct signal for Streamable HTTP probe fallback
2026-05-06 02:08:32 +02:00
moze
cfb35b35c0 fix: suppress SSE client-disconnect noise in GlobalExceptionHandler
All checks were successful
Build and publish Docker image / Build and push CPU image (push) Successful in 2m9s
Build and publish Docker image / Build and push GPU image (push) Successful in 3m0s
AsyncRequestNotUsableException is thrown when the SSE client disconnects
before the server finishes writing (normal: browser tab close, MCP
client reconnect). The catch-all handler was logging it at ERROR level
and then attempting to write a JSON ErrorResponse onto a text/event-stream
response that no longer had a converter, producing a second spurious
HttpMessageNotWritableException log entry.

Fix: add a dedicated @ExceptionHandler(AsyncRequestNotUsableException)
that logs at DEBUG only and returns void (no body).
2026-05-06 01:53:09 +02:00
moze
e7a8aa95fc fix: add missing port/out and adapter/out sources; fix .gitignore and .dockerignore
All checks were successful
Build and publish Docker image / Build and push CPU image (push) Successful in 2m16s
Build and publish Docker image / Build and push GPU image (push) Successful in 3m6s
- .gitignore had bare 'out/' matching source directories; changed to '/out/'
- All 45 files under trueref-domain/port/out and trueref-adapters/.../out
  were silently excluded from the initial commit
- Added .dockerignore to exclude data/, runtime/, logs/ from build context
2026-05-06 01:36:14 +02:00
moze
0a7fc2c84d ci: fix docker workflow - registry cache, build-push-action@v6, REGISTRY_TOKEN
Some checks failed
Build and publish Docker image / Build and push CPU image (push) Failing after 51s
Build and publish Docker image / Build and push GPU image (push) Failing after 1m2s
- Replace type=gha cache (disabled on this runner) with type=registry cache
- Upgrade docker/build-push-action v5 → v6 (matches whisper-rtx2080 pattern)
- Switch auth to REGISTRY_USERNAME/REGISTRY_TOKEN repo secrets
- Split into two parallel jobs (build-cpu / build-gpu) for visibility
- Use github.ref conditions (Gitea compat) instead of is_default_branch
2026-05-06 01:20:51 +02:00
moze
c5f950c2c0 Initial commit: trueref v0.1.0-SNAPSHOT
Some checks failed
Build and publish Docker image / Build and push (push) Failing after 1m27s
Java 21 / Spring Boot 3.5.3 multi-module Maven project.
Hybrid BM25+HNSW search with RRF, cross-encoder reranker,
ONNX Runtime 1.22.0 (CPU + CUDA 12 GPU variants).
2026-05-06 00:49:16 +02:00