MCP stdio server exposing rag_query over a hybrid BM25+cosine index for retrieval-augmented generation. Supports semantic and lexical search over source code, markdown docs, and git commits.
Single tool 'rag_query' has a well-structured schema with proper JSON Schema types and reasonable parameter constraints (top: 1-20, required query). Description is detailed (194 chars) and explains the hybrid search capability, auto-scoping behavior, and use case. However, parameter descriptions are sparse: 'scope_types' and 'scope_repos' lack actionable guidance on valid values; 'cwd' is minimally described. Output schema is not documented, callers cannot predict the structure of results. Error handling is basic (generic exception → -32000 error code) with no recovery guidance. No tool annotations (readOnlyHint, idempotentHint) despite being read-only. The tool is directly visible in ragcore/mcp_server.py with explicit registration, so no inference penalty applies.
Hybrid semantic + BM25 search over the indexed corpus: source code (Python/TS/JS/Shell), markdown docs (README, CHANGELOG, docs/**), and recent git commits across the configured source roots. Returns top-K chunks with path:line + symbol + repo citations. Auto-scopes to the current source root when cwd is inside one — pass scope_repos=['all'] to disable. Use instead of grep for fuzzy or cross-file recall.
Output schema not documented. Callers cannot predict the structure of search results (rank, rrf, cos, bm25, source_type, repo, symbol, path, start_line, end_line, text fields). LLMs need explicit output schemas to plan downstream operations.
Parameter descriptions lack actionable constraints. 'scope_types' says 'source types: code, repo-docs, repo-readme, changelog, spec, roadmap, commit' but does not clarify if these are enums, if multiple can be passed, or what happens if an invalid type is provided. Should be: 'Array of source type filters (enum: code, repo-docs, repo-readme, changelog, spec, roadmap, commit). If empty, all types are searched.'
Error handling provides no recovery guidance. Exception caught as generic -32000 error with only the exception message. Should categorize errors (e.g., 'Query too short', 'Invalid scope_repos', 'Index not found') and suggest next steps: 'Try a longer query' or 'Call with scope_repos=["all"] to search all repositories.'
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 69 | 2026-07-28+ | v2 |
Tool lacks annotations despite being read-only and idempotent. Should include 'readOnlyHint': true in TOOL_SCHEMA to signal to clients that this tool does not modify state and is safe to call repeatedly.
Parameter 'cwd' description is minimal ('working dir to drive auto-scoping (defaults to server cwd)'). Should clarify: 'Absolute path to the working directory. If inside a configured source root, results are auto-scoped to that root unless scope_repos=["all"] is passed. Defaults to the server process working directory.'