shuck-file

shuck-file

Provides AI agents with document conversion to Markdown, intelligently routing small and large files, and enabling targeted extraction via sections, search, and token budgets.

Category
Visit Server

README

<p align="right"> <a href="README_CN.md">πŸ‡¨πŸ‡³ δΈ­ζ–‡</a> </p>

shuck-file

PyPI MCP Registry License: MIT

Any file in, Markdown out β€” read only what matters.

shuck-file converts documents to clean Markdown for AI agents and LLMs. Small files output directly; large files return a document map with section summaries, token counts, and actionable next steps β€” so agents only pull what they need.

Why shuck-file?

AI agents need a bridge that's context-aware:

  • Small file β†’ shuck report.docx β†’ full Markdown on stdout
  • Large file β†’ shuck report.docx β†’ document map with sections and extraction options
  • Targeted extraction β†’ shuck report.docx --sections s1,s3 β†’ only what you need
  • Search β†’ shuck report.docx --grep "revenue" β†’ find without reading everything

Supported Formats

Format Extension Library What's Preserved
Word .docx python-docx Headings, bold/italic, lists, tables
PDF .pdf pdfplumber Text content, page breaks
Excel .xlsx openpyxl All sheets as Markdown tables
PowerPoint .pptx python-pptx Titles, text, tables, speaker notes
CSV .csv stdlib All rows/columns as a table

Installation

Via pip (recommended)

pip install shuck-file

This installs the shuck CLI command and the MCP server.

From source

git clone https://github.com/Shan-Zhu/shuck-file.git
cd shuck-file
pip install -e .

Quick Start

# 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"

Usage

Auto-Routing (default)

Small files output directly, large files return a document map.

# Small file β†’ direct Markdown output
shuck document.pdf

# Large file β†’ document map with sections table + next steps
shuck large-report.pdf

Extraction Options

# 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 Specific

# Column headers and types
shuck data.xlsx --schema-only

# Headers + first N rows
shuck data.xlsx --sample 5

Power User Subcommands

# Force map mode (even on small files)
shuck probe document.docx

# Force full extraction (alias for --all)
shuck pull document.docx

Output Control

# 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

Map Mode Output

When a file is large, shuck returns a document map:

# 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 keywords

MCP Server

shuck-file includes an MCP (Model Context Protocol) server, making it available to any MCP-compatible AI tool.

Claude Code

claude mcp add shuck-file -- shuck-file

Or add to your project's .mcp.json:

{
  "mcpServers": {
    "shuck-file": {
      "command": "shuck-file",
      "args": []
    }
  }
}

Cursor

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "shuck-file": {
      "command": "shuck-file",
      "args": []
    }
  }
}

Windsurf

Add to your MCP configuration:

{
  "mcpServers": {
    "shuck-file": {
      "command": "shuck-file",
      "args": []
    }
  }
}

Any MCP Client

shuck-file registers as an MCP server via the mcp.servers entry point. Tools exposed:

  • shuck β€” Convert a document to Markdown with all options (mode, sections, grep, budget, etc.)
  • list_formats β€” List supported document formats

Claude Code Plugin

Install as a Claude Code plugin for the /shuck skill:

claude plugin add /path/to/shuck-file

Architecture

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

License

MIT

<!-- mcp-name: io.github.Shan-Zhu/shuck-file -->

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured