FTP Doc Reader MCP Server
Enables searching Word documents on remote FTP/FTPS servers by keyword, returning matching files with context snippets.
README
FTP Doc Reader MCP Server
An MCP (Model Context Protocol) server that recursively searches .doc and .docx files in a specified directory on a remote FTP/FTPS server, matches document content by keyword, and returns relevant files with context snippets.
Features
- Recursive directory scanning: Automatically scans all Word documents in FTP directories and subdirectories (max depth 10, max 200 files)
- Content keyword matching: Case-insensitive full-text search, returns context snippets (100 characters before and after each match)
- Supports .doc and .docx: Handles both legacy binary format and modern XML format
- FTP/FTPS dual protocol: Supports plain FTP and TLS-encrypted FTPS
- Local file caching: Size-based cache invalidation strategy to avoid redundant downloads
- Auto retry: Transient network errors are automatically retried 3 times (2-second intervals)
- Deploy via uvx: No manual dependency management required
Installation
Via uvx (Recommended)
uvx ftp-doc-reader
From source
git clone https://github.com/hackerpl/doc-mcp-server.git
cd doc-mcp-server
pip install -e .
MCP Configuration
Claude Desktop
Edit claude_desktop_config.json:
{
"mcpServers": {
"ftp-doc-reader": {
"command": "uvx",
"args": ["ftp-doc-reader"],
"env": {
"FTP_HOST": "ftp.example.com",
"FTP_USERNAME": "your_username",
"FTP_PASSWORD": "your_password",
"FTP_PROTOCOL": "FTP",
"FTP_PORT": "21",
"CACHE_DIR": ".cache"
}
}
}
}
Kiro
Edit .kiro/settings/mcp.json:
{
"mcpServers": {
"ftp-doc-reader": {
"command": "uvx",
"args": ["ftp-doc-reader"],
"env": {
"FTP_HOST": "ftp.example.com",
"FTP_USERNAME": "your_username",
"FTP_PASSWORD": "your_password"
},
"disabled": false,
"autoApprove": ["search_docs"]
}
}
}
Cursor
Edit ~/.cursor/mcp.json:
{
"mcpServers": {
"ftp-doc-reader": {
"command": "uvx",
"args": ["ftp-doc-reader"],
"env": {
"FTP_HOST": "ftp.example.com",
"FTP_USERNAME": "your_username",
"FTP_PASSWORD": "your_password"
}
}
}
}
From GitHub source (development)
{
"mcpServers": {
"ftp-doc-reader": {
"command": "uvx",
"args": ["--from", "git+https://github.com/hackerpl/doc-mcp-server.git", "ftp-doc-reader"],
"env": {
"FTP_HOST": "ftp.example.com",
"FTP_USERNAME": "your_username",
"FTP_PASSWORD": "your_password"
}
}
}
}
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
FTP_HOST |
✅ | — | FTP server hostname or IP |
FTP_USERNAME |
✅ | — | FTP login username |
FTP_PASSWORD |
✅ | — | FTP login password |
FTP_PORT |
❌ | 21 |
FTP server port |
FTP_PROTOCOL |
❌ | FTP |
Connection protocol: FTP or FTPS |
CACHE_DIR |
❌ | .cache |
Local cache directory path |
Environment variables can be set via the env field in MCP configuration, or by placing a .env file in the project directory.
MCP Tool
search_docs
Search Word document content in a remote FTP directory.
Parameters:
| Parameter | Type | Description |
|---|---|---|
query |
string (1-500 chars) | Search keyword or phrase |
directory_path |
string (1-1024 chars) | Remote FTP directory path |
Returns:
A list of matching results (sorted by match count descending), each containing:
file_path— Full remote path of the filefile_name— File namesnippets— List of matched context snippets (max 5 per file)
Usage example:
Search for documents containing "installation guide" in the /products/docs directory on the FTP server
The AI assistant will call:
{
"tool": "search_docs",
"arguments": {
"query": "installation guide",
"directory_path": "/products/docs"
}
}
Development
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run tests with coverage
pytest --cov
# Start server directly (requires .env file)
python -m ftp_doc_reader
Tech Stack
- Python 3.10+
- MCP Python SDK (FastMCP)
- python-docx (.docx parsing)
- olefile (.doc parsing)
- python-dotenv (environment variable management)
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。