Keyphrases Mcp

io.github.IvanRublev由 GitHub 账号 IvanRublev 发布v0.0.4更新于 Oct 24, 2026

An MCP server to extract keyphrases from a text with the BERT model

已验证STDIO仅桌面文件与存储知识与记忆

概览

AI 生成的概览

使用基于 BERT 的流程从本地文本文件中提取关键词组,只把关键词组返回给助手。

可以做什么
运行 KeyBERT 流程,结合 spaCy 预处理与 BERT 句向量生成候选关键词组,按与文档的余弦相似度排序,并通过最大边际相关性选出多样化的前 N 个结果。助手可以指定提取数量,也可以提供要忽略的停用词。它从允许的本地目录读取文件,只向 MCP 客户端暴露提取出的关键词组,而不是原始文件内容。
适用场景
适合助手需要按主题概括或标注文档、又不想把整份文件放入上下文的场景,例如生成文档元数据、发现评论或文章中的主题,或为后续分类与聚类生成特征。
运行要求
以 PyPI 包(keyphrases-mcp)通过 stdio 在本地运行,通常用 uvx 启动,因此需要 Python 运行环境和包下载。它从允许的本地目录读取文件,并需要下载或加载 spaCy 与句向量模型。未声明任何账号、API 密钥或环境变量。
安装前请注意
它会读取被允许访问的目录中的本地文件,应谨慎限定这些目录范围。模型下载和首次运行可能较慢或占用较多资源。未声明凭据、付费或写入操作。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Keyphrases Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

🔤 Keyphrases-MCP

Empowering LLMs with authentic keyphrase Extraction

Built with the following tools and technologies:

[MCP] [PyTorch] [Python] [uv]


Overview

This Keyphrases MCP Server is a natural language interface designed for agentic applications to extract keyphrasess from provided text. It integrates seamlessly with MCP (Model Content Protocol) clients, enabling AI-driven workflows to extract keyphrases more accurately and with higher relevance using the BERT machine learning model. It works directly with your local files in the allowed directories saving the context tokens for the LLM. The application ensures secure document processing by exposing only extracted keyphrases to the MCP client, not the original file content.

Using this MCP Server, you can ask the following questions:

  • "Extract 7 keyphrases from the file. [ABSOLUTE_FILE_PATH]"
  • "Extract 3 keyphrases from the given file ignoring the stop words. Stop words: former, due, amount, [OTHER_STOP_WORDS]. File: [ABSOLUTE_FILE_PATH]"

Keyphrases help users quickly grasp the main topics and themes of a document without reading it in full and enable the following applications:

  1. tags or metadata for documents, improving organization and discoverability in digital libraries
  2. emerging trends, sentiment, identified from customer reviews, social media, or news articles
  3. features or inputs for other tasks, such as text classification, clustering

Reasoning for keyphrases-mcp

Autoregressive LLM models such as in Claude or ChatGPT process text sequentially, which—not only limits their ability to fully contextualize keyphrases across the entire document—but also suffers from context degradation as the input length increases, causing earlier keyphrases to receive diluted attention.

Bidirectional models like BERT, by considering both left and right context and maintaining more consistent attention across the sequence, generally extract existing keyphrases from texts more accurately and with higher relevance especially when no domain-specific fine-tuning is applied.

However, as autoregressive models adopt longer context windows and techniques such as input chunking, their performance in keyphrase extraction is improving, narrowing the gap with BERT. And domain-specific fine-tuning can make autoregressive LLM model to outperform the BERT solution.

This MCP server combines BERT for keyphrase extraction with an autoregressive LLM for text generation or refinement, enabling seamless text processing.

How it works

The server uses a KeyBERT framework for the multi-step extraction pipeline combining spaCy NLP preprocessing with BERT embeddings:

  1. Candidate Generation: KeyphraseCountVectorizer identifies meaningful keyphrase candidates using spaCy's en_core_web_trf model and discarding stop words
  2. Semantic Encoding: Candidates and document are embedded using paraphrase-multilingual-MiniLM-L12-v2 sentence transformer
  3. Relevance Ranking: KeyBERT calculates cosine similarity between candidate keyphrase and document embeddings
  4. Diversity Selection: Maximal Marginal Relevance (MMR) ensures diverse, non-redundant keyphrases
  5. Final Output: Top N most relevant and diverse keyphrases are selected and sorted alphabetically

See configuration document for details.

Documentation

License

This project is licensed under the MIT License.

Contact

For questions or support, reach out via GitHub Issues.

来源:README.md,提交 006daa8

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.0.4最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分