---
name: project-mcp-soubory
description: "MCP server \"soubory\" - hybridni dotaz nad PG fulltextem a Mongo metadaty pro Dropbox souboru obou studii"
metadata: 
  node_type: memory
  type: project
  originSessionId: 49aa480f-6667-4832-b091-08f333c27872
---

MCP server `soubory` v [mcp_soubory.py](soubory/mcp_soubory.py), registrovan v `U:\janssen\.mcp.json` jako `soubory`.

**Architektura:** Postgres `MongoSoubory.documents` (fulltext tsvector + body) + MongoDB `soubory.{42847922MDD3003,77242113UCO3001}` (metadata + content.*). Source skripty: [scan_files_v1.0.py](soubory/scan_files_v1.0.py), [enrich_files_v1.0.py](soubory/enrich_files_v1.0.py), [enrich_fulltext_v1.2.py](soubory/enrich_fulltext_v1.2.py).

**Tools:**
- `ping` - health check + counts per studie
- `list_studies` - prehled korpusu, ext breakdown, fulltext coverage
- `search(query, study?, ext?, since?, folder?, limit, with_metadata)` - HLAVNI fulltext (websearch_to_tsquery), ranked + ts_headline snippet `<<...>>` + Mongo content.* enrichment
- `read_document(path|mongo_id, offset, length, around_match)` - cele body, slice nebo okno kolem matche
- `get_metadata(path)` - raw Mongo doc bez body
- `recent_files(study?, days, ext?, limit)` - co se zmenilo (mtime)
- `find_duplicates(study?, min_size_kb, limit)` - sha256 groups, wasted_mb_estimate
- `by_author(name, study?, ext?)` - regex na content.author / last_modified_by
- `browse_folder(folder, study?, ext?)` - regex na parent_folders

Pro EML/MSG pouzij `search(..., ext=["eml","msg"])` + `by_author(jmeno, ext=["eml","msg"])` - samostatny email tool je redundantni a navic by se pletl s [[project_graph_email_import]].

**Aliasy studii:** `MDD3003` -> `42847922MDD3003`, `UCO3001` -> `77242113UCO3001`. None = obe.

**Why:** [[project_claude_learning]] - chce se ptat v chatu ("najdi mi dokument o X", "co psal sponsor Y"), nikoli volat CLI.

**How to apply:** Po restartu Claude Code budou nastroje dostupne jako `mcp__soubory__*`. Pred volanim search radeji nejdriv `list_studies` aby clovek vedel co je v korpusu. Pri velkem body pouzij `around_match` misto stahovani celeho dokumentu.
