linkbrief-mcp 0.1.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +390 -0
- package/README.md +266 -187
- package/browser.mjs +7 -1
- package/office.mjs +155 -0
- package/package.json +22 -5
- package/page.mjs +324 -37
- package/robots.mjs +48 -0
- package/server.mjs +4 -58
- package/sites.mjs +141 -2
- package/tools.mjs +101 -0
package/README.md
CHANGED
|
@@ -1,85 +1,108 @@
|
|
|
1
1
|
# linkbrief-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**English** | [한국어](README.ko.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/linkbrief-mcp)
|
|
6
|
+
[](https://github.com/KDDYYY/linkbrief-mcp/actions/workflows/test.yml)
|
|
7
|
+
[](LICENSE)
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
Let Claude, Codex or any MCP agent **read any link** — web pages, PDFs, Office files and JavaScript-heavy pages — as clean Markdown, fetched **from your own computer**. About **95% fewer tokens** than raw HTML.
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
Give your agent a link and ask; linkbrief brings back just the main content with its title, source, author and date, and the agent does the rest. Works in any language, including sites most fetchers get wrong: Asian sites, Naver Blog's iframe layout, Namuwiki, and legacy encodings like Shift_JIS, GBK and EUC-KR.
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+

|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
<sub>Example: the `fetch_page` call and its result are real linkbrief output; the summary was written by Claude from that result. (Source: French Wikipedia, "Kimchi", CC BY-SA.)</sub>
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
- **막힌 사이트도 읽습니다.** Claude의 기본 웹 가져오기는 일부 사이트(예: `blog.naver.com`)가 막혀 있습니다. linkbrief는 **사용자 PC에서 일반 브라우저처럼** 요청합니다.
|
|
17
|
-
- **네이버 블로그가 비어 보이지 않습니다.** 본문이 iframe 안에 있어 그냥 가져오면 비어 있는데, linkbrief는 본문이 들어 있는 모바일 주소로 바꿔 읽습니다.
|
|
18
|
-
- **PDF, 여러 링크, JavaScript 페이지까지** 한 도구로 처리합니다.
|
|
19
|
-
- **API 키가 필요 없습니다.** 요약은 사용 중인 Claude가 합니다.
|
|
17
|
+
## Why linkbrief
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
- **~95% fewer tokens.** Most of a page's HTML is menus, ads, scripts and image URLs. linkbrief keeps the article. ([measured](#token-savings))
|
|
20
|
+
- **Read only the part you need.** Ask a question with `find` and get just the passages that mention it (76–88% less than the whole page), or look at the outline first and read one section, with a link to cite it.
|
|
21
|
+
- **Built for developers.** GitHub issues and PRs come with every comment and the changed files; Stack Overflow questions with their top answers; Hacker News threads in full; arXiv abstracts open the paper. Point it at a docs site and it reads the section for you (`fetch_site`).
|
|
22
|
+
- **Documents, not just pages.** PDFs page by page, and Word, PowerPoint, Excel and Hangul (.hwpx) files from a link.
|
|
23
|
+
- **Reads what other fetchers miss.** Pages that render with JavaScript are retried in the Chrome or Edge you already have. PDFs come back as text, page by page. Requests come from your machine, so sites that block cloud fetchers still answer.
|
|
24
|
+
- **Any language, any encoding.** Tested on Wikipedia in six languages, plus news and docs sites in English, French, German, Japanese, Chinese, Thai and Vietnamese. Legacy charsets (Shift_JIS, EUC-JP, GBK, Big5, EUC-KR, TIS-620, windows-1258) decode correctly.
|
|
25
|
+
- **Safe by default.** Private and local network addresses are refused, bot checks are reported rather than bypassed, and the browser runs with a fresh profile every time.
|
|
26
|
+
- **No API key.** The agent you already use does the summarizing.
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
## Quick start (Claude Code)
|
|
29
|
+
|
|
30
|
+
**1. Install** — one line. `npx` fetches the package from npm, so there is nothing else to install.
|
|
24
31
|
|
|
25
32
|
```bash
|
|
26
33
|
claude mcp add linkbrief -s user -- npx -y linkbrief-mcp
|
|
27
34
|
```
|
|
28
35
|
|
|
29
|
-
|
|
36
|
+
On Windows (PowerShell or Command Prompt), wrap `npx` in `cmd /c` for a reliable connection:
|
|
37
|
+
|
|
38
|
+
```powershell
|
|
39
|
+
claude mcp add linkbrief -s user -- cmd /c npx -y linkbrief-mcp
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**2. Check the connection** — reopen Claude Code and type `/mcp`. You should see `linkbrief` connected with two tools, `fetch_page` and `fetch_pages`. (From a terminal: `claude mcp list`.)
|
|
30
43
|
|
|
31
|
-
**3.
|
|
44
|
+
**3. Just ask** — no commands to learn. Paste a link and say what you want:
|
|
32
45
|
|
|
33
|
-
>
|
|
46
|
+
> Summarize this in 5 bullet points: https://en.wikipedia.org/wiki/Large_language_model
|
|
34
47
|
|
|
35
|
-
Claude Desktop, Codex
|
|
48
|
+
Setup for Claude Desktop (one-click), Codex and Cursor is under [Install](#install).
|
|
36
49
|
|
|
37
|
-
###
|
|
50
|
+
### How it works
|
|
38
51
|
|
|
39
|
-
linkbrief
|
|
52
|
+
linkbrief is a **tool your agent uses**. The agent decides what to read and when.
|
|
40
53
|
|
|
41
54
|
```
|
|
42
|
-
|
|
55
|
+
You: "Compare these two articles: <link 1> <link 2>"
|
|
43
56
|
│
|
|
44
57
|
▼
|
|
45
|
-
Claude
|
|
46
|
-
│
|
|
58
|
+
Agent (Claude, Codex, …) ── two links → calls fetch_pages
|
|
59
|
+
│ page was cut off → calls fetch_page to read the rest
|
|
47
60
|
▼
|
|
48
|
-
linkbrief (
|
|
61
|
+
linkbrief (runs on your machine) ── fetches pages/PDFs, keeps only the main content as Markdown
|
|
49
62
|
│
|
|
50
63
|
▼
|
|
51
|
-
|
|
64
|
+
Agent reads it and answers
|
|
52
65
|
```
|
|
53
66
|
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
67
|
+
- One link → `fetch_page`; several → `fetch_pages`. The agent picks.
|
|
68
|
+
- When a page is long, the result ends with a note and the agent **continues reading on its own**.
|
|
69
|
+
- The first time, your agent may ask permission to use the tool. Choose "always allow" to skip the prompt next time.
|
|
57
70
|
|
|
58
|
-
##
|
|
71
|
+
## Token savings
|
|
59
72
|
|
|
60
|
-
|
|
73
|
+
We compared the raw HTML of real blog, news and wiki pages from several countries with what linkbrief returns (character counts, measured 2026-11-26).
|
|
61
74
|
|
|
62
|
-
| |
|
|
75
|
+
| | Raw HTML | linkbrief |
|
|
63
76
|
|---|---:|---:|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
77
|
+
| Size | ~2.02M characters | ~92K characters |
|
|
78
|
+
| **Saved** | | **~95% (92–99% per page)** |
|
|
66
79
|
|
|
67
|
-
|
|
80
|
+
Tokens scale roughly with characters, so the token saving is about the same. Fewer tokens means **usage limits last longer, answers come faster, and long conversations keep more context.**
|
|
68
81
|
|
|
69
|
-
|
|
82
|
+
Where the savings come from:
|
|
70
83
|
|
|
71
|
-
|
|
|
84
|
+
| Method | Effect |
|
|
72
85
|
|---|---|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
|
|
|
78
|
-
| **
|
|
86
|
+
| **Main content only** (Mozilla Readability) | Drops menus, ads, comments, footers and scripts — most of the saving |
|
|
87
|
+
| **No images or icons** | Image URLs alone can double a page's size |
|
|
88
|
+
| **Link URLs removed** (default) | Keeps the link text only: 49–66% less on link-heavy pages. Keep them with `include_links` |
|
|
89
|
+
| **Find passages** | `find` returns only the blocks that mention your words, with context: 76–88% less than the whole page on long documents |
|
|
90
|
+
| **Outline first, then one section** | `outline` returns the headings with sizes; `section` returns just one part. 82–91% less than the whole page on long documents (below) |
|
|
91
|
+
| **Paging** | Up to 20,000 characters per call; the agent asks for more with `start_index` only when needed |
|
|
92
|
+
| **Per-page cap for many links** | `fetch_pages` returns up to 8,000 characters per page by default |
|
|
93
|
+
| **10-minute cache** | Reading the next part of a page does not download it again (the second call returns in milliseconds) |
|
|
94
|
+
|
|
95
|
+
Outline first, then one section, compared with reading the whole page (characters, measured 2026-11-27):
|
|
96
|
+
|
|
97
|
+
| Page | Whole page | Outline + one section | Saved |
|
|
98
|
+
|---|---:|---:|---:|
|
|
99
|
+
| English Wikipedia, "Large language model" | 101,576 | 8,172 + 5,021 | 87% |
|
|
100
|
+
| Namuwiki, "김치" | 46,131 | 2,733 + 5,355 | 82% |
|
|
101
|
+
| arXiv paper PDF (15 pages) | 39,790 | 1,638 + 1,916 | 91% |
|
|
79
102
|
|
|
80
|
-
##
|
|
103
|
+
## Install
|
|
81
104
|
|
|
82
|
-
Node.js 22.12
|
|
105
|
+
Requires Node.js 22.12 or later.
|
|
83
106
|
|
|
84
107
|
**Claude Code**
|
|
85
108
|
|
|
@@ -87,7 +110,15 @@ Node.js 22.12 이상이 필요합니다 (Node 20은 2026년 4월 지원 종료).
|
|
|
87
110
|
claude mcp add linkbrief -s user -- npx -y linkbrief-mcp
|
|
88
111
|
```
|
|
89
112
|
|
|
90
|
-
|
|
113
|
+
On Windows:
|
|
114
|
+
|
|
115
|
+
```powershell
|
|
116
|
+
claude mcp add linkbrief -s user -- cmd /c npx -y linkbrief-mcp
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Claude Desktop, one click** — download `linkbrief.mcpb` from the [latest release](https://github.com/KDDYYY/linkbrief-mcp/releases/latest) and double-click it (or drag it into Settings → Extensions). You can add an optional GitHub token there.
|
|
120
|
+
|
|
121
|
+
**Claude Desktop, by config** — add to `claude_desktop_config.json` (Settings → Developer → Edit Config):
|
|
91
122
|
|
|
92
123
|
```json
|
|
93
124
|
{
|
|
@@ -97,7 +128,7 @@ claude mcp add linkbrief -s user -- npx -y linkbrief-mcp
|
|
|
97
128
|
}
|
|
98
129
|
```
|
|
99
130
|
|
|
100
|
-
**Codex (OpenAI)** — `~/.codex/config.toml
|
|
131
|
+
**Codex (OpenAI)** — add to `~/.codex/config.toml` (CLI, IDE extension and app):
|
|
101
132
|
|
|
102
133
|
```toml
|
|
103
134
|
[mcp_servers.linkbrief]
|
|
@@ -105,11 +136,11 @@ command = "npx"
|
|
|
105
136
|
args = ["-y", "linkbrief-mcp"]
|
|
106
137
|
```
|
|
107
138
|
|
|
108
|
-
Windows
|
|
139
|
+
If Windows cannot find `npx`, use `command = "cmd"` and `args = ["/c", "npx", "-y", "linkbrief-mcp"]`. With the Codex CLI you can also run `codex mcp add linkbrief -- npx -y linkbrief-mcp`.
|
|
109
140
|
|
|
110
|
-
**Cursor
|
|
141
|
+
**Cursor and other MCP clients** — register `npx -y linkbrief-mcp` as a stdio server.
|
|
111
142
|
|
|
112
|
-
|
|
143
|
+
**From source**
|
|
113
144
|
|
|
114
145
|
```bash
|
|
115
146
|
git clone https://github.com/KDDYYY/linkbrief-mcp.git
|
|
@@ -118,212 +149,260 @@ npm install
|
|
|
118
149
|
claude mcp add linkbrief -s user -- node "$(pwd)/server.mjs"
|
|
119
150
|
```
|
|
120
151
|
|
|
121
|
-
Windows PowerShell
|
|
152
|
+
In Windows PowerShell, use `claude mcp add linkbrief -s user -- node "$PWD\server.mjs"` for the last line.
|
|
153
|
+
|
|
154
|
+
**Check** — `/mcp` in Claude Code or `claude mcp list` in a terminal should show `linkbrief` connected (`✔ Connected`). Restart your agent after changing its configuration.
|
|
122
155
|
|
|
123
|
-
|
|
156
|
+
## Usage
|
|
124
157
|
|
|
125
|
-
|
|
158
|
+
Talk to your agent as usual and include the link. It calls linkbrief by itself.
|
|
126
159
|
|
|
127
|
-
|
|
160
|
+
**Summarize**
|
|
128
161
|
|
|
129
|
-
|
|
162
|
+
> Summarize this in 5 bullet points: https://en.wikipedia.org/wiki/Large_language_model
|
|
130
163
|
|
|
131
|
-
|
|
164
|
+
**Read another language, answer in yours**
|
|
132
165
|
|
|
133
|
-
|
|
166
|
+
> Summarize this Japanese news page in English: https://www3.nhk.or.jp/news/
|
|
134
167
|
|
|
135
|
-
|
|
168
|
+
**PDFs** — papers, reports and press releases work with just the link. See [Reading PDFs](#reading-pdfs).
|
|
136
169
|
|
|
137
|
-
|
|
170
|
+
> List the paper's three main contributions and its results: https://arxiv.org/pdf/1706.03762
|
|
138
171
|
|
|
139
|
-
|
|
172
|
+
**Code review and debugging**
|
|
140
173
|
|
|
141
|
-
|
|
174
|
+
> Summarize the discussion on this PR and list the changed files: https://github.com/owner/repo/pull/123
|
|
142
175
|
|
|
143
|
-
>
|
|
176
|
+
> What is the accepted fix here, and why does it work? https://stackoverflow.com/questions/11227809
|
|
144
177
|
|
|
145
|
-
|
|
178
|
+
**A whole docs section** — `fetch_site` follows links under the start page's folder (up to 30 pages, robots.txt respected). If the site publishes an `llms.txt` index for language models (Stripe, Vercel, Anthropic and many docs sites do), it is used first.
|
|
146
179
|
|
|
147
|
-
|
|
180
|
+
> Read the Python tutorial and give me a one-page cheat sheet: https://docs.python.org/3/tutorial/index.html
|
|
148
181
|
|
|
149
|
-
|
|
182
|
+
**Office files** — Word, PowerPoint, Excel and Hangul (.hwpx) links work like PDFs.
|
|
150
183
|
|
|
151
|
-
|
|
184
|
+
> Summarize this deck slide by slide: https://example.org/files/q3-review.pptx
|
|
152
185
|
|
|
153
|
-
|
|
186
|
+
**Pick the format**
|
|
154
187
|
|
|
155
|
-
|
|
188
|
+
> Summarize this in 3 lines, then put every number and date in a table: https://…
|
|
156
189
|
|
|
157
|
-
>
|
|
190
|
+
> From this tutorial, list only the tools used and the steps: https://…
|
|
158
191
|
|
|
159
|
-
|
|
192
|
+
**Several links at once** — up to 10 per call (`fetch_pages`). If one fails, the others still come back.
|
|
160
193
|
|
|
161
|
-
>
|
|
194
|
+
> Compare how these three articles cover the story, as a table: https://… https://… https://…
|
|
162
195
|
|
|
163
|
-
|
|
196
|
+
**Cite sources** — every result starts with site, author, date and URL, so you can ask for citations.
|
|
164
197
|
|
|
165
|
-
|
|
198
|
+
> Summarize this and end with the source (site, author, date): https://…
|
|
166
199
|
|
|
167
|
-
|
|
200
|
+
**Just the answer** — for a question about a long page, the agent searches it with `find` and reads only the passages that mention your terms:
|
|
168
201
|
|
|
169
|
-
|
|
202
|
+
> What does this article say about hallucination? https://en.wikipedia.org/wiki/Large_language_model
|
|
170
203
|
|
|
171
|
-
|
|
204
|
+
**Only the part you need** — the agent looks at the outline, then reads one section. Each section comes with a link you can cite (`…/Large_language_model#History`). You can also ask for it directly:
|
|
172
205
|
|
|
173
|
-
|
|
206
|
+
> Show me the outline of this page first, then read only the section on training: https://en.wikipedia.org/wiki/Large_language_model
|
|
174
207
|
|
|
175
|
-
|
|
208
|
+
**Long documents** — up to 20,000 characters per call; the agent continues with `start_index` when it needs more.
|
|
176
209
|
|
|
177
|
-
|
|
210
|
+
> Read this whole document and summarize each chapter: https://…
|
|
211
|
+
|
|
212
|
+
**Keep link URLs** — off by default to save tokens. Turn them on when you need them:
|
|
213
|
+
|
|
214
|
+
> Summarize this page and keep the reference links (include_links on): https://…
|
|
215
|
+
|
|
216
|
+
### Reading PDFs
|
|
217
|
+
|
|
218
|
+
**1. Get the PDF's address.** Right-click the PDF link or download button → **Copy link address**, or, if the PDF is open in your browser, copy the **address bar**.
|
|
219
|
+
|
|
220
|
+

|
|
221
|
+
|
|
222
|
+
**2. Ask your agent with the address.** linkbrief downloads the PDF and extracts its text page by page.
|
|
223
|
+
|
|
224
|
+

|
|
225
|
+
|
|
226
|
+
<sub>Example: the `fetch_page` result is real linkbrief output (cut before the lines with the authors' e-mail addresses); the summary was written by Claude from it.</sub>
|
|
227
|
+
|
|
228
|
+
| Situation | What happens |
|
|
178
229
|
|---|---|
|
|
179
|
-
|
|
|
180
|
-
|
|
|
181
|
-
|
|
|
182
|
-
|
|
|
183
|
-
|
|
|
184
|
-
|
|
|
185
|
-
|
|
|
186
|
-
|
|
|
230
|
+
| The address does not end in `.pdf` (`download?id=…`) | Read as a PDF if the server sends one |
|
|
231
|
+
| Page markers such as `## Page 3` | Ask "which page says…?" or "summarize page 3 only" |
|
|
232
|
+
| Long PDFs | Read 20,000 characters at a time; ask to "read to the end" and the agent continues |
|
|
233
|
+
| The `PDF, 15 pages` line at the top | Page count plus the title, author and date stored in the PDF |
|
|
234
|
+
| **A PDF file on your computer** | linkbrief reads web addresses only. Attach the file to your agent directly |
|
|
235
|
+
| PDFs that need a login or a button click to download | Cannot be fetched from the address alone. Download it and attach it |
|
|
236
|
+
| Scanned PDFs (images of text) | No text to extract (`PDF has no extractable text`); OCR is not supported |
|
|
237
|
+
| PDFs over 30 MB | Not read |
|
|
187
238
|
|
|
188
|
-
### JavaScript
|
|
239
|
+
### JavaScript-heavy pages
|
|
189
240
|
|
|
190
|
-
|
|
241
|
+
When a plain request comes back empty or blocked (HTTP 403, 429 or 503), linkbrief **retries in the Chrome or Edge already installed on your machine**, headless. No setup needed.
|
|
191
242
|
|
|
192
|
-
-
|
|
193
|
-
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
-
|
|
243
|
+
- No browser download: it uses your installed Chrome or Edge (through the optional `puppeteer-core` package).
|
|
244
|
+
- A **fresh profile** every time, so your logins and cookies are never used.
|
|
245
|
+
- Every request the page makes goes through the same private-address check.
|
|
246
|
+
- Turn it off with `LINKBRIEF_BROWSER=off`, or point at another browser with `LINKBRIEF_BROWSER=<path to executable>`.
|
|
247
|
+
- **Bot checks such as Cloudflare are reported, never bypassed.**
|
|
197
248
|
|
|
198
|
-
###
|
|
249
|
+
### Troubleshooting
|
|
199
250
|
|
|
200
|
-
|
|
|
251
|
+
| Message or symptom | What to do |
|
|
201
252
|
|---|---|
|
|
202
|
-
|
|
|
203
|
-
| `Page text too short` |
|
|
204
|
-
| `This site shows a bot check` |
|
|
205
|
-
| `
|
|
206
|
-
| `
|
|
207
|
-
| `
|
|
208
|
-
| `
|
|
209
|
-
| `
|
|
210
|
-
| `
|
|
211
|
-
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
253
|
+
| The agent says it cannot open links instead of using the tool | Restart the agent and check `claude mcp list` shows `✔ Connected`. You can also say "read it with linkbrief" |
|
|
254
|
+
| `Page text too short` | The page needs a login, or it renders with JavaScript and no Chrome/Edge was found |
|
|
255
|
+
| `This site shows a bot check` | The site requires a bot check (e.g. Medium, Reddit). linkbrief does not bypass it |
|
|
256
|
+
| `GitHub API: API rate limit exceeded` | Set a `GITHUB_TOKEN` environment variable (or the token field in the Claude Desktop extension) |
|
|
257
|
+
| `robots.txt on … asks automated tools not to read …` | The site opted out of automated reading (`fetch_site`, or `LINKBRIEF_ROBOTS=always`) |
|
|
258
|
+
| `Old binary .hwp files are not supported` | Save the file as .hwpx or PDF, or attach it to your agent |
|
|
259
|
+
| `Refusing to fetch a private or local address` | `localhost` and private network addresses are blocked for safety |
|
|
260
|
+
| `PDF has no extractable text` | A scanned PDF; OCR is not supported |
|
|
261
|
+
| `Could not reach …` / timeouts | The site is slow or unreachable. Try again later (linkbrief retries once automatically) |
|
|
262
|
+
| `Google search result pages block automated access` | Use your agent's own web search, or pass a result page's address |
|
|
263
|
+
| `npx` errors or an `EBADENGINE` warning on install | Check `node --version` is 22.12 or later |
|
|
264
|
+
|
|
265
|
+
## Tools
|
|
266
|
+
|
|
267
|
+
### `fetch_page` — read one page
|
|
268
|
+
|
|
269
|
+
| Argument | Default | Description |
|
|
270
|
+
|---|---|---|
|
|
271
|
+
| `url` | (required) | http/https address of a web page or PDF |
|
|
272
|
+
| `max_length` | 20000 | Maximum characters returned per call (1,000–100,000) |
|
|
273
|
+
| `start_index` | 0 | Where to continue a long page; a cut-off result tells you the next value |
|
|
274
|
+
| `include_links` | false | Keep link URLs. By default only the link text is kept |
|
|
275
|
+
| `render` | false | Use the browser from the start. Rarely needed: empty or blocked pages fall back automatically |
|
|
276
|
+
| `outline` | false | Return only the headings, with each section's size and first line |
|
|
277
|
+
| `section` | — | Return one section and its subsections: an outline number (`"#3"`) or heading text (`"History"`, `"Page 4"`) |
|
|
278
|
+
| `find` | — | Return only passages that mention these words or `"quoted phrases"`, with context. Combine with `section` to search one part |
|
|
279
|
+
|
|
280
|
+
### `fetch_site` — read a docs site or section
|
|
281
|
+
|
|
282
|
+
| Argument | Default | Description |
|
|
218
283
|
|---|---|---|
|
|
219
|
-
| `url` | (
|
|
220
|
-
| `
|
|
221
|
-
| `
|
|
222
|
-
| `include_links` | false |
|
|
223
|
-
| `render` | false | 처음부터 브라우저로 읽기. 보통은 필요 없습니다 (자동 대체됨) |
|
|
284
|
+
| `url` | (required) | Start page; only links under its folder are followed (`https://docs.example.com/guide/…`) |
|
|
285
|
+
| `max_pages` | 10 | Maximum pages to read (1–30) |
|
|
286
|
+
| `max_length_per_page` | 4000 | Maximum characters per page (500–20,000) |
|
|
287
|
+
| `include_links` | false | Keep link URLs |
|
|
224
288
|
|
|
225
|
-
|
|
289
|
+
Pages are read breadth-first with a pause between requests, and robots.txt is always honoured. When the site has `/llms.txt`, it is read first and the pages it lists come next.
|
|
226
290
|
|
|
227
|
-
|
|
291
|
+
### `fetch_pages` — read several pages
|
|
292
|
+
|
|
293
|
+
| Argument | Default | Description |
|
|
228
294
|
|---|---|---|
|
|
229
|
-
| `urls` | (
|
|
230
|
-
| `max_length_per_page` | 8000 |
|
|
231
|
-
| `include_links` | false |
|
|
295
|
+
| `urls` | (required) | 1–10 addresses |
|
|
296
|
+
| `max_length_per_page` | 8000 | Maximum characters per page (1,000–50,000) |
|
|
297
|
+
| `include_links` | false | Keep link URLs |
|
|
232
298
|
|
|
233
|
-
|
|
299
|
+
An outline looks like this:
|
|
234
300
|
|
|
235
301
|
```
|
|
236
|
-
#
|
|
237
|
-
Source:
|
|
302
|
+
# Large language model
|
|
303
|
+
Source: Wikimedia Foundation, Inc. | … | URL: https://en.wikipedia.org/wiki/Large_language_model
|
|
304
|
+
|
|
305
|
+
Outline: 62 sections, 101,576 characters in total. Read one with section="#N" or its heading text.
|
|
238
306
|
|
|
239
|
-
|
|
307
|
+
- #1 History (4,837 chars): The training compute of notable large models …
|
|
308
|
+
- #2 Dataset preprocessing (2,983 chars)
|
|
309
|
+
- #3 Tokenization (2,085 chars): As machine learning algorithms process numbers rather than text, …
|
|
240
310
|
```
|
|
241
311
|
|
|
242
|
-
|
|
312
|
+
Every full result has this shape:
|
|
243
313
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
| 위키백과, BBC, 르몽드, 인민망, 타이랏, VnExpress 등 일반 기사·문서 | ✅ |
|
|
248
|
-
| PDF (영어·한국어 확인, 페이지별 구분) | ✅ |
|
|
249
|
-
| JavaScript로 그려지는 페이지 | ✅ Chrome·Edge가 있으면 자동 |
|
|
250
|
-
| EUC-KR, Shift_JIS, EUC-JP, GBK/GB2312, Big5, TIS-620, windows-1258 | ✅ |
|
|
251
|
-
| 네이버 카페 | ⚠️ 로그인 없이 공개된 글만. 로그인·회원 전용 글은 읽지 않고 그렇다고 알려 줍니다 (내 계정을 쓰지 않음) |
|
|
252
|
-
| Medium, Stack Overflow 등 봇 확인(Cloudflare)을 거는 사이트 | ❌ 우회하지 않습니다 |
|
|
253
|
-
| Google 검색 결과 페이지 | ❌ Google이 자동 접근을 막습니다. Claude의 웹 검색을 쓰세요 |
|
|
254
|
-
| YouTube 자막, 로그인이 필요한 글, 스캔 PDF, 이미지·동영상 | ❌ |
|
|
314
|
+
```
|
|
315
|
+
# Title
|
|
316
|
+
Source: Site | Author: Name | Published: 2026-11-25 | URL: https://…
|
|
255
317
|
|
|
256
|
-
|
|
318
|
+
Main content as Markdown
|
|
319
|
+
```
|
|
257
320
|
|
|
258
|
-
|
|
321
|
+
## Supported sites
|
|
259
322
|
|
|
260
|
-
|
|
323
|
+
| Target | Status |
|
|
324
|
+
|---|---|
|
|
325
|
+
| Wikipedia (any language), MDN, Python docs, Google Blog, GitHub repositories | ✅ |
|
|
326
|
+
| GitHub issues and PRs (all comments, changed files), GitHub code files (raw) | ✅ via the GitHub API (60 requests/hour, more with `GITHUB_TOKEN`) |
|
|
327
|
+
| Stack Overflow, Super User, Server Fault, Ask Ubuntu, *.stackexchange.com questions | ✅ via the Stack Exchange API (question + top 10 answers) |
|
|
328
|
+
| Hacker News threads, arXiv (abstract page → paper) | ✅ |
|
|
329
|
+
| News: BBC, The Verge, Le Monde, Der Spiegel, NHK, People's Daily, Thairath, VnExpress, … | ✅ |
|
|
330
|
+
| Korean sites: Naver Blog, Naver News, Daum News, Namuwiki, Tistory, Brunch, Velog | ✅ |
|
|
331
|
+
| PDFs (checked in English and Korean, split by page) | ✅ |
|
|
332
|
+
| Word (.docx), PowerPoint (.pptx), Excel (.xlsx, first 200 rows per sheet), Hangul (.hwpx) | ✅ |
|
|
333
|
+
| Old binary Hangul (.hwp) | ❌ save as .hwpx or PDF |
|
|
334
|
+
| JavaScript-rendered pages | ✅ automatic when Chrome or Edge is installed |
|
|
335
|
+
| Shift_JIS, EUC-JP, GBK/GB2312, Big5, EUC-KR, TIS-620, windows-1258 | ✅ |
|
|
336
|
+
| Sites behind bot checks: Medium, Reddit, … (Stack Overflow pages other than questions) | ❌ not bypassed |
|
|
337
|
+
| Google Search result pages | ❌ Google blocks automated access; use your agent's web search |
|
|
338
|
+
| YouTube transcripts, pages behind a login, scanned PDFs, images, video | ❌ |
|
|
339
|
+
|
|
340
|
+
Live check against real sites (`npm run check:live`, 2026-11-27). Medium and Reddit (bot checks) and Google Search are refused on purpose:
|
|
341
|
+
|
|
342
|
+

|
|
343
|
+
|
|
344
|
+
## Settings
|
|
345
|
+
|
|
346
|
+
All optional, as environment variables (in Claude Desktop/Codex config under `env`):
|
|
347
|
+
|
|
348
|
+
| Variable | Effect |
|
|
349
|
+
|---|---|
|
|
350
|
+
| `HTTPS_PROXY` / `HTTP_PROXY`, `NO_PROXY` | Corporate proxy: requests (and the browser fallback) go through it; `NO_PROXY` hosts go direct |
|
|
351
|
+
| `GITHUB_TOKEN` | Raises GitHub API limits from 60 to 5,000 requests/hour for issues and PRs |
|
|
352
|
+
| `LINKBRIEF_ROBOTS=always` | Also honour robots.txt for single links (`fetch_site` always does) |
|
|
353
|
+
| `LINKBRIEF_BROWSER=off` / `=<path>` | Disable the browser fallback, or use a specific Chrome/Edge |
|
|
354
|
+
|
|
355
|
+
## Security
|
|
261
356
|
|
|
262
|
-
-
|
|
263
|
-
-
|
|
264
|
-
-
|
|
265
|
-
-
|
|
357
|
+
- **Private networks blocked:** `localhost`, private IPs (10.x, 192.168.x, …), link-local and cloud metadata addresses (169.254.169.254) are refused. Every redirect and every request the browser makes is checked again. This keeps a prompt-injected page from making your agent read your router or internal network.
|
|
358
|
+
- **Size limits:** web pages up to 5 MB, PDFs and Office files up to 30 MB (and 60 MB unpacked); other file types are refused.
|
|
359
|
+
- **Polite crawling:** `fetch_site` stays inside one folder of one site, honours robots.txt and pauses between requests. Single links you ask for are fetched like a browser would.
|
|
360
|
+
- **Browser isolation:** the headless browser opens with a fresh profile and is closed after each page.
|
|
361
|
+
- Fetched content is labeled for the agent as data, not instructions.
|
|
266
362
|
|
|
267
|
-
##
|
|
363
|
+
## Development
|
|
268
364
|
|
|
269
365
|
```bash
|
|
270
366
|
npm install
|
|
271
|
-
npm test #
|
|
272
|
-
npm run check:live #
|
|
273
|
-
npm run check:live -- <URL> #
|
|
274
|
-
node page.mjs <URL> #
|
|
275
|
-
node page.mjs <URL> --render #
|
|
367
|
+
npm test # unit tests, local-server end-to-end tests and fuzzing (no network)
|
|
368
|
+
npm run check:live # check real sites (needs internet)
|
|
369
|
+
npm run check:live -- <URL> # check specific addresses
|
|
370
|
+
node page.mjs <URL> # print the extraction for one page
|
|
371
|
+
node page.mjs <URL> --render # same, through the browser
|
|
276
372
|
```
|
|
277
373
|
|
|
278
|
-
|
|
|
374
|
+
| File | Role |
|
|
279
375
|
|---|---|
|
|
280
|
-
| `server.mjs` |
|
|
281
|
-
| `
|
|
282
|
-
| `
|
|
283
|
-
| `
|
|
284
|
-
| `
|
|
376
|
+
| `server.mjs` | stdio entry point |
|
|
377
|
+
| `tools.mjs` | MCP tools: `fetch_page`, `fetch_pages`, `fetch_site` |
|
|
378
|
+
| `page.mjs` | Fetching, safety checks, encodings, extraction (Readability → Markdown), PDFs, cache |
|
|
379
|
+
| `browser.mjs` | Reading JavaScript pages with the installed Chrome or Edge (optional) |
|
|
380
|
+
| `office.mjs` | Word, PowerPoint, Excel and Hangul (.hwpx) files |
|
|
381
|
+
| `robots.mjs` | robots.txt parsing |
|
|
382
|
+
| `manifest.json`, `server.json` | Claude Desktop extension and MCP Registry metadata (`npm run build:mcpb` builds `dist/linkbrief.mcpb`) |
|
|
383
|
+
| `sites.mjs` | Per-site rules |
|
|
384
|
+
| `test.mjs`, `test-http.mjs`, `test-proxy.mjs`, `test-fuzz.mjs` | Unit tests; the full fetch path and MCP tools against a local HTTP server; proxy support against a local proxy; seeded random-input checks |
|
|
385
|
+
| `fixtures/` | Test HTML written for this project (it mimics site structure; no real articles) |
|
|
285
386
|
|
|
286
|
-
###
|
|
387
|
+
### Adding a site
|
|
287
388
|
|
|
288
|
-
`sites
|
|
389
|
+
Add a rule to the `sites` array in `sites.mjs` and a test to `test.mjs`:
|
|
289
390
|
|
|
290
391
|
```js
|
|
291
392
|
{
|
|
292
393
|
name: "example",
|
|
293
394
|
match: (u) => u.hostname === "example.com",
|
|
294
|
-
rewrite: (u) => u.href.replace("/view/", "/print/"), //
|
|
295
|
-
//
|
|
395
|
+
rewrite: (u) => u.href.replace("/view/", "/print/"), // use the address that holds the article
|
|
396
|
+
// pick: (document) => document.querySelector("#article"), // or point at the article element
|
|
397
|
+
// load: async (u, getJson) => ({ markdown, title }), // or read it through the site's public API
|
|
398
|
+
// refuse: "This site cannot be fetched because …", // or explain why it cannot be read
|
|
296
399
|
}
|
|
297
400
|
```
|
|
298
401
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
## 라이선스
|
|
302
|
-
|
|
303
|
-
MIT
|
|
402
|
+
If a test needs HTML, write your own that mimics the site's structure instead of copying a real article into `fixtures/`.
|
|
304
403
|
|
|
305
|
-
|
|
404
|
+
Issues and pull requests are welcome — especially "this site doesn't work" reports with the URL.
|
|
306
405
|
|
|
307
|
-
##
|
|
406
|
+
## License
|
|
308
407
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
**Token savings:** on real blog, news and wiki pages, linkbrief output is **about 95% smaller** than the raw HTML (92–99% per page). Link URLs are stripped by default (49–66% less on link-heavy pages), long pages are paged, and pages are cached for 10 minutes.
|
|
312
|
-
|
|
313
|
-
**Quick start (Claude Code):** run `claude mcp add linkbrief -s user -- npx -y linkbrief-mcp` (npx fetches it from npm; no separate install), reopen Claude Code and type `/mcp` to see `linkbrief` connected with the `fetch_page` and `fetch_pages` tools, then just ask with a link. linkbrief is a tool the agent uses: Claude decides when to call it, picks `fetch_pages` for several links, and reads long pages in parts on its own.
|
|
314
|
-
|
|
315
|
-
**Install (Claude Code):** `claude mcp add linkbrief -s user -- npx -y linkbrief-mcp`
|
|
316
|
-
**Claude Desktop:** add `"linkbrief": { "command": "npx", "args": ["-y", "linkbrief-mcp"] }` under `mcpServers`.
|
|
317
|
-
**Codex:** add `[mcp_servers.linkbrief]` with `command = "npx"` and `args = ["-y", "linkbrief-mcp"]` to `~/.codex/config.toml`.
|
|
318
|
-
|
|
319
|
-
**Tools:** `fetch_page` — `url`, `max_length` (20000), `start_index`, `include_links` (false), `render` (false). `fetch_pages` — up to 10 `urls`, `max_length_per_page` (8000), `include_links`.
|
|
320
|
-
|
|
321
|
-
**PDFs:** pass the PDF's web address (right-click the link → copy link address, or copy the address bar of an open PDF). Text comes back per page (`## Page N`) with title, author, date and page count; URLs that don't end in `.pdf` work when the server sends a PDF. Local files, login-only or button-triggered downloads and scanned PDFs are not supported — attach those to Claude directly.
|
|
322
|
-
|
|
323
|
-
**JavaScript pages:** when a plain request comes back empty or blocked (403/429/503), linkbrief retries in the Chrome or Edge already installed (via the optional `puppeteer-core`; no browser download), with a fresh profile and the same private-address checks on every request. Disable with `LINKBRIEF_BROWSER=off`. Bot checks such as Cloudflare are reported, never bypassed.
|
|
324
|
-
|
|
325
|
-
**Safety:** refuses localhost, private/link-local networks and cloud metadata addresses (re-checked on every redirect and browser request), reads at most 5 MB per page and 30 MB per PDF, and accepts HTML/text/PDF only.
|
|
326
|
-
|
|
327
|
-
**Not supported:** Google Search result pages, sites behind bot checks (e.g. Medium, Stack Overflow), YouTube transcripts, pages behind a login (Naver Cafe posts are read only when public, otherwise reported), scanned PDFs.
|
|
328
|
-
|
|
329
|
-
Development: `npm test` (offline), `npm run check:live` (real sites). Site-specific rules live in `sites.mjs`. License: MIT.
|
|
408
|
+
MIT
|