Mcp File Processor

io.github.OpafexPublished by GitHub account Opafexv0.1.1Updated Oct 26, 2026

Text extraction, keyword extraction, language detection, and chunking for RAG

VerifiedSTDIODesktop onlyFiles & StorageKnowledge & Memory

Overview

AI-generated overview

Local MCP server that extracts text from PDF, DOCX and text/code files, then extracts keywords, detects content type and chunks text for RAG pipelines.

What you can do
  • Extract text from PDF, DOCX, CSV, JSON, Markdown, HTML and code files, with word and page counts
  • Extract ranked keywords from text, filtered for stop words and sorted by frequency
  • Detect whether content is code, natural language or mixed, and optionally the programming language
  • Split text into overlapping chunks with positional metadata for RAG or embedding pipelines
  • Run all of the above in one call on a single file
  • Report server metadata, registered tools and resources, plus a resource listing supported types
When to use it
Useful when an assistant needs to read PDFs or Word documents, tag or index text, or prepare documents for embedding and retrieval. It suits local RAG preparation work where files should stay on the machine.
Requirements
Runs locally over stdio via npx from the npm package @opafex/mcp-file-processor; requires Node.js 20 or later. No API keys, environment variables or headers are needed, and it is desktop-only.
Before you install
File content is passed to the tools as base64 or raw text, so whatever the assistant sends is processed by the server; the README states everything runs locally with no API keys. The tools only read and transform content and do not write, send or delete data.

Installation

In SourceWeft

  1. Open Mcp File Processor in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

@opafex/mcp-file-processor

MCP server for universal text extraction, keyword extraction, language detection, and text chunking — designed for RAG pipelines.

Supports PDF, DOCX, CSV, JSON, Markdown, HTML, and code files. Zero platform dependencies.

Installation

bash
npm install @opafex/mcp-file-processor

Requires Node.js 20+.

Quick Start

Add to Claude Code / Claude Desktop

json
{  "mcpServers": {    "file-processor": {      "command": "npx",      "args": ["@opafex/mcp-file-processor"]    }  }}

No API keys needed — everything runs locally.

Tools

extract_text

Extract text content from a file.

ParameterTypeRequiredDescription
contentstringYesFile content — base64 for binary formats (PDF, DOCX), raw text for text formats
fileTypestringYesMIME type (e.g. "application/pdf") or extension (e.g. ".pdf", "pdf")
Example response
json
{  "success": true,  "text": "Extracted text content here...",  "wordCount": 142,  "pageCount": 3,  "processingTimeMs": 45}

extract_keywords

Extract ranked keywords from text. Filters stop words, sorted by frequency.

ParameterTypeRequiredDescription
textstringYesText to extract keywords from
limitnumberNoMax keywords to return (default: 20)
Example response
json
{  "success": true,  "keywords": [    { "word": "javascript", "frequency": 8 },    { "word": "framework", "frequency": 4 },    { "word": "react", "frequency": 3 }  ],  "totalWords": 156}

detect_language

Detect whether content is code, natural language, or mixed.

ParameterTypeRequiredDescription
textstringYesText to analyse
fileNamestringNoFile name for extension-based detection (e.g. "app.ts")
Example response
json
{  "success": true,  "contentType": "code",  "programmingLanguage": "typescript"}

chunk_text

Split text into overlapping chunks for RAG/embedding pipelines.

ParameterTypeRequiredDescription
textstringYesText to chunk
chunkSizenumberNoTarget chunk size in characters (default: 1000)
overlapnumberNoOverlap between chunks in characters (default: 200)
Example response
json
{  "success": true,  "chunks": [    { "index": 0, "text": "...", "startOffset": 0, "endOffset": 1000, "wordCount": 167 },    { "index": 1, "text": "...", "startOffset": 800, "endOffset": 1800, "wordCount": 172 }  ],  "totalChunks": 5,  "totalCharacters": 4200}

process_file

All-in-one: extract text, detect content type, extract keywords, and chunk.

ParameterTypeRequiredDescription
contentstringYesFile content (base64 or raw text)
fileTypestringYesMIME type or file extension
chunkSizenumberNoChunk size in characters (default: 1000)
chunkOverlapnumberNoOverlap in characters (default: 200)
keywordLimitnumberNoMax keywords (default: 20)

server_info (built-in)

Returns server metadata, registered tools, and resources.

Resources

ResourceDescription
file-processor://supported-typesLists all supported MIME types and file extensions

Supported Formats

FormatExtensionInput
PDF.pdfbase64
Word.docx, .docbase64
Plain text.txtraw text
Markdown.mdraw text
CSV.csvraw text
JSON.jsonraw text
HTML.htmlraw text
XML.xmlraw text
JavaScript.js, .jsx, .mjsraw text
TypeScript.ts, .tsxraw text
Python.pyraw text
Java.javaraw text
Go.goraw text
Rust.rsraw text
C/C++.c, .cpp, .hraw text

Development

bash
npm run build    # Compile TypeScriptnpm run dev      # Run with tsxnpm test         # Run testsnpm start        # Run compiled server

Library Usage

typescript
import { FileProcessorService } from '@opafex/mcp-file-processor/service';
const service = new FileProcessorService();
const result = await service.processFile(  'Hello world, this is a document.',  '.txt',  500,  // chunk size  100   // overlap);

Contributing

Found a bug or have a feature request? Open an issue.

License

MIT — see LICENSE.

Source: packages/file-processor/README.md at commit f85607b

Tools

6

extract_text

Extract text content from a file. Supports PDF, DOCX, CSV, JSON, Markdown, HTML, and code files. Pass file content as base64 (for binary formats like PDF/DOCX) or raw text (for text formats). Returns extracted text, word count, and processing time.

ParameterscontentrequiredfileTyperequired

extract_keywords

Extract ranked keywords from text. Returns keywords sorted by frequency, useful for tagging, search indexing, and topic identification.

Parameterstextrequiredlimit

detect_language

Detect whether content is code, natural language, or mixed. Optionally detects the programming language from file extension. Useful for routing content to appropriate processing pipelines.

ParameterstextrequiredfileName

chunk_text

Split text into overlapping chunks suitable for RAG/embedding pipelines. Configurable chunk size and overlap. Returns chunks with positional metadata.

ParameterstextrequiredoverlapchunkSize

process_file

All-in-one file processing: extract text, detect content type, extract keywords, and chunk for RAG. Returns the complete processed result in a single call.

ParameterscontentrequiredfileTyperequiredchunkSizechunkOverlapkeywordLimit

server_info

Returns server metadata: name, version, registered tools, and registered resources. Useful for introspection and health checks.

Takes no parameters.

Version history

1
  1. v0.1.1LatestOct 25, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts
  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts