mega-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mega-mcp List top-level files in my MEGA folder."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ποΈ mega-mcp
Turn any public MEGA folder into a knowledge source for Claude & other LLMs
Browse Β· Search Β· Read files & PDFs Β· Video metadata Β· Optional transcription β all from a public mega.nz link, no account required.
β If this saves you time, please star the repo β it really helps others find it.
What is this?
mega-mcp is a Model Context Protocol (MCP) server that exposes a public MEGA folder or file link as a queryable knowledge base. Point it at a share link and your AI assistant β Claude Code, Claude Desktop, or any MCP-compatible client β can browse the tree, search filenames, read text files and extract text from PDFs, inspect video/audio metadata, and optionally transcribe media to text.
No MEGA login. No re-uploading your files somewhere else. Just a link.
Great for course libraries, research archives, documentation dumps, datasets, meeting recordings β any pile of files already living on MEGA that you want an LLM to actually use.
Related MCP server: MCP-RAG
β¨ Features
Tool | What it does | |
π |
| List a folder link β top level, a subfolder, or the entire tree. |
π |
| Find files/folders by name across the whole share (substring or regex). |
π |
| Return a file's text. PDFs are auto-extracted to text. Other binaries are rejected. |
π§ |
| Full-text search inside text files and PDFs, with line-level snippets. |
π¬ |
| Video/audio metadata (duration, resolution, codecs, fps, bitrate) β streams only the header, no full download. |
ποΈ |
| (opt-in) Transcribe speech to text via a pluggable backend (OpenAI-compatible API or any local CLI like whisper.cpp). |
π Public links only β folder links and single-file links, zero credentials.
π¦ Batteries included β
ffmpeg/ffprobeship via npm; PDF extraction uses a bundled pdf.js. No system installs.π§© Pluggable transcription β bring OpenAI Whisper, a local model, or any command. Off by default.
β±οΈ Long-job friendly β emits MCP progress so big transcriptions don't hit client timeouts.
π‘οΈ Safe by default β size caps, binary detection, and friendly errors for dead/blocked/expired links.
π Table of contents
π Quick start
git clone https://github.com/Anicodeth/mega-mcp.git
cd mega-mcp
npm install
npm run buildThat's it β dist/index.js is your MCP server. Wire it into a client below.
π€ Use with Claude Code
claude mcp add mega \
-e MEGA_LINK="https://mega.nz/folder/XXXX#YYYY" \
-- node "/absolute/path/to/mega-mcp/dist/index.js"Then just ask: "Browse my MEGA folder and summarize what's in the Strategy section."
On Windows, use the full path, e.g.
node "C:\\path\\to\\mega-mcp\\dist\\index.js".
π₯οΈ Use with Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"mega": {
"command": "node",
"args": ["/absolute/path/to/mega-mcp/dist/index.js"],
"env": {
"MEGA_LINK": "https://mega.nz/folder/XXXX#YYYY"
}
}
}
}Without MEGA_LINK, pass a link argument to each tool call instead β handy for working with many links.
βοΈ Configuration
All environment variables are optional.
Var | Purpose | Default |
| Default public link so tools work without repeating it. Per-call | β |
| Max bytes to download for a text-file read / content search. |
|
| Max bytes to download for a PDF before extracting text. |
|
ποΈ Transcription (optional)
mega_transcribe is off by default. Turn it on by choosing a backend.
Var | Value |
|
|
| your key (required) |
| optional, default |
| optional, default |
Works with any OpenAI-compatible endpoint (Groq, local servers, etc.) via OPENAI_BASE_URL.
Var | Value |
|
|
| a shell command where |
A ready-to-use faster-whisper wrapper is included at scripts/whisper_cli.py:
pip install faster-whisper# macOS/Linux
export MEGA_TRANSCRIBE=command
export MEGA_TRANSCRIBE_CMD='python /path/to/mega-mcp/scripts/whisper_cli.py {input}'
export WHISPER_MODEL=base # tiny | base | small | medium | large-v3The wrapper runs fully locally on CPU β no API key, no data leaving your machine.
How it works: the media file is downloaded to a temp dir, ffmpeg (bundled) extracts mono 16 kHz audio and splits it into ~10-minute segments, each segment goes to your backend, and results are concatenated. Use the maxMinutes argument to transcribe just the start of a long file.
π οΈ Tool reference & example prompts
Once connected, you can drive everything in natural language:
You say⦠| Tool used |
"What folders are in my MEGA share?" |
|
"Find every file with 'invoice' in the name." |
|
"Read |
|
"Open the Patreon case study PDF and pull the key takeaways." |
|
"Search all the PDFs for 'activation metric' and show me where." |
|
"How long is |
|
"Transcribe the first 10 minutes of |
|
mega_browseβlink?,path?(subfolder),recursive?(defaultfalse)mega_searchβquery,link?,regex?,filesOnly?mega_read_fileβpath?or filelink,maxBytes?mega_search_contentβquery,link?,regex?,includePdf?(defaulttrue),maxFiles?,maxMatchesPerFile?mega_video_infoβpath?or filelink,raw?mega_transcribeβpath?or filelink,maxMinutes?,language?,segmentMinutes?
Every tool falls back to MEGA_LINK when link is omitted.
π¬ How it works
public MEGA link
β
ββββββββββββΌββββββββββββ
β megajs (no login) β load link β walk tree β resolve path β download
ββββββββββββ¬ββββββββββββ
β
βββββββββββββββββΌββββββββββββββββββββββββββββ
βΌ βΌ βΌ βΌ
browse / read_file / video_info transcribe (opt-in)
search search_content (ffprobe, (download β ffmpeg
(metadata) (text + PDF via header-only) audio segments β
unpdf/pdf.js) backend β text)Public links are resolved with megajs β both
/folder/β¦#keyand/file/β¦#keyforms.PDFs are extracted with unpdf (a serverless-friendly pdf.js build). Scanned/image-only PDFs yield no text (OCR not included).
Video metadata is read by streaming only the header into
ffprobeβ a 1 GB file is probed in seconds without downloading it.Transcription downloads the file (needed because many mp4s store their index at the end and pipes aren't seekable), then segments audio so even hour-long lectures stay within backend size limits.
β FAQ
Do I need a MEGA account? No. mega-mcp only uses public share links.
Does it support private/account files? Not currently β public links only, by design. See the roadmap.
Are my files re-uploaded anywhere? No. Files are fetched directly from MEGA on demand. With the local transcription backend, nothing leaves your machine.
Can it read Word/Excel/PowerPoint? Not yet β text files and PDFs today. Office formats are on the roadmap.
Will big transcriptions time out in my client? The server emits MCP progress notifications, which keeps compatible clients alive. Use maxMinutes to cap long files.
Does ffmpeg need to be installed? No β ffmpeg-static and ffprobe-static bundle the binaries.
πΊοΈ Roadmap
Optional account login for private files
Office document extraction (
docx,xlsx,pptx)OCR for scanned PDFs / images
Cached content index for faster repeated searches
Resource endpoints (expose files as MCP resources)
Have an idea? Open an issue π
π€ Contributing
Contributions are very welcome!
npm install
npm run build # compile
npm run typecheck # strict type check
npm run dev # watch modeFork the repo and create a feature branch.
Keep the code style consistent and types strict.
Open a PR describing the change. Small, focused PRs are easiest to merge.
If you find a bug or want a feature, issues and β stars are both hugely appreciated.
π Project layout
src/
index.ts MCP server + tool definitions
mega.ts megajs wrapper (load link, walk tree, resolve path, download)
pdf.ts PDF text extraction (unpdf)
video.ts ffprobe streaming + metadata distillation
transcribe.ts optional, pluggable audio/video transcription
types.d.ts ambient module declaration for ffprobe-static
scripts/
whisper_cli.py local faster-whisper transcription backendπ License
MIT Β© Ananya Fekeremariam (Anicodeth)
Built with the Model Context Protocol. If it helped, drop a β β thank you!
Available Tools
6 toolsmega_browseBrowse a MEGA folderA
List files and folders in a public MEGA folder link. Use recursive to walk the entire tree, or path to scope into a subfolder. Returns name, path, type, and size for each entry.
Inputs: link, path, recursive.
mega_read_fileRead a MEGA text or PDF fileA
Download and return the text contents of a file. PDFs are extracted to text automatically. Provide either a path within a folder link, or a direct file link. Other binary files are rejected. Text reads are capped at MEGA_MAX_READ_BYTES; PDFs at MEGA_MAX_PDF_BYTES.
Inputs: path, link, maxBytes.
mega_searchSearch MEGA by filenameA
Search a public MEGA link's entire tree for files/folders whose name matches a query (case-insensitive substring, or regex with regex).
Inputs: query (required), link, regex, filesOnly.
mega_search_contentFull-text search inside MEGA filesA
Search inside text files and PDFs under a MEGA folder link for a query string (or regex). Returns matching files with line snippets. By default PDFs are included; set includePdf:false to skip them (faster).
Inputs: query (required), link, regex, includePdf, +2 more.
mega_transcribeTranscribe a MEGA video/audio fileA
Transcribe spoken audio from a video/audio file to text, so it can be used as knowledge. OPT-IN: disabled unless a backend is configured via MEGA_TRANSCRIBE (openai or command) β see README. Audio is extracted and segmented with ffmpeg, then sent to the backend. The file is downloaded first; use maxMinutes to transcribe only the start of a long file.
Inputs: path, link, maxMinutes, language, +1 more.
mega_video_infoGet video/audio metadataA
Probe a video or audio file's technical metadata (duration, resolution, codecs, bitrate, fps) using ffprobe. Streams only the header, not the whole file. Provide path within a folder link or a direct file link.
Inputs: path, link, raw.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 6 tools
Each tool targets a distinct operation: browsing folders, reading file contents, searching file names, searching file contents, transcribing audio, and extracting video metadata. There is no overlap, as even the two search tools are clearly separated by scope (names vs. content).
All tools share the 'mega_' prefix and use snake_case, but the pattern is slightly inconsistent: most are verb or verb_noun (browse, read_file, search, search_content, transcribe), while 'video_info' is a noun phrase. Otherwise predictable.
With 6 tools, the server is well-scoped for accessing public MEGA folders. Each tool serves a clear purpose, and the count is neither too sparse nor too heavy for the domain.
The tool set covers the core workflows for a read-only MEGA access server: browsing, reading text/PDF files, searching by name and content, transcribing audio, and probing video metadata. No obvious gaps exist for the intended use case.
Maintenance
Related MCP Connectors
Swiss encrypted cloud drive for Claude, ChatGPT and AI agents: search, read and save files.
Your WhatsApp history in Claude and ChatGPT: search years of chats, voice notes transcribed.
Safe folder access for ChatGPT and Claude: read, write and search files, risky tools opt-in.
Give Claude only the Google Drive files you choose. Every action logged.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables real-time indexing and semantic search of local documents (PDF, Word, text, Markdown, RTF) using vector embeddings and local LLMs. Monitors folders for changes and provides natural language search capabilities through Claude Desktop integration.22MIT
- AlicenseNot gradedqualityNot gradedmaintenanceTurns Claude Desktop into a personal document question-answering system using local vector search. Index PDF, TXT, and Markdown documents into collections and get answers based strictly on your documents with zero hallucination.10 npm-
- FlicenseNot gradedqualityDmaintenanceA local document intelligence and knowledge management server for Claude Desktop that provides RAG-powered Q\&A, media transcription, and URL crawling. It features 11 tools for processing various file types and managing a persistent local vector store with zero infrastructure costs.1-
- AlicenseNot gradedqualityCmaintenanceTurns any folder of Markdown files into a searchable, structured knowledge base for Claude Code, enabling persistent memory across sessions via tools like list, read, write, edit, search, and summarize.MIT