Personal Knowledge-Base MCP Server
个人知识库 MCP 服务器
一个个人知识库 MCP 服务器,使用 Model Context Protocol (MCP)、Gemini 嵌入和 Qdrant 对学生拥有的文档集合提供语义搜索。
项目概述
该项目将个人知识库公开为可调用的 MCP 工具。
该系统不依赖关键词匹配,而是将用户查询转换为向量嵌入,并从 Qdrant 中检索语义相关的文档块。
Related MCP server: Solarium
架构
User / MCP Client
|
v
MCP Server (FastMCP)
|
+----------------------+
| |
v v
search_notes() get_document()
|
v
Gemini Embedding API
|
v
Qdrant Vector Database
|
v
Ranked Chunks
|
v
Source + Page + Score + Text
## Features
* PDF document ingestion
* Page-by-page text extraction
* Recursive text chunking
* Gemini `gemini-embedding-001` embeddings
* Qdrant vector storage
* Semantic similarity search
* Source and page citations
* Confidence threshold for low-relevance queries
* Full-document retrieval
* Indexed-source listing
* MCP Inspector support
## MCP Tools
### `search_notes`
Searches the knowledge base using semantic similarity.
Arguments:
* `query`: search question or topic
* `top_k`: maximum number of results
Returns:
* similarity score
* source filename
* page number
* relevant text chunk
### `get_document`
Returns the complete text of an indexed PDF document.
Argument:
* `doc_id`: document filename
Example:
```text
Complex_Variables_Project_Report.pdflist_source_documents
列出所有已索引的源文档。
示例输出:
1. Complex_Variables_Project_Report.pdf项目结构
Personal-Knowledge-MCP/
├── documents/
│ └── Complex_Variables_Project_Report.pdf
├── services/
│ ├── chunking.py
│ ├── embedding.py
│ ├── pdf_reader.py
│ └── qdrant_service.py
├── .env
├── .gitignore
├── evaluation.py
├── ingest.py
├── requirements.txt
└── server.py设置
1. 创建并激活虚拟环境
python -m venv .venv
.venv\Scripts\Activate.ps12. 安装依赖
pip install -r requirements.txt3. 配置 Gemini API 密钥
在项目根目录创建一个 .env 文件:
GEMINI_API_KEY=your_api_key_here切勿将 .env 提交到 Git。
4. 启动 Qdrant
该项目在以下位置使用本地 Qdrant:
http://localhost:6333示例 Docker 命令:
docker run -d --name qdrant -p 6333:6333 -p 6334:6334 qdrant/qdrant文档摄取
将 PDF 放入:
documents/运行:
python ingest.py摄取管道执行以下操作:
PDF
↓
Page extraction
↓
Chunking
↓
Gemini embeddings
↓
Qdrant storage每个存储的块包含:
text
page
source运行 MCP 服务器
启动 MCP Inspector:
mcp dev server.pyMCP 服务器使用 STDIO 传输。
可用工具:
search_notes
get_document
list_source_documents检索评估
使用了一个包含五个查询的小型评估集,来检查前三个检索结果中是否至少出现一个预期相关页面。
评估结果:
Tests: 5
Successful hits: 5
Hit@3: 100%示例评估查询包括:
什么是复变量?
什么是柯西-黎曼方程?
拉普拉斯变换如何帮助工程系统?
拉普拉斯变换和傅里叶变换有什么区别?
FFT 如何用于音频降噪?
置信度过滤
搜索工具使用的初始相似度阈值为:
0.60例如,相关查询产生的分数约为:
0.79
0.76
0.75而不相关查询产生的分数约为:
0.52因此,低分结果会被过滤,工具返回:
No confident match found.技术
Python
FastMCP
Model Context Protocol (MCP)
Google Gemini Embeddings
Qdrant
PyMuPDF
LangChain Text Splitters
Docker
MCP Inspector
当前知识来源
当前的演示语料库是:
Complex_Variables_Project_Report.pdf该文档包含 7 页,并为索引的 personal_knowledge 集合分成了 30 个块。
安全性
API 密钥存储在
.env中.env通过.gitignore排除机密信息绝不应提交到源代码控制
未来改进
支持 Markdown 和 TXT 文档
添加文档级持久 ID
改进重复块处理
扩展评估数据集
添加更多检索指标
支持多个文档集合
添加可选的 Qdrant Cloud 部署
This server cannot be installed
Maintenance
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
- Flicense-qualityCmaintenanceMCP server that indexes a knowledge base into Chroma and provides search tools for retrieving document fragments via vector embeddings.
- Alicense-qualityDmaintenanceA knowledge base MCP server backed by Qdrant vector database with local embeddings for semantic search and document management.51ISC
- Flicense-qualityCmaintenanceMCP server providing RAG tools (search_notes, answer_from_notes) and resources for grounded answers over a local knowledge base.
- Flicense-qualityAmaintenanceA local knowledge base MCP server that enables retrieval and evidence-based Q&A over Obsidian Markdown notes, with high-recall embedding search, chunked indexing, hybrid retrieval, and three STDIO MCP tools for agent-driven recollection and quality-gated recall.
Related MCP Connectors
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Agentic search over your Dewey document collections from any MCP-compatible client.
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/AmnaSarwar522/Personal-Knowledge-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server