-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathllms-full.txt
More file actions
122 lines (103 loc) · 3.05 KB
/
Copy pathllms-full.txt
File metadata and controls
122 lines (103 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# markgrab-plugin
> Claude Code plugin for universal web content extraction — any URL to LLM-ready markdown
Wraps [markgrab](https://github.com/QuartzUnit/markgrab) as Claude Code skills + MCP server.
Install: `pip install markgrab` (core) | `pip install "markgrab[all]"` (all extractors)
## Skills
### `extract-url`
Extract content from a web URL and convert to LLM-ready markdown.
**Supported content types** (auto-detected from URL):
- HTML pages — content density filtering, auto-fallback to Playwright for JS-heavy sites
- YouTube — transcript extraction with timestamps, multi-language
- PDF — text extraction with page structure
- DOCX — paragraph and heading extraction
**Command:**
```bash
python -m markgrab <URL> [OPTIONS]
```
| option | description |
|--------|-------------|
| `--format` | Output: `markdown` (default), `text`, `json` |
| `--browser` | Force Playwright rendering |
| `--max-chars N` | Limit output length (default: 30000) |
| `--stealth` | Anti-bot stealth scripts (browser only) |
### `extract-file`
Convert local PDF or DOCX files to clean markdown.
**Supported file types:**
- PDF — requires `markgrab[pdf]`
- DOCX — requires `markgrab[docx]`
**Command:**
```bash
python -m markgrab <FILE_PATH> [OPTIONS]
```
| option | description |
|--------|-------------|
| `--format` | Output: `markdown` (default), `text`, `json` |
| `--max-chars N` | Limit output length (default: 50000) |
### `batch-extract`
Extract content from multiple URLs at once.
**Python API:**
```python
import asyncio
from markgrab import extract
async def batch_extract(urls: list[str]) -> list:
results = []
for url in urls:
try:
result = await extract(url, max_chars=30_000)
results.append({
"url": url,
"title": result.title,
"markdown": result.markdown,
"word_count": result.word_count
})
except Exception as e:
results.append({"url": url, "error": str(e)})
return results
```
## MCP Server
Configuration (`.mcp.json`):
```json
{
"mcpServers": {
"markgrab": {
"command": "markgrab-mcp",
"args": []
}
}
}
```
**MCP Tools:**
- `extract_url` — Extract single URL to markdown
- `extract_multiple` — Batch extract multiple URLs
## Plugin Configuration
`.claude-plugin/plugin.json`:
```json
{
"name": "markgrab",
"version": "0.1.1",
"author": "QuartzUnit",
"license": "MIT",
"repository": "https://github.com/QuartzUnit/markgrab"
}
```
## markgrab Python API Reference
```python
async def extract(url: str, *, engine=None, max_chars: int = 50_000,
use_browser: bool = False, stealth: bool = False,
timeout: float = 30.0, proxy: str | None = None,
locale: str | None = None,
browser_fallback: bool = True) -> ExtractResult
```
```python
@dataclass
class ExtractResult:
title: str
text: str
markdown: str
word_count: int
language: str | None
url: str
extracted_at: str
engine_used: str
metadata: dict
```