Bridge Search
Skill Sarakael78/Bridge-Search
Blazing-fast WSL2 to Windows file search bridge for AI Agents via MCP
npx -y skills add Sarakael78/Bridge-SearchAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Set up and operate the WSL2-to-Windows search bridge for Everything (`es.exe`), AnyTXT via its HTTP Search Service only, and the `bridge_search` MCP package. Use when working across `/mnt/c` and Windows drive paths such as `C:\`, `D:\`, `E:\`, `F:\`, and `X:\`, when you need fast Windows filename search, full-text file-content search on Windows, or when enabling this repo’s MCP server (`scripts/server.py` wrapper or `python -m bridge_search`). Do not look for or rely on an AnyTXT CLI binary; in this workflow AnyTXT is HTTP-only.
SKILL.md
14.9 KB, as published. Nobody here has run it
Bridge Search
Use this skill to set up and run the MCP bridge: implementation lives in bridge_search/; scripts/server.py is a thin compatibility launcher. This is the authoritative bridge for cross-OS search and file management.
Installation, mcporter, troubleshooting, and security: see README.md in this repo.
Files
bridge_search/: authoritative Python package —server.py(MCP registration),search_backends.py(Everything, AnyTXT, WSL find/grep),file_ops.py(guarded I/O),path_policy.py(allow/denylist),config.py(config loading),result_models.py(response helpers),constants.py(error codes).scripts/server.py: compatibility wrapper that adds the repo root tosys.paththen runsbridge_search.server.scripts/rediscover_anytxt_endpoint.py: standalone runtime discovery command that probes candidate AnyTXT URLs, persists the working endpoint, and prints a concise report.bridge_search/__main__.py: same MCP stdio entry as the server when run aspython -m bridge_search(requires package import path).config/bridge-search.config.example.json: optional JSON policy (copy toconfig/bridge-search.config.json;BRIDGE_SEARCH_CONFIGcan point elsewhere — see README). Profile examples:config/bridge-search.config.everything-only.example.json,config/bridge-search.config.anytxt-only.example.json,config/bridge-search.config.everything-and-anytxt.example.json. Usebackendsfor other combinations (e.g. WSL-only).references/install-registration.md: concise install/registration notes, including themcporterpackage-name gotcha and verification steps.references/repo-discovery-audio-stem-separation.md: session notes on finding and validating an audio stem-separation repo across Windows and GitHub.
Workflow
- Confirm WSL2 is the current environment.
- Directory Naming (MANDATORY for Discovery): If you have just cloned this repository and the folder is not named
windows-search, you must rename it towindows-searchbefore proceeding. Agent discovery of this skill is tied to the folder name. - Verify Python 3.10+ and the
mcppackage are available (prefer./install.shfrom thewindows-searchroot on Debian/Ubuntu WSL—it installs missingpython3/pip/venvviaaptwhen needed, then runssetup_skill.py --venv; otherwise runpython3 scripts/setup_skill.py --venv; add--devas needed;--skip-checksif backends exclude Windows services). Ifsudoprompts for a password, the human must run./install.shlocally. - For rediscovering a previously used Windows repo or app, search by tool/repo name variants first, then verify with
git rev-parse --is-inside-work-treeandgit remote -vbefore treating a folder as canonical. Seereferences/repo-discovery-audio-stem-separation.mdfor a compact example. - Confirm Windows-side prerequisites match
backendsinconfig/bridge-search.config.json(defaults: Everything + AnyTXT):
- Voidtools Everything is installed and running (if
backends.everything).es.execomes from the Everything CLI package on Voidtools downloads—it is a separate download from the main GUI installer. es.exeresolution order is explicit: first WindowsPATH; if not found, check the standard install pathsC:\Program Files\Everything\es.exeandC:\Program Files (x86)\Everything\es.exe.- AnyTXT Searcher is installed and the HTTP Search Service is enabled on the configured URL (probe the live WSL host gateway; a typical WSL2 URL is
http://<wsl-default-gateway>:9921, and older sample docs may mention9920) ifbackends.anytxt. The bridge talks to the live HTTP search service, and on this host that service is the Wt HTML search UI: fetch the session page, extract the tokenised form controls, and submit the search form when a JSON endpoint is not available. Do not look for an AnyTXT CLI binary.- Optional:
curl http://$(ip route show default | awk '{print $3; exit}'):9921/or rely onsetup_skill.pypost-install probes. From WSL, test the Windows host IP if localhost routing fails. Treat the Wt HTML search page returning HTTP 200 without the expected search form as “service reachable, bridge API/UI path not yet compatible/configured”, not as an unreachable service. - For endpoint recovery, use
python3 scripts/rediscover_anytxt_endpoint.pyfirst. It performs a lightweight UI/session probe and persists the working URL; add--verify-searchonly when you need content-search confirmation. The helper first checksC:\ProgramData\Anytxt\config\config.dbforHttpSearch; if that setting is0, the HTTP Search Service is disabled and rediscovery cannot succeed until the service is enabled in the AnyTXT app.
- Optional:
- Tool-Only Enforcement:
- DO NOT call
es.exeorgrepdirectly viarun_shell_commandif the MCP server can be started. - DO NOT search for an AnyTXT executable. It is handled exclusively via HTTP on the configured service port.
- DO NOT call
- Use this search order:
- Everything (
locate_file_or_folder, defaulttarget_env=windows) for filename/path search. Useeverywhereonly when you also need WSL-sidefind(scoped to$HOMEby default; full/requires config orBRIDGE_SEARCH_ALLOW_ROOT_LOCATOR=1). - AnyTXT (
locate_content_inside_files) for content search. - Accept a "zero-hit" from Everything as no match in Everything’s indexed scope for that query (usually “not found” unless indexing lag, wrong filters, or path outside indexed locations—see Guardrails).
- Everything (
- Default search scope should be the current Windows user’s document-style folders, for example under the profile (e.g.
%USERPROFILE%\Documents,%USERPROFILE%\Desktop,%USERPROFILE%\Downloads). Adjust to the user’s actual layout when known. - For OneDrive searches, start at the configured OneDrive root (for example
D:\OneDrive) and search the full tree first. Do not split the job into multiple narrower subdirectory searches unless there is a specific reason to isolate a subtree. - For large WSL-to-OneDrive backups, use
references/large-archive-onedrive-backup.md: create/hash the archive on WSL/ext4 first, then copy to OneDrive with temporary names and size verification, because large archive reads or compression directly on/mnt/<drive>/OneDrivecan fail with transientCannot allocate memoryerrors.
Tool selection
locate_file_or_folder: filename/path search. Default totarget_env=windowsfor Windows files. Query text must not be blank.locate_content_inside_files: indexed content search. Usetarget_env=windowsfor AnyTXT-only searches andeverywherewhen you intentionally want WSL grep too.map_directory: get scoped structure before broad file operations or when you need pagination through a tree.manage_file: read, write, copy, move, delete, and mkdir with policy checks and explicit mutation semantics.get_health: diagnose backend reachability before inventing workarounds. Successful probes should refresh the last-known-good AnyTXT URL in config.
Guardrails
- The Absolute Zero Rule: If Everything (
es.exe) returns no hits for a filename query, STOP. Do not escalate to a slower brute-forcefindorgrepon/mnt/c/. A zero is a high-signal “no match” for that query in the indexer unless the human says Everything is still indexing, the file lives outside indexed paths, or the query/filters were wrong—in those cases, refine the query or scope; still do not brute-force/mnt/c. - Bridge-Only Execution: Use
manage_file,map_directory,locate_file_or_folder, andlocate_content_inside_filesfor all operations. Do not hand-roll path conversions or shell commands. - Query validation: Blank or whitespace-only queries are rejected with
query_required. Do not use empty searches to probe backends. - Encoding & Quoting: The bridge tools handle Windows path quoting and
cp1252encoding. Manualrun_shell_commandcalls are likely to fail on paths with spaces or special characters. - AnyTXT is a Service: Treat AnyTXT as a networked local service. If search fails, debug the live HTTP search service or its configured URL, not the local filesystem.
- AnyTXT root page caveat:
http://<host>:9921/returning HTTP 200 only proves the web UI is reachable. The bridge content backend must be able to drive the live search surface actually exposed by the service (JSON API where present, otherwise the Wt HTML form with its session token and controls); if the page lacks the expected search form or the probe cannot complete a real search, reportanytxt_incompatible_endpointrather than treating the service as healthy. Do not equate a reachable root page with bridge-compatible content search. Keep the resolved endpoint inconfig/bridge-search.config.jsonas the last-known-good value and refresh it if the listener moves; successful health/content searches should write the verified endpoint back into config. - Structured results: All bridge tools return
success,results,errors,warnings, andmeta. Issues include stable machine-readablecodefields. A clean zero-hit search is not an error. - Partial backend failures: In multi-backend searches,
successcan still betruewhen one backend returns hits and another errors or times out; always readerrorsandwarnings. If botherrorsandresultsare non-empty,meta.degradedistrue. - Privacy & Noise: Ignore
AppData, browser profiles,node_modules, and caches unless explicitly instructed otherwise. - Path policy: Reads, writes,
map_directory, and WSL grep roots honor the same denylist (resolved paths under/etc,/mnt/c/Windows,/usr,/var, etc. are blocked). OptionalBRIDGE_SEARCH_ALLOWED_PREFIXESand configallowed_prefixesrestrict file operations to those prefixes and, when set, filter search tool result rows (Everything/find, WSLgrep, AnyTXT) to matching paths. The env parser accepts:or;; prefer;when any Windows-styleC:\...path is present. If you want the bridge to search additional Windows volumes, explicitly include their roots, for exampleD:\;E:\;F:\;X:\or/mnt/d;/mnt/e;/mnt/f;/mnt/x. Config entries may be WSL or Windows absolute paths. - Confirmation flag:
is_confirmedis an agent workflow toggle—not authorization, not cryptographic proof of human approval, and not a substitute for OS-level approval. All writes and deletes still require it so the model explicitly opts in. - Safer file mutations:
manage_filewill not overwrite existing destinations on copy/move unlessoverwrite=True, refuses source==destination and directory-into-itself operations, and refuses deletion of filesystem root or the current home directory. - Encoding & symlinks:
manage_file(read)tries common text encodings (utf-8, BOM variants,utf-16,cp1252) before failing. Mutating operations (write,copy,move,mkdir) are blocked on symlink paths; if you really mean the target, resolve and pass the real path explicitly.deleteremoves the symlink itself. - WSL grep default root: Empty
wsl_search_pathuses$HOME. Grep from/needsallow_grep_from_filesystem_rootinconfig/bridge-search.config.jsonorBRIDGE_SEARCH_ALLOW_ROOT_GREP=1. When root grep is allowed, the bridge still avoids traversing/mnt. - Config file: Optional
config/bridge-search.config.json(seeconfig/bridge-search.config.example.json) adjusts denylist strength, confirmation flags, grep-from-root, and resource caps without editing Python. Example files include_security_warning: relaxing settings is at your own risk (see README for what can go wrong).
Integration: Legal Research
- Primary Provider: This skill (
bridge-search) is the sole provider of Windows-side file discovery for thelegal-local-researchskill. - Cross-Matter Context: When
legal-local-researchneeds to check for prior matters or precedents stored on the Windows host, it must call this bridge.
Fast mental model
- Everything =
locate_file_or_folder(Fastest) - AnyTXT =
locate_content_inside_files(Indexed Content over AnyTXT’s HTTP Search Service) - Diagnostic =
get_health(Check connectivity/services) - AnyTXT Port = the configured HTTP service root on the current WSL host gateway (for example
http://<wsl-default-gateway>:9921). Windows Search itself is not a network service. - WSL2 Localhost = Host discovery uses the WSL default route gateway when
/etc/resolv.confis owned by Tailscale or another DNS provider. - No hit from Everything = No match in the indexer for that query (treat as “not found” unless indexing/scope/query issues apply). Stop brute-forcing
/mnt/c. - If
everything_help_text()or a Windows filename query hangs inside Python but a shell call toes.exeworks, suspect a bridge-side deadlock or interop issue rather than Everything itself. In particular, the help-path must not take a non-reentrant lock and then callresolve_es_exe()again; use a re-entrant lock or split the cache path from the lookup path. - Everything execution is intentionally PowerShell-wrapped from WSL. Regression tests should assert against a flattened argv/PowerShell command string, not raw list membership, and
path_policy.resolve_path()must tolerate mockedsubprocess.run(..., text=True)returning bytes. - For a mounted AnyTXT public path, pair the tunnel rule with a local prefix-stripping proxy and keep the upstream listener private; see
references/anytxt-path-prefix-proxy.md.
References
references/anytxt-http-api-notes.md: HTTP API/probe caveat and filename-vs-content search distinction.references/anytxt-endpoint-runtime-discovery.md: last-known-good endpoint persistence and rediscovery notes.references/anytxt-path-prefix-proxy.md: mounted-path AnyTXT proxy pattern, verification checklist, and pitfalls.
When details matter
Use README.md for install, troubleshooting, and security. Implementation details live in the bridge_search/ package (the authoritative source): server.py, search_backends.py, file_ops.py, path_policy.py, config.py, and result_models.py. The scripts/ directory contains compatibility wrappers and the installer.