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.md CHANGED
@@ -1,85 +1,108 @@
1
1
  # linkbrief-mcp
2
2
 
3
- Claude가 **내 PC에서 직접** 웹 페이지와 PDF를 읽게 해 주는 MCP 서버입니다. 링크를 주고 "요약해 줘"라고 하면, linkbrief가 본문만 Markdown으로 가져오고 Claude가 정리합니다. Codex, Cursor 등 MCP를 지원하는 다른 도구에서도 똑같이 쓸 수 있습니다.
3
+ **English** | [한국어](README.ko.md)
4
4
 
5
- 한국 사이트에 맞춰 만들었습니다: 네이버 블로그(iframe 구조), 네이버·다음 뉴스, 티스토리, 브런치, 벨로그, 다음 카페, 그리고 EUC-KR 같은 옛 인코딩. 영어·불어·중국어·일본어·태국어·베트남어 페이지도 깨지지 않고 읽습니다.
5
+ [![npm](https://img.shields.io/npm/v/linkbrief-mcp)](https://www.npmjs.com/package/linkbrief-mcp)
6
+ [![test](https://github.com/KDDYYY/linkbrief-mcp/actions/workflows/test.yml/badge.svg)](https://github.com/KDDYYY/linkbrief-mcp/actions/workflows/test.yml)
7
+ [![license](https://img.shields.io/npm/l/linkbrief-mcp)](LICENSE)
6
8
 
7
- [English](#english)
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
- ![프랑스어 위키백과 글을 linkbrief로 가져와 Claude가 한국어로 요약하는 예시](docs/images/usage.png)
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
- <sub>사용 예시: `fetch_page` 호출과 결과는 실제 linkbrief 출력이고, 요약은 Claude가 그 결과로 작성한 것입니다. (문서: 프랑스어 위키백과 「Kimchi」, CC BY-SA)</sub>
13
+ ![Claude summarizing a French Wikipedia article in English with linkbrief](docs/images/usage-en.png)
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
- - **토큰을 95% 아낍니다.** 웹 페이지 HTML의 대부분은 메뉴·광고·스크립트·이미지 주소입니다. linkbrief는 본문만 남겨 넘깁니다. ([측정 결과](#토큰-절감-효과))
16
- - **막힌 사이트도 읽습니다.** Claude의 기본 웹 가져오기는 일부 사이트(예: `blog.naver.com`)가 막혀 있습니다. linkbrief는 **사용자 PC에서 일반 브라우저처럼** 요청합니다.
17
- - **네이버 블로그가 비어 보이지 않습니다.** 본문이 iframe 안에 있어 그냥 가져오면 비어 있는데, linkbrief는 본문이 들어 있는 모바일 주소로 바꿔 읽습니다.
18
- - **PDF, 여러 링크, JavaScript 페이지까지** 한 도구로 처리합니다.
19
- - **API 키가 필요 없습니다.** 요약은 사용 중인 Claude가 합니다.
17
+ ## Why linkbrief
20
18
 
21
- ## 빠른 시작 (Claude Code 기준, 3단계)
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
- **1. 설치** — 터미널에서 한 줄. npm에서 자동으로 받아 실행하므로 `npm install`을 따로 할 필요가 없습니다.
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
- **2. 연결 확인** — Claude Code를 다시 열고 대화창에 `/mcp`를 입력하면 연결된 MCP 서버 목록이 나옵니다. `linkbrief`가 연결됨으로 보이고 도구 `fetch_page`, `fetch_pages`가 있으면 준비 끝입니다. (터미널에서는 `claude mcp list`)
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. 그냥 부탁하기** — 명령어를 외울 필요가 없습니다. 링크와 함께 평소처럼 말하면 Claude가 알아서 linkbrief를 불러 씁니다.
44
+ **3. Just ask** — no commands to learn. Paste a link and say what you want:
32
45
 
33
- > 이 글 3줄로 요약해 줘: https://blog.naver.com/아이디/글번호
46
+ > Summarize this in 5 bullet points: https://en.wikipedia.org/wiki/Large_language_model
34
47
 
35
- Claude Desktop, Codex, Cursor 설정은 아래 [설치](#설치)를 보세요.
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는 **에이전트가 쓰는 도구**입니다. 무엇을 언제 읽을지는 Claude(에이전트)가 대화를 보고 스스로 정합니다.
52
+ linkbrief is a **tool your agent uses**. The agent decides what to read and when.
40
53
 
41
54
  ```
42
- 사용자: "이 두 기사 비교해 줘: 링크1 링크2"
55
+ You: "Compare these two articles: <link 1> <link 2>"
43
56
  │
44
57
  ▼
45
- Claude(에이전트) ── 링크가 여러 개네 → fetch_pages 호출
46
- │ 글이 길어서 잘렸네 → fetch_page로 이어 읽기
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 (내 PC에서 실행) ── 페이지·PDF를 받아 본문만 Markdown으로 정리
61
+ linkbrief (runs on your machine) ── fetches pages/PDFs, keeps only the main content as Markdown
49
62
  │
50
63
  ▼
51
- Claude가 읽고 비교·요약해서 답변
64
+ Agent reads it and answers
52
65
  ```
53
66
 
54
- - 링크가 하나면 `fetch_page`, 여러 개면 `fetch_pages`를 Claude가 골라 씁니다.
55
- - 글이 길면 결과 끝의 안내를 보고 Claude가 **스스로 다음 부분을 이어서** 읽습니다.
56
- - 처음 쓸 때 Claude가 도구 사용 허락을 물으면 허용하세요. 매번 묻지 않게 하려면 허락 창에서 "항상 허용"을 고르면 됩니다.
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
- 블로그·뉴스·위키 등 실제 국내외 페이지를 원본 HTML 그대로 넘길 때와 linkbrief 결과를 비교했습니다 (글자 수 기준, 2026-11-26 측정).
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
- | | 원본 HTML | linkbrief 결과 |
75
+ | | Raw HTML | linkbrief |
63
76
  |---|---:|---:|
64
- | 분량 | 약 202만 자 | 약 9만 자 |
65
- | **절감** | | **약 95% (페이지별 92~99%)** |
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
- | **본문만 추출** (Mozilla Readability) | 메뉴·광고·댓글·푸터·스크립트 제거 — 절감의 대부분 |
74
- | **이미지·아이콘 제거** | 이미지 주소만으로 분량이 2배가 되는 페이지도 있습니다 |
75
- | **링크 주소 제거** (기본값) | 링크 글자만 남김. 링크가 많은 문서에서 49~66% 추가 감소. 필요하면 `include_links`로 유지 |
76
- | **나눠 읽기** | 한 번에 2만 자까지만 넘기고, 더 필요할 때만 `start_index`로 이어 읽음 |
77
- | **여러 링크는 페이지당 상한** | `fetch_pages`는 기본 페이지당 8천 자 |
78
- | **10분 캐시** | 같은 페이지를 이어 읽을 때 다시 내려받지 않음 (두 번째 요청이 1천 분의 몇 초 만에 끝남) |
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 이상이 필요합니다 (Node 20은 2026년 4월 지원 종료).
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
- **Claude Desktop** — `claude_desktop_config.json`에 추가 (설정 → 개발자 → 설정 편집):
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`에 추가 (Codex CLI·IDE 확장·앱 공통):
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에서 `npx`를 찾지 못하면 `command = "cmd"`, `args = ["/c", "npx", "-y", "linkbrief-mcp"]`로 바꾸세요. Codex CLI가 있다면 `codex mcp add linkbrief -- npx -y linkbrief-mcp`로도 등록할 수 있습니다.
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 등 다른 MCP 클라이언트** — 명령 `npx -y linkbrief-mcp`를 stdio 서버로 등록하면 됩니다.
141
+ **Cursor and other MCP clients** — register `npx -y linkbrief-mcp` as a stdio server.
111
142
 
112
- **소스에서 직접 설치** — npm을 거치지 않고 GitHub 코드를 그대로 쓰려면:
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에서는 마지막 줄을 `claude mcp add linkbrief -s user -- node "$PWD\server.mjs"` 로 바꾸세요.
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
- **설치 확인** — Claude Code 대화창의 `/mcp` 또는 터미널의 `claude mcp list`에서 `linkbrief`가 연결됨(`✔ Connected`)으로 보이면 준비된 것입니다. 설치·설정을 바꾼 뒤에는 Claude를 **다시 시작**해야 적용됩니다.
156
+ ## Usage
124
157
 
125
- ## 사용 방법
158
+ Talk to your agent as usual and include the link. It calls linkbrief by itself.
126
159
 
127
- Claude에게 링크와 함께 평소 말투로 부탁하면 됩니다. Claude가 알아서 linkbrief 도구를 불러 본문을 읽습니다. 처음 쓸 때 도구 사용 허락을 묻는 창이 뜨면 허용해 주세요.
160
+ **Summarize**
128
161
 
129
- **기본 요약**
162
+ > Summarize this in 5 bullet points: https://en.wikipedia.org/wiki/Large_language_model
130
163
 
131
- > 이 글 한국어로 요약해 줘: https://blog.naver.com/아이디/글번호
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
- > https://fr.wikipedia.org/wiki/Kimchi 핵심만 5줄로 한국어 정리해 줘
168
+ **PDFs** — papers, reports and press releases work with just the link. See [Reading PDFs](#reading-pdfs).
136
169
 
137
- **PDF** — 논문, 보도자료, 보고서 링크도 그대로 주면 됩니다. 자세한 방법은 아래 [PDF 읽기](#pdf-읽기)를 보세요.
170
+ > List the paper's three main contributions and its results: https://arxiv.org/pdf/1706.03762
138
171
 
139
- > 이 논문 핵심 기여 3가지와 실험 결과만 정리해 줘: https://arxiv.org/pdf/1706.03762
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
- > 이 기사 3줄 요약하고, 등장하는 숫자·날짜만 표로 뽑아 줘: https://n.news.naver.com/article/...
176
+ > What is the accepted fix here, and why does it work? https://stackoverflow.com/questions/11227809
144
177
 
145
- > 이 블로그 글에서 사용한 도구와 단계별 방법만 정리해 줘: https://blog.naver.com/...
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
- **여러 링크 한 번에** — 최대 10개까지 한 번에 읽어 비교합니다 (`fetch_pages`). 일부가 실패해도 나머지는 읽습니다.
180
+ > Read the Python tutorial and give me a one-page cheat sheet: https://docs.python.org/3/tutorial/index.html
148
181
 
149
- > 이 세 기사의 논조를 비교해서 공통점과 차이점을 표로 정리해 줘: https://... https://... https://...
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
- > 요약 끝에 출처(사이트, 작성자, 날짜)도 적어 줘: https://...
186
+ **Pick the format**
154
187
 
155
- **긴 문서** — 한 번에 2만 자까지 읽고, 더 길면 Claude가 `start_index`로 이어서 읽습니다. 처음부터 끝까지 읽게 하려면:
188
+ > Summarize this in 3 lines, then put every number and date in a table: https://…
156
189
 
157
- > 이 문서 끝까지 다 읽고 장별로 요약해 줘: https://...
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
- > 이 페이지의 참고 링크 주소까지 포함해서 정리해 줘 (include_links 켜고): https://...
194
+ > Compare how these three articles cover the story, as a table: https://… https://… https://…
162
195
 
163
- ### PDF 읽기
196
+ **Cite sources** — every result starts with site, author, date and URL, so you can ask for citations.
164
197
 
165
- **1. PDF 주소를 구합니다.** 웹페이지의 PDF 링크·다운로드 버튼에서 오른쪽 클릭 → **링크 주소 복사**, 또는 브라우저에 PDF가 열려 있으면 **주소창**을 복사합니다.
198
+ > Summarize this and end with the source (site, author, date): https://…
166
199
 
167
- ![PDF 링크를 복사해 Claude에 붙여 넣는 3단계](docs/images/pdf-link.png)
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
- **2. Claude에 주소와 함께 부탁합니다.** linkbrief가 PDF를 받아 페이지별로 글자를 뽑고, Claude가 정리합니다.
202
+ > What does this article say about hallucination? https://en.wikipedia.org/wiki/Large_language_model
170
203
 
171
- ![arXiv 논문 PDF를 linkbrief로 읽어 한국어 4줄로 요약하는 과정](docs/images/pdf-demo.gif)
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
- <sub>예시: `fetch_page` 결과는 실제 linkbrief 출력(저자 이메일이 나오는 줄 앞에서 생략)이고, 요약은 Claude가 그 결과로 작성한 것입니다.</sub>
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
+ ![How to copy a PDF link and paste it to Claude](docs/images/pdf-link-en.png)
221
+
222
+ **2. Ask your agent with the address.** linkbrief downloads the PDF and extracts its text page by page.
223
+
224
+ ![Reading an arXiv paper PDF with linkbrief and summarizing it in four lines](docs/images/pdf-demo-en.gif)
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
- | 주소가 `.pdf`로 끝나지 않음 (`download.do?id=…` 등) | 서버가 PDF를 보내 주면 자동으로 PDF로 읽습니다 |
180
- | 결과에 `## Page 3` 같은 쪽 표시 | "몇 쪽에 나오는지", "3쪽만 요약해 줘"처럼 물어볼 수 있습니다 |
181
- | 긴 PDF | 2만 자씩 나눠 읽습니다. "끝까지 읽고 요약해 줘"라고 하면 Claude가 이어서 읽습니다 |
182
- | 결과 맨 위 `PDF, 15 pages` 줄 | 쪽수와 PDF에 적힌 제목·작성자·작성일이 함께 붙습니다 |
183
- | **내 컴퓨터에 있는 PDF 파일** | linkbrief는 인터넷 주소만 읽습니다. Claude 대화창에 **파일을 직접 첨부**하세요 |
184
- | 로그인해야 받을 수 있는 PDF, 버튼을 눌러야 받아지는 PDF | 주소만으로 받을 수 없어 읽지 못합니다. 내려받아 직접 첨부하세요 |
185
- | 스캔한 이미지 PDF | 글자가 없어 읽지 못합니다 (`PDF has no extractable text`) |
186
- | 30MB가 넘는 PDF | 읽지 않습니다 |
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
- 일반 요청으로 본문이 비어 오거나 차단(403·429·503)되면, linkbrief가 **PC에 설치된 Chrome 또는 Edge를 화면 없이 띄워** 다시 읽습니다. 별도 설정은 필요 없습니다.
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
- - 브라우저를 새로 내려받지 않습니다. 이미 설치된 Chrome·Edge를 씁니다 (선택 패키지 `puppeteer-core`).
193
- - 매번 **빈 프로필**로 열기 때문에 내 로그인·쿠키는 쓰이지 않습니다.
194
- - 브라우저가 페이지 안에서 보내는 모든 요청에도 내부망 차단 검사를 적용합니다.
195
- - 끄기: 환경 변수 `LINKBRIEF_BROWSER=off`. 다른 브라우저 지정: `LINKBRIEF_BROWSER=<실행 파일 경로>`.
196
- - Cloudflare 같은 **봇 확인 페이지는 우회하지 않고**, 그렇다고 알려 줍니다.
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
- | Claude가 도구를 안 쓰고 "링크를 열 수 없다"고 함 | Claude를 다시 시작했는지, `claude mcp list`에 `✔ Connected`인지 확인. "linkbrief로 읽어 줘"라고 직접 말해도 됩니다 |
203
- | `Page text too short` | 로그인이 필요한 페이지이거나, JavaScript 페이지인데 Chrome·Edge가 없는 경우입니다 |
204
- | `This site shows a bot check` | 사이트가 봇 확인(Cloudflare 등)을 요구합니다. linkbrief는 우회하지 않습니다 (예: Medium, Stack Overflow, npm 웹사이트) |
205
- | `Refusing to fetch a private or local address` | `localhost`·사내망 주소는 보안상 막혀 있습니다 |
206
- | `PDF has no extractable text` | 스캔 이미지로 된 PDF입니다 (글자 인식 OCR은 지원 안 함) |
207
- | `This Naver Cafe post can only be read after logging in` | 카페 회원이나 로그인한 사람만 볼 수 있는 글입니다. 글 내용을 직접 붙여 넣어 주세요 |
208
- | `For Naver Cafe, pass the post's full URL` | 글 화면의 "URL 복사"로 `clubid`·`articleid`(또는 `/cafes/숫자/articles/숫자`)가 든 주소를 주세요 |
209
- | `Could not reach ...` / 시간 초과 | 사이트가 느리거나 막혔습니다. 잠시 후 다시 시도하세요 (자동으로 1회 재시도합니다) |
210
- | `Google search result pages block automated access` | Google 검색 결과 대신 결과 글의 주소를 직접 주세요 |
211
- | 설치 시 `npx` 오류, `EBADENGINE` 경고 | Node.js 22.12 이상인지 확인: `node --version` |
212
-
213
- ## 도구
214
-
215
- ### `fetch_page` — 한 페이지 읽기
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` | (필수) | http/https 주소 (웹 페이지 또는 PDF) |
220
- | `max_length` | 20000 | 한 번에 돌려줄 최대 글자 수 (1,000~100,000) |
221
- | `start_index` | 0 | 긴 글의 다음 부분을 읽을 시작 위치. 잘린 경우 결과 끝에 다음 값이 안내됩니다 |
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
- ### `fetch_pages` — 여러 페이지 한 번에
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` | (필수) | 주소 1~10개 |
230
- | `max_length_per_page` | 8000 | 페이지당 최대 글자 수 (1,000~50,000) |
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: 사이트 | Author: 작성자 | Published: 2026-11-25 | URL: https://...
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
- 본문 (Markdown)
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
- 실제 사이트 점검 결과 (`npm run check:live`, 2026-11-26) — Medium(봇 확인)과 Google 검색은 의도적으로 거절합니다:
318
+ Main content as Markdown
319
+ ```
257
320
 
258
- ![국내외 24개 사이트 점검 결과](docs/images/live.png)
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
+ ![Live check results for 38 sites](docs/images/live.png)
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
- - **내부망 차단:** `localhost`, 사설 IP(10.x, 192.168.x 등), 링크 로컬, 클라우드 메타데이터 주소(169.254.169.254)는 거절합니다. 리다이렉트와 브라우저 안의 요청도 하나하나 다시 검사합니다. 웹페이지 속 악성 지시에 속은 Claude가 내 공유기나 사내망을 읽지 못하게 하기 위해서입니다.
263
- - **크기 제한:** 웹 페이지 5MB, PDF 30MB까지만 읽고, HTML·텍스트·PDF가 아닌 응답은 거절합니다.
264
- - **브라우저 격리:** 헤드리스 브라우저는 매번 빈 프로필로 열고 닫습니다.
265
- - 가져온 본문은 Claude에게 "지시가 아닌 데이터"로 표시해 넘깁니다.
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` | MCP 서버, `fetch_page`·`fetch_pages` 도구 정의 |
281
- | `page.mjs` | 가져오기·보안 검사·인코딩·본문 추출(Readability → Markdown)·PDF·캐시 |
282
- | `browser.mjs` | 설치된 Chrome·Edge로 JavaScript 페이지 읽기 (선택) |
283
- | `sites.mjs` | 사이트별 규칙 (주소 바꾸기, 거절 안내) |
284
- | `fixtures/` | 테스트용 HTML (실제 글이 아닌, 구조만 본뜬 직접 작성한 내용) |
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.mjs`의 `sites` 배열에 규칙을 추가하고 `test.mjs`에 테스트를 넣어 주세요.
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
- // refuse: "이 사이트는 ...라서 가져올 수 없습니다", // 또는 이유를 알리고 거절
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
- 테스트용 HTML이 필요하면 실제 글을 복사하지 말고, 그 사이트의 HTML 구조만 본떠 직접 쓴 내용으로 `fixtures/`에 넣어 주세요.
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
- ## English
406
+ ## License
308
407
 
309
- **linkbrief-mcp** is an MCP server that lets Claude (or Codex, Cursor, any MCP client) read web pages and PDFs **from your own computer**, returning only the main content as Markdown with a title/source/author/date line. It is tuned for Korean sites (Naver Blog's iframe layout, Naver/Daum News, Tistory, Brunch, Velog, Daum Cafe) and legacy charsets (EUC-KR, Shift_JIS, EUC-JP, GBK, Big5, TIS-620, windows-1258), and works for pages in any language.
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