AI Document Assistant MCP Server
Enables document Q&A, summarization, keyword extraction, and Wikipedia lookup through MCP tools, using RAG with FAISS and Ollama.
README
# AI Document Assistant
An AI-powered Document Assistant built using RAG (Retrieval-Augmented Generation), FAISS, MCP (Model Context Protocol), Ollama, and Streamlit.
Upload PDF documents, ask questions about their content, generate summaries, extract keywords, and answer general knowledge questions using Wikipedia integration.
Features
Document Question Answering
- Ask questions about uploaded PDF documents.
- Retrieves relevant document chunks using FAISS vector search.
- Generates natural language answers using Ollama.
Document Summarization
- Generate concise summaries of uploaded documents.
Keyword Extraction
- Extract important keywords and topics from documents.
General Knowledge Questions
- Wikipedia integration for questions outside the uploaded document.
MCP Integration
- Exposes tools through MCP.
- Allows tool discovery and execution through MCP clients.
PDF Upload Support
- Upload PDF files directly from the Streamlit interface.
- Automatically creates embeddings and indexes documents for retrieval.
Streamlit Interface
- Simple and user-friendly chat interface.
- Upload PDFs and interact with documents in real time.
Screenshots
Streamlit Interface

MCP Server Connection

MCP Tools

Architecture
PDF
│
▼
PDF Loader
│
▼
Text Chunking
│
▼
Embeddings
│
▼
FAISS Vector Store
│
▼
Retrieval
│
▼
LLM (Ollama)
│
▼
Answer Generation
Tech Stack
Backend
- Python
LLM
- Ollama
- Qwen 2.5 Coder 7B
Vector Database
- FAISS
Embeddings
- Sentence Transformers
Protocol
- MCP (Model Context Protocol)
Frontend
- Streamlit
External Knowledge
- Wikipedia API
Project Structure
AI-Document-Assistant/
│
├── datas/
│
├── screenshots/
│ ├── streamlit-ui.png
│ ├── mcp-server.png
│ └── mcp-tools.png
│
├── 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
Installation
Clone Repository
git clone https://github.com/yourusername/AI-Document-Assistant.git
cd AI-Document-Assistant
Create Virtual Environment
python -m venv .venv
Activate Environment
Windows:
.venv\Scripts\activate
Linux/macOS:
source .venv/bin/activate
Install Dependencies
pip install -r requirements.txt
Install Ollama
Download and install Ollama:
https://ollama.com
Pull the model:
ollama pull qwen2.5-coder:7b
Start Ollama:
ollama serve
Run the Application
streamlit run app.py
Open:
http://localhost:8501
How It Works
Document Questions
Example:
What is MySQL Workbench?
The assistant:
- Searches relevant document chunks.
- Retrieves matching context using FAISS.
- Sends context to Ollama.
- Generates a final answer.
General Knowledge Questions
Example:
Who is Elon Musk?
The assistant:
- Detects the question is not document-specific.
- Uses Wikipedia.
- Returns a concise answer.
MCP Tools
document_search
Search relevant document chunks.
document_summary
Generate document summaries.
document_keywords
Extract important keywords.
ask_document
Question answering over uploaded documents.
wiki_search
General knowledge lookup using Wikipedia.
Future Improvements
- Multi-PDF support
- Chat history memory
- Conversation context
- Source citations
- Hybrid Search (BM25 + Vector Search)
- Persistent Vector Database
- Docker deployment
- Authentication and user management
Author
Yadu
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.