Skip to main content
Glama
bpweatherill

Document Search MCP Server

by bpweatherill

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).

Related MCP server: Docalyze

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
F
license - not found
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bpweatherill/Document-Search-MCP-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server