Skip to main content
Glama
MCP-PersonalSearch

MCP-PersonalSearch

by weatherills

MCP-PersonalSearch

一个 MCP 服务器,旨在让模型能够访问操作员在正常交互会话中所能获取的同一批数据。

当前实现:项目 PRD 的 Phase 1 —— 面向 GitLab 托管的 docs-as-code 仓库的文档搜索管道(raw store → markdown extraction → chunking → FTS5 索引 → CLI)。MCP 服务器本身(Streamable HTTP、search_docs/get_section 等)属于 Phase 2,尚未构建。

设置

python -m venv .venv
.venv/Scripts/activate   # or `source .venv/bin/activate` on Linux/macOS
pip install -e ".[dev]"

将 config.example.toml 复制为 config.toml,并将 [[sources]] 指向你的仓库:

[[sources]]
id = "eng-docs"
type = "gitlab_repo"
repo_url = "https://gitlab.example.com/team/docs.git"
branch = "main"
globs = ["docs/**/*.md", "README.md"]

Related MCP server: Gemini Docs MCP Server

用法

docsrag ingest --source eng-docs        # clone/fetch + index; safe to re-run, skips unchanged files
docsrag search "your question here"     # lexical (BM25) search over the indexed corpus
docsrag reindex                         # rebuild sections/chunks/FTS from the raw store, fully offline
docsrag status                          # per-source document counts and last run
docsrag eval --set eval/questions.json  # recall@k / MRR against a labelled question set (PRD §7.2)

corpus.db(已索引的文档)和 instance.db(查询日志、作业历史)默认写入 data/ 目录下,并被 gitignore 忽略 —— 关于语料库为何绝不能共享、导出或同步,请参阅 PRD §12。

eval/questions.json 同样被 gitignore 忽略,原因相同:真实问题都基于你实际摄取的内容,可能嵌入内部内容。将 eval/questions.example.json 复制为 eval/questions.json,并用你自己语料库中的 {"metadata": ..., "section_id": ...} 配对填写(section_id 的值来自 docsrag search 的输出不要做任何解释)。

测试

pytest

Related MCP Connectors

Related MCP Servers