shuck-file
shuck-file
Любой файл на входе — Markdown на выходе: читайте только то, что важно.
shuck-file преобразует документы в чистый Markdown для AI-агентов и LLM. Небольшие файлы выводятся напрямую; для больших файлов возвращается карта документа с краткими описаниями разделов, количеством токенов и практическими следующими шагами — чтобы агенты извлекали только то, что им нужно.
Зачем нужен shuck-file?
AI-агентам нужен мост, который учитывает контекст:
Небольшой файл →
shuck report.docx→ полный Markdown в stdoutБольшой файл →
shuck report.docx→ карта документа с разделами и вариантами извлеченияТочечное извлечение →
shuck report.docx --sections s1,s3→ только то, что нужноПоиск →
shuck report.docx --grep "revenue"→ найти, не читая всё подряд
Related MCP server: groupdocs-markdown-mcp
Поддерживаемые форматы
Формат | Расширение | Библиотека | Что сохраняется |
Word |
| python-docx | Заголовки, жирный/курсив, списки, таблицы |
| pdfplumber | Текстовое содержимое, разрывы страниц | |
Excel |
| openpyxl | Все листы в виде таблиц Markdown |
PowerPoint |
| python-pptx | Заголовки, текст, таблицы, заметки докладчика |
CSV |
| stdlib | Все строки/столбцы в виде таблицы |
Установка
Через pip (рекомендуется)
pip install shuck-fileЭто устанавливает команду CLI shuck и сервер MCP.
Из исходного кода
git clone https://github.com/Shan-Zhu/shuck-file.git
cd shuck-file
pip install -e .Быстрый старт
# Convert a document
shuck report.docx
# Force full output (bypass map mode)
shuck large-report.pdf --all
# Search within a document
shuck report.pdf --grep "revenue"Использование
Автоматическая маршрутизация (по умолчанию)
Небольшие файлы выводятся напрямую, для больших файлов возвращается карта документа.
# Small file → direct Markdown output
shuck document.pdf
# Large file → document map with sections table + next steps
shuck large-report.pdfПараметры извлечения
# Force full output (bypass map mode)
shuck report.pdf --all
# Extract specific sections
shuck report.pdf --sections s1,s3
# Tables only
shuck report.pdf --tables-only
# Search within document
shuck report.pdf --grep "revenue"
# Token budget (smart compression)
shuck report.pdf --budget 4000
# Combinations work
shuck report.pdf --sections s2,s3 --budget 2000Специфика Excel/CSV
# Column headers and types
shuck data.xlsx --schema-only
# Headers + first N rows
shuck data.xlsx --sample 5Дополнительные подкоманды для опытных пользователей
# Force map mode (even on small files)
shuck probe document.docx
# Force full extraction (alias for --all)
shuck pull document.docxУправление выводом
# Write to file
shuck document.pdf -o output.md
# Write to directory (auto-named)
shuck document.pdf -d ./converted/
# Skip YAML frontmatter
shuck document.pdf --no-frontmatter
# List supported formats
shuck --formatsРежим карты документа
Когда файл большой, shuck возвращает карту документа:
# Document Map: quarterly-report.pdf
**6 pages | ~12,400 tokens | 6 sections**
## Sections
| # | Title | Type | Tokens | Density |
|---|-------|------|--------|---------|
| s1 | Executive Summary | narrative | 450 | high |
| s2 | Q3 Financial Results | mixed | 2,800 | high |
| s3 | Revenue Breakdown | tabular | 3,200 | high |
| ...
## Next Steps
- `shuck quarterly-report.pdf --all` -- full document (~12,400 tokens)
- `shuck quarterly-report.pdf --sections s1,s2` -- high-density (~3,250 tokens)
- `shuck quarterly-report.pdf --grep "..."` -- search for keywordsMCP-сервер
shuck-file включает сервер MCP (Model Context Protocol), что делает его доступным для любого AI-инструмента, совместимого с MCP.
Claude Code
claude mcp add shuck-file -- shuck-fileИли добавьте в .mcp.json вашего проекта:
{
"mcpServers": {
"shuck-file": {
"command": "shuck-file",
"args": []
}
}
}Cursor
Добавьте в ~/.cursor/mcp.json:
{
"mcpServers": {
"shuck-file": {
"command": "shuck-file",
"args": []
}
}
}Windsurf
Добавьте в вашу конфигурацию MCP:
{
"mcpServers": {
"shuck-file": {
"command": "shuck-file",
"args": []
}
}
}Любой MCP-клиент
shuck-file регистрируется как MCP-сервер через точку входа mcp.servers. Доступные инструменты:
shuck— Преобразование документа в Markdown со всеми параметрами (режим, разделы, grep, бюджет и т. д.)list_formats— Список поддерживаемых форматов документов
Плагин для Claude Code
Установите как плагин для Claude Code, чтобы получить навык /shuck:
claude plugin add /path/to/shuck-fileАрхитектура
src/shuck_file/
├── cli.py # CLI entrypoint
├── server.py # MCP Server (FastMCP)
├── core/
│ ├── router.py # Auto-routing logic
│ ├── segmenter.py # Document segmentation
│ ├── mapper.py # Map mode renderer
│ ├── budget.py # Smart compression
│ ├── grep.py # In-document search
│ ├── frontmatter.py # YAML frontmatter
│ └── models.py # Data models
├── extractors/
│ ├── base.py # Base extractor ABC
│ ├── docx_ext.py # Word extractor
│ ├── pdf_ext.py # PDF extractor
│ ├── xlsx_ext.py # Excel extractor
│ ├── pptx_ext.py # PowerPoint extractor
│ └── csv_ext.py # CSV extractor
plugin/ # Claude Code plugin wrapper
tests/
├── test_extractors.py
├── test_router.py
├── test_segmenter.py
├── test_budget.py
└── test_grep.pyЛицензия
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Convert PDFs, Office files, spreadsheets and images to clean Markdown, sized for agent context.
Document conversion and OCR for AI agents: PDF, Office docs, images to text.
Turn PDF and Word files into clean Markdown, with OCR for scans and RAG-ready chunks.
Convert PDFs, Office docs, websites and audio into AI-ready Markdown, then search and ask your docs.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides AI agents with comprehensive document parsing capabilities including PDF text extraction, OCR, HTML-to-markdown conversion, table extraction, and summarization, optimized for agent workflows.60 npmMIT
- AlicenseNot gradedqualityCmaintenanceConverts documents (PDF, DOCX, XLSX, EPUB, etc.) to clean, structured Markdown, and retrieves document info, for use with AI agents.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to inspect and convert PDF, PowerPoint, Excel, and many other file formats into clean, structured Markdown, with chunking support for long documents.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables AI agents and coding assistants to inspect, search, and extract only the needed PDF pages or sections as low-token Markdown while preserving tables and document structure.MIT