Skip to content

Default MCP search_papers to hybrid mode like pwc search - #19

Merged
NielsRogge merged 1 commit into
mainfrom
claude/mcp-hybrid-search-default
Sep 18, 2026
Merged

NielsRogge merged 1 commit into
mainfrom
claude/mcp-hybrid-search-default

Conversation

@NielsRogge

Copy link
Copy Markdown
Collaborator

Summary

The hosted MCP server's search_papers defaulted to keyword mode while pwc search defaults to hybrid, so the same query returned different results through the CLI skill and through the MCP tools. This aligns both on hybrid.

  • server.py: new shared DEFAULT_SEARCH_MODE = "hybrid" used as the search_papers schema default; the tool docstring now says how to opt out.
  • app.py: the rate limiter classifies an omitted mode as the hybrid default, so default searches count toward the semantic limit instead of bypassing it. Explicit mode: "keyword" still does not count.
  • Tests: schema default asserted; new middleware tests for omitted-mode counting and keyword not counting.
  • Docs: README, SPEC, SKILL updated; the keyword default is no longer listed as a hosted divergence. SKILL tells agents to pass mode: "keyword" for exact terminology or when the semantic limit is close.
  • Version: pwc-mcp 0.2.2 → 0.2.3.

Trade-off

The hosted semantic limit is 10 hybrid/semantic searches per minute per client (PWC_MCP_SEMANTIC_LIMIT). With hybrid as the default, plain search_papers calls now consume that budget; the 11th default search in a minute gets a 429 with Retry-After. Raise PWC_MCP_SEMANTIC_LIMIT on the hosted component if that proves too tight for chat sessions.

Verification

cd mcp_server && uv run pytest -q   # 56 passed

Rollout: deploy with pwc-deploy <env> <sha> --component mcp (staging first).

🤖 Generated with Claude Code

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>
@NielsRogge
NielsRogge merged commit fc009ff into main Sep 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant