mcpField
M
mcp-file-processor

mcp-file-processor

Local
github.com/opafexMemory & Knowledge0Updated 4d ago

About mcp-file-processor

mcp-file-processor is a local text-processing MCP server for RAG pipelines, aimed at developers who need to extract and prepare file content. It handles document and code formats without requiring API keys.

Key features

  1. 01Extracts text from PDF, DOCX, and text formats
  2. 02Ranks keywords by frequency
  3. 03Identifies code, natural language, or mixed content
  4. 04Splits text into overlapping chunks
  5. 05Processes files through a combined pipeline

Use cases

  1. 01Extract document text for RAG workflows
  2. 02Chunk content for embedding pipelines
  3. 03Identify the content type of code files
  4. 04Generate keywords for document indexing

MCP support

The MCP server provides tools for text extraction, keyword extraction, language detection, chunking, and combined file processing, plus a supported-types resource. Processing runs locally and needs no API keys.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"opafex-mcp-file-processor": {
"command": "npx",
"args": [
"-y",
"@opafex/mcp-file-processor"
]
}
}
}
Run commandnpx -y @opafex/mcp-file-processor

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@opafex/mcp-file-processor0.1.1

Tools

6

Saved tool list · updated 3d ago

ParameterTypeRequiredDescription
contentstringYesFile content — base64-encoded for binary formats (PDF, DOCX), raw text for text formats
fileTypestringYesMIME type (e.g. "application/pdf") or file extension (e.g. ".pdf", "pdf", ".ts")

Details

From the project 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

npm install @opafex/mcp-file-processor

Requires Node.js 20+.

Quick Start

Add to Claude Code / Claude Desktop
{
  "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
{
  "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
{
  "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
{
  "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
{
  "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

npm run build    # Compile TypeScript
npm run dev      # Run with tsx
npm test         # Run tests
npm start        # Run compiled server

Library Usage

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.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.