mcp-reranker
mcp-reranker
A generic Model Context Protocol (MCP) server that provides document reranking capabilities using sentence-transformers.
This server is designed to be a standalone tool that can be used by any MCP-compatible client (such as Roo Code, Claude Desktop, or custom agents) to improve the precision of RAG (Retrieval-Augmented Generation) or to help agents make better decisions by scoring relevance between a query and multiple candidates.
💡 Proven in Production: This server was extracted as a general-purpose, reusable module from the cingulater project, where it is actively used and running in production.
Features
Cross-Encoder Reranking: Utilizes the
CrossEncodermodel fromsentence-transformersfor high-accuracy relevance scoring.Project Agnostic: Completely independent of any specific application logic.
Customizable Models: Supports various HuggingFace models. You can configure the default model via environment variables (defaults to
BAAI/bge-reranker-v2-m3).JSON Output: Returns sorted results in a structured JSON format.
Related MCP server: ragi
Tools
rerank_documents
Computes relevance scores for a list of documents against a given query and returns them sorted by score.
Arguments:
query(string): The search query or the core intent to compare against.documents(array of strings): A list of document descriptions or texts to be ranked.model_name(string, optional): The HuggingFace model identifier. Defaults to theRERANKER_MODEL_NAMEenvironment variable or"BAAI/bge-reranker-v2-m3".
Response Example: A JSON-formatted string:
[
{ "document": "The most relevant document text.", "score": 0.985 },
{ "document": "A partially relevant text.", "score": 0.452 },
{ "document": "Completely irrelevant text.", "score": 0.012 }
]Installation & Usage
Running with uvx
Add the following to your MCP configuration (e.g., brownie_core_mcp_config.json).
You can customize the model used by setting the RERANKER_MODEL_NAME environment variable.
{
"mcpServers": {
"mcp-reranker": {
"command": "uvx",
"args": [
"--from",
"git+[https://github.com/globalpocket/mcp-reranker.git](https://github.com/globalpocket/mcp-reranker.git)",
"mcp-reranker"
],
"env": {
"RERANKER_MODEL_NAME": "BAAI/bge-reranker-v2-m3"
}
}
}
}Development
Prerequisites
Python 3.10+
Setup
git clone [https://github.com/globalpocket/mcp-reranker.git](https://github.com/globalpocket/mcp-reranker.git)
cd mcp-reranker
uv sync --extra devRunning Tests
uv run pytestAvailable Tools
1 toolrerank_documentsA
Reranks a list of documents based on their relevance to a given query.
Args: query: The core intent or query string to compare against. documents: A list of document descriptions/strings to be ranked. model_name: The HuggingFace model name for the CrossEncoder. Default is from env RERANKER_MODEL_NAME or 'BAAI/bge-reranker-v2-m3'.
Returns: A JSON string representing a sorted list of dictionaries containing 'document' and 'score'.
Inputs: query (required), documents (required), model_name. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of confusion or overlap. The tool's purpose is clearly defined and distinct.
The single tool name 'rerank_documents' follows a clear verb_noun convention and is descriptive. With only one tool, consistency is inherently maintained.
The server has only one tool, which is at the low end of acceptable scope. While it fulfills its core reranking purpose, the count feels thin for a general utility server.
The tool fully covers the domain of reranking documents against a query. No additional operations are necessary for the stated purpose, making the surface complete.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Remote ChromaDB vector database MCP server with streamable HTTP transport
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceMCP Server for ZeroEntropy collections, top documents and rerankers-
- AlicenseAqualityDmaintenanceLocal-first RAG indexing and semantic search MCP server. Enables document retrieval and context-aware queries using local embedding models.36 npmMIT
- AlicenseNot gradedqualityDmaintenanceMCP server for semantic and hybrid search over RHEL documentation using docs2db RAG, with cross-encoder reranking and support for multiple MCP clients.4Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that provides powerful RAG (Retrieval-Augmented Generation) capabilities for PDF documents. This server uses ChromaDB for vector storage, sentence-transformers for embeddings, and semantic chunking for intelligent text segmentation.MIT