fastmcp/examples/search
nate nowack 3685866cd8
client: deprecate inferring stdio transports from str, prefer Path (#4941)
* spike: refuse stdio inference from str

* client: infer stdio transports from Path only, never from str

🤖 Generated with Claude Code

* client: deprecate inferring stdio transports from str, prefer Path

🤖 Generated with Claude Code

* client: point the stdio deprecation at the first external frame; migrate proxy docs to Path

🤖 Generated with Claude Code
2026-08-31 10:29:08 -05:00
..
client_bm25.py client: deprecate inferring stdio transports from str, prefer Path (#4941) 2026-08-31 10:29:08 -05:00
client_regex.py client: deprecate inferring stdio transports from str, prefer Path (#4941) 2026-08-31 10:29:08 -05:00
README.md Narrate search example clients (#3321) 2026-02-27 12:17:31 -05:00
server_bm25.py Narrate search example clients (#3321) 2026-02-27 12:17:31 -05:00
server_regex.py feat: Search transforms for tool discovery (#3154) 2026-02-26 22:42:38 -05:00

Search Transforms

When a server exposes many tools, listing them all at once can overwhelm an LLM's context window. Search transforms collapse the full tool catalog behind a search interface — clients see only search_tools and call_tool, and discover the real tools on demand.

Two search strategies

Regex (RegexSearchTransform) — clients search with regex patterns like add|multiply or text.*. Fast and precise when you know what you're looking for.

BM25 (BM25SearchTransform) — clients search with natural language like "work with numbers". Results are ranked by relevance using BM25 scoring. The index rebuilds automatically when tools change.

Both strategies respect the full auth pipeline: middleware, visibility transforms, and component-level auth checks all apply to search results.

Run

# Regex
uv run python examples/search/client_regex.py

# BM25
uv run python examples/search/client_bm25.py