Skip to main content
Glama
Mnē-MCP
by Gatoco

Mnē-MCP — 面向 opencode 的 RAG MCP 服务器

Mnē-MCP(源自希腊语 Mnēmosynē,记忆女神提坦;ē 中的长音符号 U+0113 标记了音译中的长元音)是一个为 opencode 实现完整 RAG(检索增强生成)管道的 MCP 服务器:它索引 Obsidian 仓库或文档文件夹,并使用用户自己的笔记作为来源回答助手的问题,同时引用每个使用片段的精确路径。

技术栈:#RAG #MCP #mcp-server #opencode #Obsidian #Qdrant #Ollama #DeepSeek #bge-m3 #Python

功能

  1. 增量索引 — 从磁盘扫描目录(.md、.txt),通过 mtime + md5 检测变更,清理过时点(stale cleanup),并支持大容量卷(约 19 GB)。

  2. 本地嵌入 — 通过本地 Ollama(/api/embed)使用 bge-m3 模型,1024 维,多语言(含西班牙语),L2 归一化以正确适配余弦相似度。

  3. 语义检索 — Qdrant(Docker),单一集合,通过 payload 过滤(source、path、mtime、md5、heading_path),可配置相关性阈值。

  4. 有据生成 — 仅当证据超过阈值时,才使用 deepseek-v4-flash(Ollama Cloud)生成回答;否则返回明确拒绝("no relevant documents found")。无证据,不生成。

Related MCP server: Obsidian MCP Assistant

架构

MCP tools (stdio) ──┐
                    ├── RagService (core) ────▶ Qdrant (vectorial, Docker)
Admin page (:8310) ─┘       │
                            ├── OllamaEmbedder (bge-m3 local)
                            └── LLMProvider (deepseek-v4-flash, Ollama Cloud)
  • Python 3.14 · 官方 MCP SDK(mcp==1.12.4)· qdrant-client · httpx

  • 7 个工具:index · query · search · delete · list · stats · config

  • 本地管理页面(http://127.0.0.1:8310):仪表盘、已索引文档、带进度的异步索引和搜索试验场。与 MCP 工具共享同一核心(零重复逻辑)。

  • 70 个离线测试套件(Qdrant :memory: + 模拟)+ 端到端冒烟测试。

开发者用法

docker compose up -d qdrant   # Qdrant
ollama pull bge-m3            # embeddings locales
cp .env.example .env          # OLLAMA_API_KEY + VAULT_ROOT
make install                  # instala el paquete (venv)
make admin                    # panel: http://127.0.0.1:8310

在 opencode.json 中注册(mcp 部分,local 类型,命令 python3 mcp_rag/server.py 或入口点 mcp-rag-opencode)。

请求

行为

index (source, path, force_rescan, max_files)

增量扫描,跳过未变更文件,批量上传向量

query (question, top_k ≤ 8, source, path_prefix, score_threshold)

检索 → 重排序器/LLM → 带引用的回答(path + heading_path)

search

带 score 的原始命中结果,不生成

stats

Qdrant/Ollama 健康状态、LLM 状态、按来源计数

路线图

密集+稀疏混合搜索(BM25 + RRF)· cross-encoder 重排序 · 语义缓存 · 评估框架(recall@k、MRR、nDCG)— 计划在 openspec/specs/mnemos-differentiators/ 中。

学术

综合项目 · 教授 Christian Pérez · 学生:Gat · 2026

Available Tools

7 tools
configC

Get the full config, or set one persisted field.

Inputs: key, value, action.

deleteA

Delete indexed docs by exact path or by source.

Inputs: path, source.

indexB

Index the vault (source root or sub-path) into Qdrant.

Inputs: path, source, max_files, force_rescan.

listA

List indexed documents (paginated, filter by source/path prefix).

Inputs: limit, offset, source, path_prefix.

queryC

Retrieve context and answer the question with the LLM.

Inputs: question (required), top_k, source, path_prefix, +1 more.

statsB

Return collection stats and provider health.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a distinct role: indexing, LLM-based querying, raw vector search, deletion, listing, stats, and config. Query and search are clearly separated by whether the LLM is involved.

    Naming Consistency5/5

    All tool names are lowercase, single-word commands that follow a consistent imperative/noun style. The set is uniform and predictable despite not using a verb_noun pattern.

    Tool Count5/5

    Seven tools is well-scoped for a focused memory/RAG server. Each tool covers a necessary operation without redundancy or bloat.

    Completeness5/5

    The toolset covers the full indexed-document lifecycle: add via index, retrieve via search/query, remove via delete, inspect via list and stats, and configure via config. No critical missing operation is apparent.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Enables indexing local documents (PDF, Markdown, text, code) into a knowledge base and querying them via semantic search using local embeddings, all running privately on your machine.
      4
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI coding agents to search, read, create, update, and delete notes in a local Obsidian vault through hybrid semantic and lexical retrieval, with all embedding and vector storage running locally.
      1
      MIT