MCP File Reader

MCP File Reader

A local AI-powered file reader that connects a Python MCP server with Ollama's Mistral model for offline file summarization. It provides secure file discovery and reading capabilities without requiring API keys or cloud services.

Category
Visit Server

README

MCP File Reader

A fully local, free AI-powered file reader that uses MCP (Model Context Protocol) to connect a Python tool server with a local LLM (Ollama + Mistral). No API keys, no cloud, no cost โ€” runs entirely on your machine.

๐Ÿงพ Features

  • MCP Server with custom tools (list_files, read_file)
  • Local LLM integration via Ollama (Mistral / Llama3.2)
  • Automatic file discovery and content reading
  • AI-powered summarization of file contents
  • Path traversal protection (security built-in)
  • Zero cost โ€” no API keys or subscriptions required

๐Ÿ› ๏ธ Tech Stack

Technology Description
Python Core language for server and client
MCP Model Context Protocol (tool server)
Ollama Local LLM runtime (free, offline)
Mistral Local AI model for summarization
asyncio Async communication between client/server
requests HTTP calls to Ollama API

๐Ÿ“ฆ Installation

git clone https://github.com/JaneKarunyaJ/MCP-File-Reader.git
cd MCP-File-Reader
pip install mcp requests

Install Ollama from https://ollama.com, then pull the model:

ollama pull mistral

๐Ÿš€ Usage

Make sure Ollama is running (it starts automatically after installation), then:

python client.py

The client will:

  1. Launch the MCP server as a subprocess
  2. Call list_files to discover files in my_files/
  3. Call read_file for each file found
  4. Send the real content to Mistral for summarization

๐Ÿ“ Project Structure

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

๐Ÿ” Security

  • The MCP server only allows reads from the my_files/ directory
  • Path traversal attacks (e.g. ../../etc/passwd) are automatically blocked
  • No data leaves your machine โ€” fully offline after setup

๐Ÿง  How It Works

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

โž• Extending the Project

  • Add your own files: Drop any .txt file into my_files/ and run again
  • Add new tools: Add a new tool handler in server.py (e.g. search_in_file, write_file)
  • Change the question: Edit user_question in client.py to ask anything about your files
  • Swap the model: Change MODEL = "mistral" in client.py to any model you have pulled in Ollama

๐Ÿ“‹ Requirements

  • Python 3.9+
  • Ollama installed (ollama.com)
  • Mistral model pulled (ollama pull mistral)
  • mcp and requests Python packages

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured