Document Search MCP Server

Document Search MCP Server

A local MCP server providing read-only access to documents like Word, PDF, Excel, and images, with file listing, reading, and metadata extraction.

Category
Visit Server

README

Document Search MCP Server

A local MCP server that provides read-only access to documents (Word, PDF, Excel, CSV, Visio, PNG, JPG) via the Model Context Protocol (MCP).

Features

  • Read-only access: Enforced at the code level.
  • Recursive scanning: Scans all subdirectories of configured directories.
  • File type validation: Uses magic numbers to validate file types.
  • Metadata extraction: Extracts metadata from all supported file types.
  • Logging: Logs all actions to a file (configurable).

Installation

  1. Clone the repository:
    git clone https://github.com/bpweatherill/Document-Search-MCP-server.git
    cd Document-Search-MCP-server
    
  2. Install dependencies:
    pip install -r requirements.txt
    

Usage

Start the Server

# Default: Scans ~/Documents
python -m src.main

# Custom directories and settings
python -m src.main --dir "C:\Users\Me\Documents" --dir "C:\Users\Me\Desktop" --max-file-size 50000000 --log-file "C:\logs\mcp.log" --log-level DEBUG

MCP Client Interaction

Send JSON-RPC requests over stdio. Example:

{
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "list_files",
    "arguments": {}
  }
}

Tools

Tool Description Arguments
list_files List all allowed files. None
read_file Read a file and return its content. {"path": "file.pdf"}
get_metadata Get metadata for a file. {"path": "file.pdf"}

Configuration

Argument Default Description
--dir ~/Documents Directories to scan (recursive).
--max-file-size 100MB Skip files larger than this.
--log-file ~/.mcp_server/log.txt Path to the log file.
--log-level INFO Logging level (DEBUG, INFO, etc.).

Security

  • Read-only: All file operations are read-only.
  • Path validation: Prevents directory traversal attacks.
  • File type validation: Ensures files match their extensions.

Testing

Run unit tests:

python -m unittest discover tests

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