Labsco
tvergilio logo

NRTSearch

from tvergilio

Exposes Lucene-based search indexes to AI assistants through the NRTSearch MCP server.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

NRTSearch MCP Server

Production-ready Model Context Protocol (MCP) server for Lucene/NRTSearch, with first-class support for AI assistants like GitHub Copilot and Claude.


Features

  • Exposes NRTSearch/Lucene search as a robust MCP server for AI tools
  • Accepts any Lucene query (Boolean, phrase, range, wildcard, fuzzy, etc.)
  • Structured logging, retries, and highlight support
  • Pure unit-testable search logic with full test coverage
  • Easy integration with GitHub Copilot, Claude Desktop, and other MCP clients
  • Modern Python packaging and configuration (Pydantic, pyproject.toml)

API: Search Tool

The main tool is nrtsearch/search:

Parameters:

  • index (str): Index name (e.g. yelp_reviews_staging)
  • queryText (str): Full Lucene query (e.g. text:(irish AND pub AND (texas OR tx)))
  • topHits (int, default 10): Number of results (1-100)
  • retrieveFields (list, optional): Fields to return (default: ["text", "stars"])
  • highlight (bool, optional): Highlight matches

Returns:

  • List of hits: {score, stars, text}

Lucene Query Examples:

  • text:(irish AND pub AND (texas OR tx))
  • text:"great coffee"
  • stars:[4 TO 5] AND text:(vegan AND brunch)

Testing

Run all tests (unit, no server needed):

pytest -v

Tests cover:

  • Success, empty, and multiple hits
  • Error handling (HTTP, network, malformed, missing fields)
  • Retry logic
  • Highlight and custom fields
  • Input validation

Project Structure

nrtsearch-mcp-server/
โ”œโ”€โ”€ nrtsearch_mcp/
โ”‚   โ”œโ”€โ”€ server.py         # Main MCP server and search logic
โ”‚   โ”œโ”€โ”€ settings.py       # Pydantic config
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ tests/               # Unit tests 
โ”œโ”€โ”€ quickstart.sh        # One-step install & run
โ”œโ”€โ”€ requirements.txt     # Python dependencies
โ”œโ”€โ”€ pyproject.toml       # Packaging/metadata
โ””โ”€โ”€ ...