ollama-mcp-assistant
Allows querying local documents using Ollama models by extracting text from .txt or .pdf files and returning Persian answers grounded in the provided context.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ollama-mcp-assistantAccording to context.txt, what are the library's opening hours?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Ollama MCP Assistant
Ask questions about a local document using Ollama on your machine. The project exposes document Q&A through an MCP server (FastMCP) and two optional UIs: a lightweight browser page and a Streamlit app.
Includes a synthetic Persian demo document (context.txt) about a public library — safe to run immediately after clone.
Why this project
Local-first — no cloud API keys; runs against Ollama on
localhost:11434MCP tool —
ask_ollamareads.txtor.pdf, sends context + question to Ollama, returns a Persian answerPersian output — system prompt enforces Farsi answers grounded in the provided context
Two UIs — stdlib browser UI (
ui.py) or Streamlit app (app.py)CLI client —
MCP_Client.pydemonstrates calling the MCP server via stdio
Related MCP server: DocAgent-MCP
Stack
Python · Ollama · FastMCP · Streamlit · pdfplumber · requests
Project layout
File | Description |
FastMCP server with | |
Async stdio client example (Persian terminal output) | |
Minimal RTL browser UI (stdlib + requests only) | |
Streamlit document Q&A app with file upload | |
Quick helper to monitor Ollama model pull progress | |
Synthetic Persian demo document (public library sections) |
Quick start
1. Install Ollama
Install Ollama and pull a model, for example:
ollama pull llama3.2:1b2. Install Python dependencies
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # macOS / Linux
pip install -r requirements.txt3. Run (pick one)
MCP server (stdio):
python MCP_Server.pyBrowser UI:
python ui.pyOpens http://127.0.0.1:8765 with RTL Persian layout.
Streamlit app:
streamlit run app.pyMCP client demo:
python MCP_Client.pyCheck model download progress:
python check_progress.pyMCP tool: ask_ollama
Parameter | Description |
| Path to a |
| User question (answer will be in Persian) |
| Ollama model tag, e.g. |
The server extracts text from the file, sends it with the question to Ollama's chat API, and returns the model response.
Demo document
context.txt is an original synthetic Persian text describing sections of a fictional central city library. It is included only for testing the Q&A pipeline — replace it with your own .txt or .pdf files.
Disclaimer
Unofficial project — independent work by Marzieh Babaali. Not affiliated with Ollama, FastMCP, or any document provider.
Local models — quality and language behavior depend on the Ollama model you choose.
Your documents — only upload or point to files you have the right to use.
Code in this repository is original MIT-licensed work (LICENSE).
Author
Marzieh Babaali — PhD Researcher · NLP & Generative AI
This server cannot be deployed
Maintenance
Related MCP Connectors
Your private knowledge base: upload documents (.md, .txt, .docx, PDF, images), the platform indexes
- docs2mcpOAuthcom.docs2mcp
Query your own PDFs and documents from any MCP client. Every answer cites the page it came from.
Ingest, manage, and retrieve documents for RAG-powered AI applications
Merge, split, extract, rotate, reorder and stamp PDF pages from your AI chat, all offline.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to search and query PDF documents through a local RAG system with vector embeddings. Provides semantic document search capabilities while keeping all data stored locally without external dependencies.-
- FlicenseNot gradedqualityCmaintenanceEnables local document question-answering and retrieval via MCP, supporting multi-turn conversation, intent recognition, and tools for document search, Q&A, and summarization.5-
- AlicenseNot gradedqualityBmaintenanceEnables querying PDF documents using natural language with grounded answers and source citations via a local RAG pipeline.MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to interact with local documents (PDF, Markdown, TXT) through tools for discovery, reading, extraction, summarization, comparison, keyword extraction, search, and analysis, ensuring privacy and offline capability.-