Mcp File Processor

io.github.IntelagentStudios由 GitHub 帳號 IntelagentStudios 發布v0.1.1更新於 Oct 24, 2026

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

概覽

AI 產生的概覽

本機 MCP 伺服器,可從文件與程式碼擷取文字、擷取關鍵字、偵測內容類型,並將文字切分為適合 RAG 流程的片段。

可以做什麼
它提供從 PDF、DOCX、CSV、JSON、Markdown、HTML、XML 及原始碼檔案擷取文字的工具,也支援依詞頻排序的關鍵字擷取、內容類型與程式語言偵測,以及帶重疊的文字切分。process_file 工具可一次完成擷取、偵測、關鍵字擷取與切分,另有一個資源列出支援的 MIME 類型與副檔名。
適用情境
適合需要讓助理讀取本機文件或程式碼並為嵌入或檢索做準備的情境,例如建立 RAG 上下文、摘要 PDF,或在建立索引前把長文字切成帶重疊的片段。
執行需求
透過 npx 以 stdio 方式在本機執行,需要 Node.js 20 或更新版本。不需要 API 金鑰或帳號,未宣告任何環境變數或標頭。
安裝前請注意
檔案內容需以 base64 或原始文字形式傳給工具,因此助理必須已取得檔案內容;沒有跡象顯示此伺服器會寫入、傳送或刪除資料。一切都在本機執行,未宣告任何憑證。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mcp File Processor,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

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.

來源:packages/file-processor/README.md,提交 02c34ab

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分