- Home
- MCP servers
- Document
Document
- python
0
GitHub Stars
python
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"watsona4-mcp-document-server": {
"command": "docker",
"args": [
"exec",
"-i",
"mcp-document-server",
"python",
"server.py"
],
"env": {
"MCP_TRANSPORT": "stdio"
}
}
}
}You run a secure MCP server that lets Claude AI access your local documents in a read-only, protected way. It supports common document formats, offers full-text search, and can run locally or via Docker for convenient deployment. You can connect Claude to your documents over SSE/HTTP or through local STDIO, keeping your files safe while enabling powerful querying and retrieval.
How to use
You connect Claude to your local documents through the MCP server either by configuring Claude to use a local stdio endpoint or by pointing it at an HTTP transport over your network. The server exposes a small set of operations that let Claude list available documents, read document contents, and search text across your documents. Use the provided commands and configuration examples to set up the MCP connection, then request document data as needed for your workflows.
How to install
Prerequisites depend on how you want to run the MCP server. You can use Docker Compose for an easy, isolated deployment or set it up in a Python virtual environment for a lightweight, local run.
# Option 1: Docker Compose (Recommended)
# 1. Clone and setup
cd mcp-document-server
cp .env.example .env
# Edit .env if needed
# 2. Create documents directory
mkdir -p documents
# Add your work documents here
# 3. Start the server
docker-compose up -d
# 4. Test it
curl http://localhost:8000/health
# Option 2: Python Virtual Environment
# 1. Setup
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# 2. Configure
cp .env.example .env
export $(cat .env | xargs)
# 3. Run
python server.py
Configuration and usage details
Key configuration is controlled via environment variables. The server can operate in two transports: SSE over HTTP and local STDIO. You can customize where documents are stored, the maximum allowed file size, and which file types are accessible.
Configuration details
Environment variables you will encounter include: MCP_TRANSPORT (default: sse), MCP_HOST (default: 0.0.0.0, for SSE), MCP_PORT (default: 8000), DOCUMENTS_PATH (default: /documents), MAX_FILE_SIZE_MB (default: 10), and ALLOWED_EXTENSIONS (a comma-separated list of allowed file extensions). These control how the server exposes documents and how it protects access.
Security considerations
The server runs in read-only mode to protect your files. Path traversal is blocked, symbolic links are resolved and validated, and access is limited to the documents directory you specify. For network exposure, consider using encrypted access via a VPN like Tailscale and implement token-based authentication if you want stronger controls.
Tailscale integration
If you want to access the MCP server from other devices on your network, run the server with SSE transport and use your Tailscale IP address. You can then reach the server at a URL like http://<tailscale-ip>:8000.
Troubleshooting
If the server won’t start, check the logs, verify that the documents directory exists, and ensure correct permissions on the documents folder. If Claude cannot connect, test the server health endpoint, verify network connectivity, and review firewall or VPN rules to ensure the MCP port is reachable.
Available tools
list_documents
List all documents in a directory with optional subdirectory and recursive listing.
read_document
Read contents of a specific document with an optional max character limit.
search_documents
Search for documents that contain a given query with optional file extension and case sensitivity.