Skip to content

MCP Local File Resource Server A Python MCP server that lets LLMs and MCP clients read, search, and batch-process local text, code, and PDF files via standard MCP URIs. Includes PDF extraction and file search. Ideal for connecting local documents to AI workflows.

Notifications You must be signed in to change notification settings

pugazhmukilan/MCP-LocalFileResource-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP Local File Resource Server

The MCP Local File Resource Server is a Model Context Protocol (MCP) server that exposes files from a local directory as resources and tools.
It allows LLMs and MCP clients to search, read, and batch-process files—including text, code, and PDF documents—using standardized MCP URIs and methods.

✨ Features

  • 📂 Read Local Files as Resources
    Fetch the content of any file in your target directory via a simple URI. Supports .txt, .md, .csv, .pdf, and more.

  • 📄 PDF Extraction
    Extracts text from PDF files using PyMuPDF (fitz).

  • 🔍 File Search
    Search files by partial name or extension using either a resource or a tool.

  • 📑 Batch File Reading
    Load multiple files at once and return their contents in a single dictionary.

  • MCP-Compliant
    Fully compatible with the MCP Inspector and other MCP clients.

⚙️ How It Works

  • Resources:
    • document://{filename} — Read the content of a file (supports .txt, .md, .csv, .pdf, etc.).
    • search://{dummyfilename} — List all files matching a search pattern.
  • Tools:
    • get_and_read_all_files — Read multiple files at once.
    • find_correct_file_tool — Search for files by name (tool variant).

Getting Started

Prerequisites

Installation

CHALLENGES *****

✨ What Makes This Server Special: The Engineering Behind It ✨

Building this server wasn't just about writing code; it was about solving key challenges to create a tool that is powerful, smart, and safe. Here’s a look at the engineering that went into it.


🔌 1. Speaking the AI's Language (MCP Integration)

The Problem: How do you get a server to communicate flawlessly with a new, advanced AI communication standard?

Our Solution: We dove deep into the Model Context Protocol (MCP) rulebook to build a fully compliant server. After rigorous testing, we created a tool that speaks the AI's language perfectly, making it a reliable partner for any MCP-ready application.


🚀 2. Fast, Focused Data for the AI (Efficiency)

The Problem: AI models get bogged down by too much information. How do you give it just the right data, and do it quickly?

Our Solution: We designed a smart, two-step system. It first identifies the exact files needed and then extracts content only from them. This keeps the AI focused, fast, and efficient, avoiding information overload.


🛡️ 3. Fort-Knox Security for Your Files (Sandboxing)

The Problem: The server needs to read local files, but it absolutely must not be allowed to wander outside its designated folder.

Our Solution: We built a digital "sandbox"—a secure, fenced-in area for all file operations. The server is strictly locked down to its folder, with safeguards to block any escape attempts. Your files are safe, and the server only accesses what you allow.

About

MCP Local File Resource Server A Python MCP server that lets LLMs and MCP clients read, search, and batch-process local text, code, and PDF files via standard MCP URIs. Includes PDF extraction and file search. Ideal for connecting local documents to AI workflows.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages