Default MCP search_papers to hybrid mode like pwc search - #19
Merged
Merged
Conversation
The hosted MCP server defaulted search_papers to keyword mode while the CLI's `pwc search` defaults to hybrid, so the same agent query returned different results depending on which surface it used. Share one DEFAULT_SEARCH_MODE between the tool schema and the rate limiter so an omitted mode is served as hybrid and counted toward the semantic search limit, and document keyword mode as the opt-out for exact terminology or when that limit is close. Bump pwc-mcp to 0.2.3. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The hosted MCP server's
search_papersdefaulted tokeywordmode whilepwc searchdefaults tohybrid, so the same query returned different results through the CLI skill and through the MCP tools. This aligns both onhybrid.server.py: new sharedDEFAULT_SEARCH_MODE = "hybrid"used as thesearch_papersschema default; the tool docstring now says how to opt out.app.py: the rate limiter classifies an omittedmodeas the hybrid default, so default searches count toward the semantic limit instead of bypassing it. Explicitmode: "keyword"still does not count.mode: "keyword"for exact terminology or when the semantic limit is close.Trade-off
The hosted semantic limit is 10 hybrid/semantic searches per minute per client (
PWC_MCP_SEMANTIC_LIMIT). With hybrid as the default, plainsearch_paperscalls now consume that budget; the 11th default search in a minute gets a 429 withRetry-After. RaisePWC_MCP_SEMANTIC_LIMITon the hosted component if that proves too tight for chat sessions.Verification
Rollout: deploy with
pwc-deploy <env> <sha> --component mcp(staging first).🤖 Generated with Claude Code