Mega Agent MCP

Mega Agent MCP

A unified MCP server providing tools for web search, GitHub analysis, document parsing, browser automation, secure code execution, and forum parsing, enabling LLMs to perform a wide range of external tasks through a single backend.

Category
Visit Server

README

Mega Agent MCP

Production Ready Python 3.11+ License: MIT MCP Compatible Docker Supported

Mega Agent MCP is a production-ready Model Context Protocol (MCP) server that gives Large Language Models a wide set of external capabilities: web search, article extraction, GitHub analysis, document parsing, browser automation, secure code execution, and forum parsing.

The project focuses on being a fast, lightweight, and self-hostable backend that works with any MCP-compatible client or AI model.


Why Mega Agent MCP

Most MCP servers implement one or two tools. Mega Agent MCP combines many capabilities into a single optimized server while keeping security, performance, and resource usage under control.

It removes the need to run five different MCP servers by providing one unified, async-first backend with its own SQLite caching, Docker sandboxing, and rate limiting.

(Demo GIF placeholder)


Architecture

LLM
 │
 ▼
MCP Client
 │
 ▼
Mega Agent MCP
 ├── Web Search
 ├── GitHub
 ├── Docker Sandbox
 ├── Browser
 ├── OCR
 ├── Documents
 └── SQLite Cache

Tool Categories

Internet
 ├── web_search
 ├── fetch_page
 ├── search_and_read
 └── browse_url

GitHub
 ├── fetch_github_repo
 └── fetch_github_file

Forums
 └── fetch_thread

Documents
 ├── read_document
 └── render_html_css

Execution
 ├── execute_code
 └── get_current_time

Features

Web Search & Reading

  • Web Search — searches the internet through SearXNG with language selection and BM25 ranking.
  • Article Reader — extracts clean content via a cascade parser (TrafilaturaReadabilityjusTextBeautifulSoup). Automatically strips ads, sidebars, and scripts.
  • Smart Search + Read — a Perplexity-style pipeline: search → BM25 ranking → download → extract → merge top results.
  • JavaScript Browser — uses Playwright Chromium for JS-heavy sites (React, Vue, SPAs).

GitHub Integration

  • Repository Reader — analyzes repo trees, extracts README.md, and detects default branches via the GitHub REST API without cloning.
  • File Reader — downloads and reads individual source files or docs directly from public repositories.

Forum Parsing

  • Reddit Parser — recursively parses nested Reddit discussions via the JSON API, with sorting, time filters, and internal BM25 search.
  • 4PDA Parser — reads full 4PDA forum topics, supporting recent, full thread, and first/last page modes while skipping duplicate header posts.

Secure Code Sandbox Runs code in strictly isolated Docker containers (Python, C, C++, Java, Node.js, PHP).

  • Security layers: network disabled, read-only filesystem, non-root user (nobody), capability dropping, seccomp profile support, no-new-privileges, CPU/RAM/PID limits, tmpfs mounts.

Document & Visual Processing

  • Document Reader — parses PDF, DOCX, PPTX, XLSX, XLS, CSV, and ODS, with smart PDF text extraction and block ordering.
  • Smart OCR — uses Tesseract OCR; if a PDF is a scanned image, falls back to rendering the page and extracting text visually.
  • HTML Renderer — uses Playwright to render raw HTML/CSS and generate screenshots (useful for AI UI generation and previews).

Performance

  • Fully asynchronous architecture — async HTTP calls, parallel downloads, async DB operations
  • SQLite cache with WAL mode, TTL-based, to cut network overhead
  • Persistent Playwright browser sessions
  • RAM-cached BM25 retrieval — lightweight, semantic-like ranking without heavy GPU embeddings
  • Minimal memory footprint

Security

Mega Agent MCP includes several security layers by default:

  • SSRF protection — strict URL validation; blocks loopback, private networks, multicast, and link-local addresses (IPv4 and IPv6)
  • Input validation — hard limits on request payloads (max 1 MB input) and file sizes (max 50 MB documents)
  • Rate limiting — sliding-window rate limiting to prevent abuse

Installation

1. Clone the repository

cd ~
git clone https://github.com/PanPersil/MegaAgent-MCP.git
cd MegaAgent-MCP

2. Install dependencies

Requires Python 3.11+. A virtual environment is recommended.

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`

# Install python packages
pip install -r requirements.txt

# Install Playwright browser for rendering
playwright install chromium

3. System dependencies

Not everything is installable via pip. Mega Agent MCP also requires:

  • Docker
  • Chromium (installed automatically via playwright install chromium, Linux note: if you encounter an error while loading shared libraries, run sudo playwright install-deps chromium)
  • Tesseract OCR
  • SearXNG

On Debian/Ubuntu:

sudo apt install tesseract-ocr tesseract-ocr-rus tesseract-ocr-eng

4. Start SearXNG (web search backend)

# Create directory to SearXNG service
mkdir ~/searxng && cd ~/searxng

# Copy settings.yml from the cloned repository
cp ~/MegaAgent-MCP/settings.yml ~/searxng/settings.yml

# Run SearXNG container
docker run -d --name searxng -p 8888:8080 -v $(pwd)/settings.yml:/etc/searxng/settings.yml searxng/searxng

# Enable auto-restart so it survives reboots
docker update --restart unless-stopped searxng

5. Run the server

python server.py

The server listens for MCP connections via Streamable-HTTP/WebSocket on http://0.0.0.0:8100/mcp.


Available Tools Reference

Tool Name Category Description
web_search Internet Standard internet search using SearXNG.
fetch_page Internet Reads an article and extracts pure text.
search_and_read Internet Searches and automatically reads the top N pages.
browse_url Internet JavaScript browser for dynamic SPAs.
fetch_github_repo GitHub Repository analysis and README extraction.
fetch_github_file GitHub Reads specific files from a repository.
fetch_thread Forums Deep parser for Reddit / 4PDA discussions.
execute_code Execution Secure Docker code execution (Python/C/C++/Java/JS/PHP).
get_current_time Execution Returns accurate system time.
render_html_css Documents Renders HTML code to an image screenshot.
read_document Documents Parses PDF, Word, Excel, PPTX (with OCR).

Comparison

Feature Mega Agent MCP Typical MCP Server
Web Search Yes Partial
GitHub Integration Yes No
OCR Yes No
Docker Sandbox Yes No
Forum Parsing Yes No
Browser Rendering Yes Partial

Roadmap

  • [x] Web search
  • [x] GitHub support
  • [x] Docker sandbox
  • [x] OCR
  • [x] Browser automation

Intended Use Cases

  • Local AI Assistants — connect to llama.cpp, Ollama, or LM Studio.
  • Coding Agents — automate GitHub exploration and execute code safely.
  • Research Assistants — aggregate knowledge, read PDFs, and parse forums.
  • Self-Hosted AI Systems — a private, no-telemetry backend for your LLMs.

Project Status

Current Status: Production Ready

Mega Agent MCP is considered production-ready for self-hosted and local AI deployments. While actively maintained and stable, minor bugs or edge cases may still exist. Contributions, issue reports, and feature suggestions are always welcome.


License

This project is licensed under the MIT License — see the LICENSE file for details.

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
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
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
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
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
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