AI Document Assistant MCP Server
AI Document Assistant
一个基于 RAG(检索增强生成)、FAISS、MCP(模型上下文协议)、Ollama 和 Streamlit 构建的 AI 文档助手。
上传 PDF 文档,询问文档内容相关问题,生成摘要,提取关键词,并通过 Wikipedia 集成回答常识性问题。
功能特性
文档问答
就上传的 PDF 文档提出问题。
使用 FAISS 向量搜索检索相关文档片段。
使用 Ollama 生成自然语言回答。
文档摘要
生成上传文档的简明摘要。
关键词提取
从文档中提取重要关键词和主题。
常识性问题
集成 Wikipedia 回答上传文档之外的问题。
MCP 集成
通过 MCP 暴露工具。
支持通过 MCP 客户端进行工具发现和执行。
PDF 上传支持
直接从 Streamlit 界面上传 PDF 文件。
自动创建嵌入并为文档建立索引以便检索。
Streamlit 界面
简单易用的聊天界面。
实时上传 PDF 并与文档交互。
架构
PDF
│
▼
PDF Loader
│
▼
Text Chunking
│
▼
Embeddings
│
▼
FAISS Vector Store
│
▼
Retrieval
│
▼
LLM (Ollama)
│
▼
Answer Generation技术栈
后端
Python
LLM
Ollama
Qwen 2.5 Coder 7B
向量数据库
FAISS
嵌入
Sentence Transformers
协议
MCP(模型上下文协议)
前端
Streamlit
外部知识
Wikipedia API
项目结构
AI-Document-Assistant/
│
├── datas/
│
├── src/
│ ├── pdf_loader.py
│ ├── chunker.py
│ ├── embeddings.py
│ ├── vector_store.py
│ └── rag_store.py
│
├── tools/
│ ├── search_tool.py
│ ├── summary_tool.py
│ ├── keyword_tool.py
│ ├── qa_tool.py
│ └── wiki_tool.py
│
├── app.py
├── agent.py
├── build_rag.py
├── mcp_client.py
├── mcp_server.py
├── requirements.txt
├── README.md
└── .gitignore安装
克隆仓库
git clone https://github.com/yourusername/AI-Document-Assistant.git
cd AI-Document-Assistant创建虚拟环境
python -m venv .venv激活环境
Windows:
.venv\Scripts\activateLinux/macOS:
source .venv/bin/activate安装依赖
pip install -r requirements.txt安装 Ollama
下载并安装 Ollama:
拉取模型:
ollama pull qwen2.5-coder:7b启动 Ollama:
ollama serve运行应用程序
streamlit run app.py打开:
http://localhost:8501工作原理
文档问题
示例:
What is MySQL Workbench?助手将:
搜索相关文档片段。
使用 FAISS 检索匹配的上下文。
将上下文发送给 Ollama。
生成最终回答。
常识性问题
示例:
Who is Elon Musk?助手将:
检测问题是否与文档无关。
使用 Wikipedia。
返回简明回答。
MCP 工具
可用的 MCP 工具:
document_search
搜索相关文档片段。
document_summary
生成文档摘要。
document_keywords
提取重要关键词。
ask_document
对上传的文档进行问答。
wiki_search
使用 Wikipedia 进行常识性知识查询。
未来改进
多 PDF 支持
聊天历史记忆
对话上下文
来源引用
混合搜索(BM25 + 向量搜索)
持久化向量数据库
Docker 部署
身份验证和用户管理
作者
Yadu
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 Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
65+ AI tools as MCP: research, write, code, scrape, translate, RAG, agent memory, workflows
Real-time Amazon, WIPO & PACER data for AI agents — 19 tools via the MCP protocol.
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/yadu0323/AI-Document-Assistant'
If you have feedback or need assistance with the MCP directory API, please join our Discord server