mcp-reranker
mcp-reranker
一个通用的 模型上下文协议 (MCP) 服务器,使用 sentence-transformers 提供文档重排序功能。
该服务器旨在作为一个独立工具,可供任何兼容 MCP 的客户端(如 Roo Code、Claude Desktop 或自定义代理)使用,以提高 RAG(检索增强生成)的精度,或通过对查询与多个候选文档之间的相关性进行评分来帮助代理做出更好的决策。
特性
交叉编码器 (Cross-Encoder) 重排序:利用
sentence-transformers中的CrossEncoder模型进行高精度的相关性评分。项目无关:完全独立于任何特定的应用程序逻辑。
可定制模型:支持各种 HuggingFace 模型。您可以通过环境变量配置默认模型(默认为
BAAI/bge-reranker-v2-m3)。JSON 输出:以结构化的 JSON 格式返回排序后的结果。
Related MCP server: ragi
工具
rerank_documents
计算文档列表相对于给定查询的相关性得分,并按得分排序返回。
参数:
query(string):搜索查询或要比较的核心意图。documents(array of strings):要排序的文档描述或文本列表。model_name(string, optional):HuggingFace 模型标识符。默认为RERANKER_MODEL_NAME环境变量或"BAAI/bge-reranker-v2-m3"。
响应示例: JSON 格式的字符串:
[
{ "document": "The most relevant document text.", "score": 0.985 },
{ "document": "A partially relevant text.", "score": 0.452 },
{ "document": "Completely irrelevant text.", "score": 0.012 }
]安装与使用
使用 uvx 运行
将以下内容添加到您的 MCP 配置中(例如 brownie_core_mcp_config.json)。
您可以通过设置 RERANKER_MODEL_NAME 环境变量来自定义所使用的模型。
{
"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"
}
}
}
}开发
先决条件
Python 3.10+
设置
git clone [https://github.com/globalpocket/mcp-reranker.git](https://github.com/globalpocket/mcp-reranker.git)
cd mcp-reranker
uv sync --extra dev运行测试
uv run pytest许可证
MIT 许可证
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
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.314MIT
- AlicenseNot gradedqualityCmaintenanceMCP 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 gradedqualityFmaintenanceA Model Context Protocol (MCP) server with Retrieval-Augmented Generation (RAG) for answering questions about imaginary SuperNova documentation. Enables semantic search over documentation using HuggingFace embeddings.1MIT
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
MCP server for AI dialogue using various LLM models via AceDataCloud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/globalpocket/mcp-reranker'
If you have feedback or need assistance with the MCP directory API, please join our Discord server