Skip to main content
Grounded Docs provides powerful search capabilities combining semantic vector search and keyword matching to find the most relevant documentation.

Search Methods

There are three ways to search documentation:

AI Assistant

Let your AI query documentation automatically

Web Interface

Test queries at http://localhost:6280

CLI

Search from command line
npx @arabold/docs-mcp-server@latest search <library> <query>
npx @arabold/docs-mcp-server@latest search react "useState hook"
From your AI assistant:
{
  "tool": "search_docs",
  "arguments": {
    "query": "useState hook",
    "library": "react",
    "version": "18.x",
    "limit": 10
  }
}

Search Ranking

Results are ranked using a hybrid approach:
1

Vector Search

Semantic similarity using embeddings (if configured)Finds conceptually related content even without exact keyword matches
2

Keyword Search

Full-text search using SQLite FTS5Matches exact terms and phrases
3

Reciprocal Rank Fusion

Combines both rankings for final resultsWeights: 70% vector search, 30% keyword search (configurable)
Vector search requires an embedding model to be configured. Without it, only keyword search is used.

Version Matching

Control which versions are searched:

Version Patterns

Exact Version
string
Match specific version: 18.3.1, 3.12.0
X-Range
string
Match latest within range: 18.x, 3.x18.x matches latest 18.x.x version
Latest
string
Match most recent version: latest
Wildcard
string
Search all versions: * or omit version

Examples

npx @arabold/docs-mcp-server@latest search react "hooks" --version 18.3.1
Only searches React 18.3.1 documentation

Query Formulation

Best Practices

Be Specific

“useState hook initialization” is better than “hooks”

Use Natural Language

“How to handle authentication” works well with semantic search

Include Context

“React server components data fetching” vs just “data fetching”

Technical Terms

Include API names, class names, or method names

Query Examples

Good Queries:
  • “useState hook initial state”
  • “express middleware error handling”
  • “pandas DataFrame merge join”
Avoid:
  • “state” (too broad)
  • “how to use” (too generic)
Good Queries:
  • “Next.js middleware configuration”
  • “Django database settings production”
  • “TypeScript tsconfig strict mode”
Avoid:
  • “configuration” (too broad)
  • “settings” (too generic)
Good Queries:
  • “React hydration mismatch error”
  • “Python ImportError module not found”
  • “PostgreSQL connection pool exhausted”
Include:
  • Error messages
  • Specific symptoms
  • Component or module names

Search Parameters

query
string
required
Search query text
library
string
Library name to search within (omit to search all)
version
string
Version pattern to match (18.x, latest, *)
limit
number
default:"10"
Maximum number of results to return
offset
number
default:"0"
Number of results to skip (for pagination)

Search Results

Each result includes:
title
string
Document title
content
string
Text excerpt with matched content
url
string
Source URL of the documentation
library
string
Library name
version
string
Version number
score
number
Relevance score (higher is better)
metadata
object
Additional metadata (file path, document type, etc.)

Example Output

[
  {
    "title": "useState – React",
    "content": "useState is a React Hook that lets you add a state variable to your component...\n\nconst [state, setState] = useState(initialState)",
    "url": "https://react.dev/reference/react/useState",
    "library": "react",
    "version": "18.3.1",
    "score": 0.89,
    "metadata": {
      "chunkIndex": 0,
      "documentType": "html"
    }
  }
]
Search across multiple libraries:
# Search all libraries
npx @arabold/docs-mcp-server@latest search "authentication middleware"

# Results from react, express, django, etc.

Version Comparison

Find differences between versions:
npx @arabold/docs-mcp-server@latest search react "Suspense" --version 17.x
Compare results to understand API changes.

Pagination

Retrieve more results:
# First 10 results
npx @arabold/docs-mcp-server@latest search python "asyncio" --limit 10

# Next 10 results
npx @arabold/docs-mcp-server@latest search python "asyncio" --limit 10 --offset 10

Performance Optimization

Enable Embeddings

Configure an embedding model for semantic search

Specific Libraries

Search within specific libraries rather than all

Version Patterns

Use version patterns to narrow search scope

Limit Results

Set appropriate --limit to reduce processing time

Search Configuration

Tune search behavior:
search.vectorWeight
number
default:"0.7"
Weight for vector search in RRF (0.0 to 1.0)
search.overfetchFactor
number
default:"3"
Retrieve 3x more candidates before final ranking
# Prefer keyword search
DOCS_MCP_SEARCH_VECTOR_WEIGHT=0.3 npx @arabold/docs-mcp-server@latest search react "hooks"

# Prefer semantic search
DOCS_MCP_SEARCH_VECTOR_WEIGHT=0.9 npx @arabold/docs-mcp-server@latest search react "hooks"

Troubleshooting

Problem: Search returns empty resultsSolutions:
  • Verify library is indexed: npx @arabold/docs-mcp-server@latest list
  • Check version pattern matches indexed versions
  • Try broader query terms
  • Search all libraries (omit --library)
  • Check indexing completed successfully
Problem: Results don’t match query intentSolutions:
  • Make query more specific
  • Include more context terms
  • Enable embedding model for semantic search
  • Adjust search.vectorWeight configuration
  • Use exact phrases in quotes
Problem: Error: “No versions found matching pattern”Solutions:
  • List available versions: npx @arabold/docs-mcp-server@latest list
  • Use --version * to search all versions
  • Check version pattern syntax (18.x not 18.X)
  • Verify version was indexed successfully

Search from AI Assistant

Your AI assistant can search documentation automatically:

Example Prompts

Prompt:
“What’s new in React 18 regarding Suspense? Check the React 18.x documentation.”
AI searches with version: "18.x" parameter
Prompt:
“How do I implement authentication in Express? First list what Express versions we have, then search the latest.”
AI uses list_libraries then search_docs
Prompt:
“Compare how routing works in Next.js 13 versus Next.js 14”
AI performs multiple searches with different version patterns
Train your AI by showing it example searches in the Web UI first, then use similar prompts.

Next Steps

Embedding Models

Configure semantic search for better results

CLI Reference

Complete search command reference

MCP Search Tool

Using search from AI assistants

Configuration

Tune search parameters and behavior

Build docs developers (and LLMs) love