Skip to main content
Glama
MCP Server RAG

MCP Server RAG

by atengk

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Model Context Protocol Server for Retrieval-Augmented Generation (RAG).

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
health_checkB

检查 RAG MCP 服务基础运行状态。

Returns:
    dict[str, str]: 包含服务状态、名称与版本的键值对字典。
rag_list_kbsA

枚举所有已创建的知识库清单及其文档数、切片统计与更新时间。

Returns:
    list[dict[str, Any]]: 包含各知识库完整元数据的字典列表
rag_doctorA

全维自检诊断探针,检查存储引擎连通性、本地模型配置、磁盘占用与系统环境。

Returns:
    dict[str, Any]: 结构化诊断报告
rag_searchA

在指定知识库或跨多个知识库中执行向量语义检索与原生 FTS 倒排混合检索(RRF 融合)。

Args:
    kb_name: 目标知识库名称,支持单库名称、知识库列表(如 ["docs", "code"])或 "*" 跨全库召回
    query: 检索查询文本
    top_k: 返回相似切片的最大数量(默认为 5)
    threshold: 相似度截断阈值,过滤掉低于此分数的切片(范围 0.0 ~ 1.0)
    keyword: 可选的精准关键词,切片正文必须包含此词(大小写无关)
    metadata_filter: 可选的元数据字典过滤条件(如 {"category": "tech"})
    expand_context: 邻近上下文窗口扩展步数(默认 0 不展开,允许安全范围 0 ~ 5)

Returns:
    list[dict[str, Any]]: 排序后的相似切片列表,
        每个切片包含 chunk_id, text, score, metadata(含结构化 images 列表), kb_name
rag_query_with_contextA

检索知识库相关上下文并组装为带来源引用的 Markdown 增强提示词。

Args:
    kb_name: 目标知识库名称(支持单库名、知识库名称列表或通配符 "*" 跨库检索)
    query: 检索查询问题或主题
    top_k: 返回参考切片的最大数量(默认为 5)
    threshold: 相似度截断阈值,过滤掉低于此分数的切片
    keyword: 可选的精准关键词
    metadata_filter: 可选的元数据字典过滤条件
    expand_context: 邻近上下文窗口扩展步数(默认 0 不展开,允许安全范围 0 ~ 5)

Returns:
    str: 组装后的 Markdown 提示词字符串;若无匹配内容则返回未检索到上下文提示
rag_create_kbA

创建新的知识库命名空间与底层向量存储集合。

Args:
    name: 知识库名称,全局唯一标识(仅限字母、数字、下划线、连字符)
    description: 知识库的详细描述说明信息
    owner: 知识库所属创建者标识,默认 ``"default"``
    visibility: 知识库可见性范围(``"public"`` 或 ``"private"``),默认 ``"public"``

Returns:
    dict[str, Any]: 创建结果状态与说明
rag_clear_kbA

清空指定知识库中的所有文档与切片数据,但保留知识库本身的基础配置与元数据。

Args:
    name: 待清空的知识库名称

Returns:
    dict[str, Any]: 清空结果与状态说明
rag_delete_kbB

物理销毁指定知识库及其关联的所有文档元数据与向量索引集合。

Args:
    name: 待删除的知识库名称

Returns:
    dict[str, Any]: 删除结果与状态说明
rag_delete_documentA

从指定知识库中物理删除特定文档及其所有切片与向量索引。

支持按文档 ID、标题或文件路径精确匹配。

Args:
    kb_name: 目标知识库名称
    doc_id: 待删除的文档 ID、标题或文件路径

Returns:
    dict[str, Any]: 删除操作结果状态字典
rag_index_textA

对单段纯文本内容进行切片、计算高维向量嵌入并持久化索引到指定知识库中。

支持基于 SHA-256 内容指纹校验的幂等更新:
- 若相同 title 的文档内容未变动,秒级跳过;
- 若内容发生修改,原子删除旧切片并插入新切片。

Args:
    kb_name: 目标知识库名称
    text: 待索引的正文纯文本内容
    title: 文档标题或唯一标识(在知识库中作为 doc_id)
    metadata: 可选的附加结构化元数据(标签、分类、作者等)

Returns:
    dict[str, Any]: 索引执行结果状态字典
rag_index_fileA

摄取本地单个文件,自动识别文件格式并进行结构感知切片、向量嵌入与持久化索引。

支持 SHA-256 内容指纹校验与幂等更新(若文件未修改则秒级跳过)。

Args:
    kb_name: 目标知识库名称
    file_path: 本地文件绝对或相对路径
    metadata: 可选的附加结构化元数据(标签、分类等)

Returns:
    dict[str, Any]: 索引结果状态字典
rag_index_directoryA

批量扫描并摄取本地目录下的所有文件,支持递归遍历与 max_files 超时防御截断。

Args:
    kb_name: 目标知识库名称
    dir_path: 目标目录绝对或相对路径
    glob_pattern: 匹配文件模式(默认为 "**/*")
    max_files: 目录文件摄取上限,防止大目录导致 MCP 响应超时(默认 200)
    recursive: 是否递归扫描子目录(默认 True)

Returns:
    dict[str, Any]: 目录批量摄取统计报告字典
rag_index_urlA

通过 HTTP 请求抓取在线网页或在线文档,清洗 HTML 视觉噪点并进行向量索引。

支持 SHA-256 内容指纹校验与幂等跳过,并具备网络超时与异常防护。

Args:
    kb_name: 目标知识库名称
    url: 目标网页或在线文档的完整 URL(必须以 http:// 或 https:// 开头)
    metadata: 可选的附加结构化元数据字典

Returns:
    dict[str, Any]: 索引结果状态字典

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.6/5.0

Scored across 13 tools

Disambiguation4/5

Most tools are clearly separated by resource and action, and the index_* family (text/file/url/directory) is well differentiated by input source. Two mild overlaps remain: health_check vs rag_doctor (the doctor is essentially a superset of the health check) and rag_clear_kb vs rag_delete_kb, though the descriptions do explain the clear-vs-destroy distinction.

Naming Consistency4/5

Eleven of thirteen tools follow a predictable rag_ + verb_noun pattern (rag_create_kb, rag_index_file, rag_search, rag_delete_document), which makes the set easy to scan. The two outliers, health_check (noun_verb, no rag_ prefix) and rag_doctor (no verb at all), break the pattern but are memorable and unlikely to be misread.

Tool Count5/5

Thirteen tools is squarely in the sweet spot for a RAG server, with each tool covering a distinct ingestion, retrieval, or KB-management operation. No obvious padding: even the health/diagnostic pair serves an operational purpose.

Completeness3/5

CRUD for knowledge bases and four ingestion paths plus retrieval are well covered, but there is no tool to list or read back documents in a KB (no rag_list_documents / rag_get_document) and no way to update KB metadata such as description or visibility. Agents can partially work around this via search, but inspection and update workflows hit dead ends.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues