Magpie

•
1
•

Securely extracts valuable content from web pages for AI agents, prioritizing politeness, security, and token efficiency.

Magpie is a web scraper designed specifically for AI agents, inspired by its namesake bird's habits of collecting shiny things and being extremely wary. It intelligently extracts valuable web page content—such as clean markdown, headings, links, metadata, and structured data—while treating all retrieved information as potentially hostile. Built with a strong security-first approach, Magpie ensures politeness towards websites, protects against common vulnerabilities like SSRF and prompt injection, and manages token budgets effectively to provide agents with precisely labelled, untrusted content, all running locally without external API dependencies.

主な機能

01Token-budgeted output with various content 'lenses' for efficient AI agent consumption.
02Offers an interactive CLI, machine-readable JSON output, and an MCP server for agent integration.
03Obeys robots.txt, includes per-host rate limiting, and handles transient failures with retries.
040 GitHub stars
05Parses structured data (JSON-LD) and rescues embedded framework state from client-rendered pages.
06Security-first web scraping with built-in SSRF and prompt injection protection.

ユースケース

01Facilitate RAG ingestion by providing clean, token-efficient markdown and structured data from web pages.
02Monitor prices and stock by parsing embedded JSON-LD on commerce sites that permit scraping.
03Serve as a secure fetch layer for AI agents, protecting against common web-based vulnerabilities.