Enables secure, remote access to the document server via encrypted network integration for distributed document access.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Document Serversearch for 'quarterly review' in my docx files"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Document Server
A secure Model Context Protocol (MCP) server that provides Claude AI with access to your local documents. Built for Aaron's work document integration needs.
Features
π Secure: Read-only access with path traversal protection
π File Support: PDF, DOCX, XLSX, PPTX, TXT, MD, JSON, YAML, CSV, LOG
π Search: Full-text search across documents
π³ Docker: Easy deployment with Docker Compose
π Network: Works over HTTP (SSE) or local STDIO
π Tailscale Ready: Integrate with your existing Tailscale network
Quick Start
Option 1: Docker Compose (Recommended)
Clone and setup:
cd mcp-document-server cp .env.example .env # Edit .env if neededCreate documents directory:
mkdir -p documents # Add your work documents hereStart the server:
docker-compose up -dTest it:
curl http://localhost:8000/health
Option 2: Python Virtual Environment
Setup:
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txtConfigure:
cp .env.example .env export $(cat .env | xargs)Run:
python server.py
Configuration
Environment Variables
Variable | Default | Description |
|
| Transport type: |
|
| Server host (SSE only) |
|
| Server port (SSE only) |
|
| Path to documents directory |
|
| Maximum file size in MB |
|
| Comma-separated allowed extensions |
Docker Compose Volumes
Edit docker-compose.yml to mount your work documents:
Integration with Claude
Via Claude Desktop (Local)
Edit Claude Desktop config (
~/.config/claude/mcp_servers.jsonon Linux):
Via HTTP (Tailscale/Network)
If running on your home server and accessing via Tailscale:
Start server with SSE transport (default)
Note your Tailscale IP (e.g.,
100.x.x.x)Access at
http://100.x.x.x:8000
Configure Claude to use this URL in your MCP client settings.
Available Tools
1. list_documents
List all documents in a directory.
Parameters:
subdirectory(optional): Subdirectory to listrecursive(optional): List recursively
Example:
2. read_document
Read the contents of a specific document.
Parameters:
file_path: Relative path to documentmax_chars(optional): Maximum characters to return (default: 50000)
Example:
3. search_documents
Search for documents containing specific text.
Parameters:
query: Search queryfile_extension(optional): Filter by extensioncase_sensitive(optional): Case-sensitive search
Example:
Security Considerations
Path Traversal Protection
All file access is restricted to
DOCUMENTS_PATHSymbolic links are resolved and validated
Path traversal attempts (../) are blocked
Read-Only Access
Server only reads files, never writes
Docker container runs with read-only volume mount
No file modification capabilities exposed
File Type Restrictions
Only allowed extensions can be accessed
Binary files require appropriate parsers
Unknown types are rejected
Network Security
Use Tailscale for encrypted access
Consider adding authentication token
Bind to localhost if only local access needed
Tailscale Integration
Setup
On your home server, ensure Tailscale is running:
sudo tailscale statusStart MCP server:
docker-compose up -dGet Tailscale IP:
tailscale ip -4Access from anywhere:
http://<your-tailscale-ip>:8000
Firewall Rules
If using OPNsense with Tailscale:
Allow port 8000 on Tailscale interface
Add rule:
pass in on tailscale0 proto tcp from any to any port 8000
Advanced Configuration
Custom Document Parsers
To add support for additional file types, modify server.py:
Authentication
Add basic token authentication:
Set
MCP_AUTH_TOKENin.envModify server to check token in requests
Pass token in Claude MCP client config
Multiple Document Directories
Run multiple instances with different compose files:
Troubleshooting
Server won't start
Cannot read files
Claude can't connect
Development
Running Tests
Debug Mode
Hot Reload
For development with auto-reload:
Architecture
Contributing
This is a custom implementation for Aaron's needs, but feel free to adapt it for your own use.
License
MIT License - See LICENSE file for details
Support
For issues or questions:
Check troubleshooting section
Review Docker logs:
docker-compose logs -fVerify network connectivity with Tailscale
Built for: Aaron Watson
Integration: Claude AI + Local Documents
Stack: Python, MCP SDK, Docker, FastAPI