feat(ingestion): implement brain_ingest MCP tool

Wraps pipeline.Run with the existing LLM client. Mirrors the HTTP
/ingest and /ingest-path semantics — accepts either path or
content+source, validates mutual exclusion, surfaces an explicit error
when the LLM client is not configured (test-mode).

ctx is threaded through to pipeline.Run for cancellation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mathias Bergqvist
2026-05-01 13:02:02 +02:00
parent 809d435480
commit 8c87460bff
3 changed files with 103 additions and 0 deletions

View File

@@ -122,6 +122,8 @@ func (s *Server) handleCall(ctx context.Context, name string, args json.RawMessa
return s.brainWrite(ctx, args)
case "brain_ingest_raw":
return s.brainIngestRaw(ctx, args)
case "brain_ingest":
return s.brainIngest(ctx, args)
default:
return nil, fmt.Errorf("unknown tool: %s", name)
}