Skip to content

Project Tracker

Pummelchen edited this page Sep 11, 2026 · 113 revisions

Project Tracker

Home · Installation · Compatibility · Tools Reference · Architecture · Providers · Configuration · Reliability · Security · Self-Hosting · Monitor · Testing · Troubleshooting · Project Tracker


Status of work on MCPSearch. Updated after every push.

Last updated: after adding a self-hosted SearXNG deployment as a no-key provider. Suite at 216 tests.

Legend: ✅ done · 🔧 open · ⚠️ known limitation · 💡 idea


Done

Foundation

  • ✅ Swift 6.3.3 package, strict concurrency (language mode 6), zero build warnings.
  • ✅ MCP stdio server on SDK 0.12.1 with web_search, web_open, web_search_status.
  • ✅ SearchProvider abstraction; MCP layer knows nothing about any vendor.
  • ✅ Weighted Reciprocal Rank Fusion with per-domain diversity capping.
  • ✅ Deterministic URL canonicalization used as the dedup key.
  • ✅ Circuit breakers, token-bucket rate limiting, retry with jitter, response caching.
  • ✅ Three-layer SSRF defence for web_open (lexical, resolution, per-hop redirect).
  • ✅ Nine search adapters plus Jina, each verified against live provider documentation.

Repository hygiene (commit ae65097)

  • ✅ Reconciliation with the GitHub repository: MIT LICENSE preserved, README retitled to match the repo, branch renamed to main, pushed.
  • ✅ No token stored in .git/config; pushes authenticate through the keychain.

Correctness fixes from the documentation audit (commit 15eeac5)

  • ✅ web_open no longer blames a search provider for fetch failures (SearchError.fetchFailed).
  • ✅ WebFetcher no longer discards the real fetch error.
  • ✅ Startpage parse failures no longer reported as DuckDuckGo.
  • ✅ provider=<x> no longer silently degrades to auto-selection.
  • ✅ Removed a double-applied aggregator discount that squared it to 0.49.
  • ✅ Removed four try! sites from the server.
  • ✅ End-to-end tests made hermetic (they inherited ambient API keys).
  • ✅ Provider enum pinned against ProviderID so it cannot drift.

Documentation (commit 6974d65)

  • ✅ Repository README slimmed from 296 to 105 lines: what the project is, why it is worth using, quick start, tool and provider tables, CI badge, and a linked index of wiki pages. Reference detail moved here rather than being duplicated.
  • ✅ Wiki expanded to eleven navigable pages with a consistent navigation strip and verified internal links: Home, Installation, Tools Reference, Architecture, Providers, Configuration, Reliability, Security, Testing, Troubleshooting and this tracker.
  • ✅ The two missing reference pages were written: Installation (requirements, building, client configuration, verification) and Tools Reference (every argument, response field, mode, error category and example call).
  • ✅ Reliability was added as its own page, documenting the timeouts, retries, circuit breakers, rate limits and cache that enforce the "one vendor outage never fails a search" rule, including the failover matrix.

Live verification against a real provider (commit 34e01bb)

  • ✅ Verified the Tavily adapter against the live API with a free-tier key: search, normalization, recency filtering, advanced depth, orchestration, caching and status all behave as designed. A basic search costs 1 credit, advanced 2.
  • ✅ Fixed a real bug the stub tests could not catch. published_date always decoded to nil: the DTO maps multi-word fields with explicit CodingKeys, but the adapter decoded with .convertFromSnakeCase, which rewrites the key to publishedDate before those mappings are consulted. Every stub fixture had omitted the field, and the RFC 1123 date test passed vacuously against a nil date.
  • ✅ Added LiveProviderTests, opt-in and self-skipping, written to be frugal with a metered tier, plus a stub-based regression test for the decoder bug.
  • ✅ .gitignore now excludes config.env and *.env while keeping example.env tracked, so a live key cannot be committed by accident.

Client compatibility (commits c7dca46, eebab38)

Verified against official OpenAI, Anthropic and Open Responses documentation, then encoded as executable tests.

  • ✅ Streamable HTTP transport added behind --transport http, so the remote MCP connectors used by OpenAI's Responses API and Anthropic's Messages API can reach the server. stdio remains the default. Uses the SDK's stateful transport (the stateless one cannot complete a handshake) with a small swift-nio HTTP server in front; swift-nio was already a transitive dependency, so no new download.
  • ✅ Schema hardening. Removed format: "uri" and every default keyword, both of which strict consumers reject; expressed optional arguments as nullable types and listed every property in required, which is what strict mode demands. Two of these were the opposite of the initial assumption: additionalProperties: false is required (not risky) and nullable unions are officially supported.
  • ✅ Output schemas made truthful. All three previously lacked additionalProperties: false and declared fewer required fields than properties, so none would have survived strict validation. Every declared property is now always emitted, with explicit nulls for absent values.
  • ✅ Removed duplicated page text, which had pushed a web_open result to ~25 000 characters. It now travels once; a live fetch dropped from 24 811 to 12 534 characters.
  • ✅ SchemaCompatibilityTests lock all of this in, and TransportConfigurationTests cover CLI parsing.
  • ✅ Open Responses requires no server changes: its published tool types are function only, and MCP appears once as a non-normative example. The wiki records this so it is not re-investigated.

Fusion ordering fix (found by live comparison)

  • ✅ Found a defect that unit tests could not. Comparing providers live, a balanced search fused Tavily with Parallel and returned 100% Tavily — six results, none relevant to the query — while Parallel alone had ranked better. The cause is arithmetic: the score is weight / (k + rank), so once a weight ratio exceeds the reachable rank ratio (k + maxRank) / (k + 1) (about 1.07 for five results at k = 60), one provider's entire list outranks another's. The old weights spanned 1.1 to 0.8, a ratio of 1.375, so Tavily's sixth result beat Parallel's first by 1.82×.
  • ✅ Fixed by collapsing every registry weight to 1.0 and restricting the aggregator discount to the case it was meant for: reselling an index that another provider in the same run already owns, detected from the reported upstream engines. Quality is carried by corroboration and the per-domain cap, which cannot override rank.
  • ✅ Verified live. The same query now interleaves both providers and returns on-topic results throughout, including the Network World piece on commercial Unix and the Linux/Top500 domination articles that Tavily alone had missed.
  • ✅ Also fixed: a single explicitly requested provider that failed reported the generic "All eligible search providers failed" instead of the actual reason, so provider=startpage gave no clue that Startpage was unavailable. The error now carries per-provider reasons.

Self-hosted search (commit e150388)

  • ✅ Local SearXNG running as a no-key provider. deploy/docker-compose.yml plus a settings.yml that enables search.formats: [json] — the one change the stock image needs. Reads Google and Brave without any account.
  • ✅ scripts/searxng_health.py checks reachability, JSON enablement and per-engine contribution. The last of those matters because SearXNG degrades silently: an engine can be CAPTCHA-blocked while the instance still answers, so an index disappears without any error.
  • ✅ Measured: 25/25 queries, 0 failures, 4.1 s/query alongside Tavily. The free Parallel tier exhausts at exactly 20 calls, so a self-hosted instance is a strictly better fallback.
  • ⚠️ Honest limit: engines rate limit our IP independently of the instance. Brave returned "too many requests" and DuckDuckGo "CAPTCHA" under rapid querying, leaving Google CSE carrying most results. Self-hosting removes the key, not the ceiling.

Open — code

  • 🔧 Local rate limits are too conservative for a single-provider setup. DuckDuckGo is throttled to one query per ~10s and, with no other provider configured, that turns into a hard error 41 times out of 50 rather than a slow answer. The limiter should either back off within a search's time budget or the orchestrator should surface a clear "throttled, retry in Ns" rather than an error per query.

  • 🔧 A skip should not consume a fan-out slot. When balanced picks two providers and one is skipped by its breaker or limiter, the slot is wasted even though a third provider was eligible and free. Refilling from the remaining candidates would make the free providers usable as genuine fallbacks.

  • 🔧 Per-result upstream-engine attribution. The duplication discount relies on the upstream engines an aggregator reports for the whole response, which is coarser than per-result attribution. A server that reported its engines per result would let the discount be exact.

  • 🔧 Per-result upstream-engine attribution (original note). Aggregators are discounted, but a URL returned by both Brave and a SearXNG instance that queried Brave still gets a (reduced) second vote instead of collapsing to one independent signal. SearXNG already exposes a per-result engine, which is currently discarded. Clean fix: carry an optional upstreamEngines on SearchResult, set it from the SearXNG adapter, and fold same-family contributions during clustering.

  • 🔧 Adapter test coverage gaps. Startpage has only configuration/parsing coverage; Open Web Search, Parallel Search MCP and Jina Search have no adapter tests. Add contract tests, especially for [[String]] unresponsive_engines and the Parallel excerpts shape.

  • 🔧 JinaSearchProvider is wired but unreachable. SearchPipelineFactory constructs it when JINA_API_KEY is set, but the registry excludes .jina from selection. Either make it a selectable opt-in provider or stop constructing it.

  • 🔧 URLError.localizedDescription reaches last_error. It is surfaced through web_search_status and providers_failed. Mojeek carries its key in the query string, so the risk of a credential appearing in a diagnostic is unverified but not eliminated. Prefer a curated reason string over the platform description.

  • 🔧 Eight force-unwrapped static URL literals in provider adapters (e.g. URL(string: "https://api.tavily.com/search")!). Safe in practice, but they are the only remaining force unwraps in production code.

CI (commit 26dc7ce)

  • ✅ GitHub Actions CI workflow on macos-26 (Xcode 26.x, Swift 6.3): debug build, swift test, release build, stdio smoke test, then swift test again with provider credentials deliberately present to prove hermeticity.
  • ✅ scripts/mcp_smoke.py — dependency-free client that drives the built binary through a real handshake and asserts every stdout line is valid JSON-RPC.
  • ✅ Toolchain asserted up front, so an image change fails with a clear message.
  • ✅ CodeQL is also enabled on the repository by GitHub's default setup.

CI found three defects that local builds had hidden:

  1. macos-14 ships Swift 5.10 and cannot parse a swift-tools-version: 6.3 manifest.
  2. Package.swift declared .copy("Fixtures") for a directory that git does not track, so a clean checkout failed to build while local builds passed.
  3. A trailing defer warning that only a clean build surfaced.

Open — process

  • 🔧 Scheduled provider smoke test. Free tiers are not deterministic, so live provider checks belong in a scheduled job, not on every pull request.
  • 🔧 First tagged release, now that CI is green.

Volume soak: measured provider limits (commit f8a4aec)

50 realistic queries through the real binary, with every provider we have credentials for switched on (Tavily, DuckDuckGo, Startpage, Parallel). Tavily is the only keyed provider; the other three are free.

Measured limits — these are now facts, not estimates:

Provider Behaviour over 50 queries Verdict
Tavily 50/50 succeeded, 1 credit each Reliable while credits last
Parallel (anonymous) exactly 20 successes, then 429 Free tier is ~20 calls per window
DuckDuckGo 9/50, one query per ~10s Usable as a fallback, not a main provider
Startpage 0 results, blocked by Anubis Unusable, as documented

What the run proved about resilience. With Tavily and Parallel both in play, Parallel exhausting its quota degraded the search rather than breaking it: 50 queries produced 241 results and a single hard error, and Tavily carried every query. The circuit breaker stopped hammering the rate-limited provider after 5 rejections and then skipped it (24 further skips) instead of repeating failed calls.

A design flaw the soak exposed. That single hard error was query 44, where the breaker had opened on Parallel and the local token bucket was momentarily empty for Tavily. The request was reported as invalidRequest: all eligible providers were skipped — blaming the caller's query for a transient local condition. Fixed: locally skipped providers now raise a retryable temporarilyUnavailable.

A usability finding. DuckDuckGo never ran in the balanced soak (0/50) because the mode consults only the two highest-ranked providers, which are Tavily and Parallel. The free provider that matched Tavily on quality was therefore unavailable as a fallback.

Open — HTTP transport

  • 🔧 No authentication and no TLS. The HTTP transport binds loopback by default and warns when it does not. A public deployment needs a TLS-terminating reverse proxy, and both vendors prefer OAuth for remote servers. Documented rather than half-implemented.
  • 🔧 No server-initiated streaming. The stateless path of the SDK has none, and the stateful transport streams only per-request responses. Fine for tool calls; would matter for progress notifications during a long search.
  • 🔧 HTTP transport has no automated end-to-end test against a real vendor client. The smoke test drives the protocol directly. A tunnel-based check against OpenAI or Anthropic would be the next level of assurance.

Known limitations

  • ⚠️ A client that closes stdin before reading its replies can lose a response. The MCP SDK dispatches each request to a detached task and marks the transport disconnected as soon as stdin reaches EOF, so a reply already in flight cannot be written. Compliant clients keep stdin open until they have read every response, which is what the stdio transport contract requires, and the shipped smoke test does this. Fixing it properly means owning the stdio transport instead of using the SDK's, which is not justified for non-compliant clients. Recorded here rather than papered over with a sleep.
  • ⚠️ web_open does not execute JavaScript. JS-heavy pages depend on the Jina Reader fallback.
  • ⚠️ Startpage cannot work through a plain HTTP client. It serves an Anubis proof-of-work challenge, so it normally reports itself unavailable.
  • ⚠️ Parallel Search MCP's upstream tool contract is third-party and unverified. Disabled by default behind SEARCH_ENABLE_PARALLEL.
  • ⚠️ "Open Web Search" has no authoritative published specification. The adapter is a configurable, defensively parsed aggregator, active only when OPEN_WEB_SEARCH_URL is set.
  • ⚠️ SearXNG needs JSON enabled. The shipped settings.yml serves only html, so format=json returns 403 until the operator adds json to search.formats.
  • ⚠️ DuckDuckGo serves an "anomaly" bot challenge as HTTP 202, not 403. Handled, but scrape reliability is inherently poor.
  • ⚠️ Google Custom Search JSON and Bing Search APIs are deliberately unsupported: Google's is closed to new customers and retires in 2027; Bing's was retired in August 2025.

Ideas

  • 💡 Use the node cluster as multiple search vantage points. Four Mac Minis plus this machine are reachable (8 CPU / 8 GB each) and all authenticate by SSH key. Engines block by IP, and DuckDuckGo is CAPTCHA-blocked from this machine specifically, so running a SearXNG instance per node would give each one an independent IP and could restore the indexes that are currently lost. Untested. A smaller first step is a shared result cache, since the cluster adds reach rather than index depth.

  • 💡 Local result cache. 24 GB of RAM here and ~70 GB free disk. The in-process cache is already bounded at 256 entries; a disk-backed cache would cut upstream calls substantially for repeated developer queries and reduce engine rate limiting.

  • 💡 Disk cache for repeated coding-agent workflows (v1 is in-memory only).

  • 💡 Optional provider-specific parameter passthrough behind an explicit flag.

  • 💡 web_open PDF text extraction (currently returned as raw bytes only if the content type is textual).

Clone this wiki locally