MCP File Reader
MCP File Reader
Полностью локальное бесплатное устройство для чтения файлов на базе ИИ, которое использует MCP (Model Context Protocol) для соединения сервера инструментов на Python с локальной LLM (Ollama + Mistral). Никаких API-ключей, никакого облака, никаких затрат — работает полностью на вашем компьютере.
🧾 Функции
MCP-сервер с пользовательскими инструментами (
list_files,read_file)Интеграция с локальной LLM через Ollama (Mistral / Llama3.2)
Автоматическое обнаружение файлов и чтение содержимого
Создание резюме содержимого файлов с помощью ИИ
Защита от обхода путей (встроенная безопасность)
Нулевая стоимость — не требуются API-ключи или подписки
Related MCP server: mcp-ollama-python
🛠️ Технологический стек
Технология | Описание |
Python | Основной язык для сервера и клиента |
MCP | Model Context Protocol (сервер инструментов) |
Ollama | Среда выполнения локальной LLM (бесплатно, офлайн) |
Mistral | Локальная ИИ-модель для создания резюме |
asyncio | Асинхронная связь между клиентом и сервером |
requests | HTTP-запросы к API Ollama |
📦 Установка
git clone https://github.com/JaneKarunyaJ/MCP-File-Reader.git
cd MCP-File-Reader
pip install mcp requestsУстановите Ollama с сайта https://ollama.com, затем загрузите модель:
ollama pull mistral🚀 Использование
Убедитесь, что Ollama запущена (она запускается автоматически после установки), затем:
python client.pyКлиент выполнит следующие действия:
Запустит MCP-сервер как подпроцесс
Вызовет
list_filesдля обнаружения файлов вmy_files/Вызовет
read_fileдля каждого найденного файлаОтправит реальное содержимое в Mistral для создания резюме
📁 Структура проекта
MCP-File-Reader/
│
├── server.py # MCP server — exposes list_files and read_file tools
├── client.py # MCP client — calls tools and queries Ollama
├── requirements.txt # Python dependencies
└── my_files/ # Folder the AI is allowed to read
├── project_ideas.txt
└── wishlist.txt🔐 Безопасность
MCP-сервер разрешает чтение только из каталога
my_files/Атаки с обходом путей (например,
../../etc/passwd) автоматически блокируютсяНикакие данные не покидают ваш компьютер — полная автономность после настройки
🧠 Как это работает
client.py
│
├── Step 1: Calls MCP tool → list_files()
│ ↓
│ Returns filenames from my_files/
│
├── Step 2: Calls MCP tool → read_file(filename)
│ ↓
│ Returns actual file contents
│
└── Step 3: Sends real content to Ollama (Mistral)
↓
Returns AI summary➕ Расширение проекта
Добавьте свои файлы: Поместите любой файл
.txtвmy_files/и запустите сноваДобавьте новые инструменты: Добавьте новый обработчик инструментов в
server.py(например,search_in_file,write_file)Измените вопрос: Отредактируйте
user_questionвclient.py, чтобы спросить что угодно о ваших файлахЗамените модель: Измените
MODEL = "mistral"вclient.pyна любую модель, которую вы загрузили в Ollama
📋 Требования
Python 3.9+
Установленная Ollama (ollama.com)
Загруженная модель Mistral (
ollama pull mistral)Пакеты Python
mcpиrequests
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
An MCP server that gives your AI access to the source code and docs of all public github repos
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA beginner MCP server that enables Claude to read local text, CSV, and Markdown files. Built as a learning project to understand how to connect AI to local file systems using the MCP protocol.-
- AlicenseNot gradedqualityAmaintenanceA Python MCP server that exposes local Ollama models as tools for AI assistants, enabling chat, generation, embeddings, and model management without cloud APIs.62 PyPI5MIT
- FlicenseNot gradedqualityCmaintenanceA local, read-only MCP server that analyzes Python backend projects by providing tools to scan, map, and selectively read files, reducing token usage for AI clients.-
- FlicenseNot gradedqualityBmaintenanceMCP server that enables AI to read, search, and edit local files securely without external data exposure, using local LLMs via Ollama and integrating with Open WebUI or Claude Desktop.-