Skip to main content
Glama

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+

  • uv

设置

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 许可证

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
2dRelease cycle
3Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    MCP Server for ZeroEntropy collections, top documents and rerankers
  • A
    license
    A
    quality
    D
    maintenance
    Local-first RAG indexing and semantic search MCP server. Enables document retrieval and context-aware queries using local embedding models.
    3
    14
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    A 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.
    1
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

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