NRTSearch MCP Server
Enables AI assistants to search and query Lucene/NRTSearch indexes using natural language, supporting full Lucene query syntax including Boolean, phrase, range, wildcard, and fuzzy searches with highlighting and custom field retrieval.
README
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)
Quick Start
git clone https://github.com/tvergilio/nrtsearch-mcp-server.git
cd nrtsearch-mcp-server
./quickstart.sh
This will:
- Install all dependencies (including MCP SDK)
- Start the server on the configured port
Usage
CLI / Manual
After installation, you can start the server with either:
# Using the Python module
python -m nrtsearch_mcp.server
# Or, if installed via pip/pipx, use the CLI entrypoint:
nrtsearch-mcp
With GitHub Copilot (VS Code)
- Install VS Code and GitHub Copilot
- Add
nrtsearch-mcpas a Model Context Provider in VS Code settings (see.vscode/settings.json) - Start the server (
./quickstart.shornrtsearch-mcp) - Use Copilot Chat to query your Lucene indexes in natural language
Configuration
The server is configured via environment variables and/or a JSON config file. By default, it looks for:
NRTSEARCH_MCP_CONFIGenv var (path to config)./config.jsonin the current directory~/nrtsearch-mcp-config.jsonin your home directory
Example config:
{
"nrtsearch_connection": {
"host": "localhost",
"port": 8000,
"use_https": false
},
"log_level": "INFO"
}
Key environment variables:
LOG_LEVEL(default: INFO)NRTSEARCH_MCP_CONFIG(optional config path)
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
└── ...
License
Apache License 2.0. See LICENSE.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.