linkbrief-mcp 0.4.0 → 0.4.1

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.
Files changed (3) hide show
  1. package/README.ko.md +111 -302
  2. package/README.md +104 -313
  3. package/package.json +1 -1
package/README.ko.md CHANGED
@@ -2,129 +2,53 @@
2
2
 
3
3
  [English](README.md) | **한국어**
4
4
 
5
- Claude가 **내 PC에서 직접** 웹 페이지, PDF, Office 문서를 읽게 해 주는 MCP 서버입니다. 링크를 주고 "요약해 줘"라고 하면, linkbrief가 본문만 Markdown으로 가져오고 Claude가 정리합니다. Codex, Cursor 등 MCP를 지원하는 다른 도구에서도 똑같이 쓸 수 있습니다.
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
- 위키백과, 나무위키, GitHub, 개발 문서, 세계 각국 뉴스와 블로그, PDF, JavaScript로 그려지는 페이지까지 어떤 언어의 링크든 읽습니다. 다른 도구가 자주 놓치는 사이트도 따로 챙깁니다: 네이버 블로그(iframe 구조), 나무위키, 그리고 EUC-KR·Shift_JIS·GBK 같은 옛 인코딩.
9
+ **AI 에이전트에게 링크만 주세요. 필요한 내용만, 토큰은 약 95% 적게 읽습니다.**
10
+
11
+ linkbrief는 Claude, Codex, Cursor 등 MCP 에이전트용 서버입니다. 웹 페이지, PDF, Office 문서를 **내 PC에서 직접** 가져와 본문만 깔끔한 Markdown으로 넘깁니다. 제목·출처·작성자·작성일도 함께 붙습니다.
8
12
 
9
13
  ![프랑스어 위키백과 글을 linkbrief로 가져와 Claude가 한국어로 요약하는 예시](docs/images/usage.png)
10
14
 
11
- <sub>사용 예시: `fetch_page` 호출과 결과는 실제 linkbrief 출력이고, 요약은 Claude가 그 결과로 작성한 것입니다. (문서: 프랑스어 위키백과 「Kimchi」, CC BY-SA)</sub>
15
+ <sub>`fetch_page` 결과는 실제 linkbrief 출력이고, 요약은 Claude가 작성한 것입니다. (문서: 프랑스어 위키백과 「Kimchi」, CC BY-SA)</sub>
12
16
 
13
- ## 왜 필요한가요?
17
+ ## 왜 linkbrief인가요?
14
18
 
15
- - **토큰을 95% 아낍니다.** 웹 페이지 HTML의 대부분은 메뉴·광고·스크립트·이미지 주소입니다. linkbrief는 본문만 남겨 넘깁니다. ([측정 결과](#토큰-절감-효과))
16
- - **필요한 부분만 읽습니다.** `find`로 질문과 관련된 부분만 찾아 읽거나(전체 대비 76~88% 감소), 목차를 보고 필요한 문단만 골라 읽습니다. 문단마다 인용할 수 있는 바로가기 링크가 붙습니다.
17
- - **개발자용 사이트를 제대로 읽습니다.** GitHub 이슈·PR은 댓글 전체와 변경 파일까지, Stack Overflow는 질문과 추천 답변, Hacker News는 댓글 트리 전체, arXiv 요약 페이지는 논문 본문으로 읽습니다. 문서 사이트는 한 섹션을 통째로 읽어 줍니다 (`fetch_site`).
18
- - **문서 파일도 읽습니다.** PDF는 쪽별로, Word·PowerPoint·Excel·한글(.hwpx) 파일도 링크만 주면 됩니다.
19
- - **막힌 사이트도 읽습니다.** Claude의 기본 웹 가져오기는 일부 사이트(예: `blog.naver.com`)가 막혀 있습니다. linkbrief는 **사용자 PC에서 일반 브라우저처럼** 요청합니다.
20
- - **네이버 블로그가 비어 보이지 않습니다.** 본문이 iframe 안에 있어 그냥 가져오면 비어 있는데, linkbrief는 본문이 들어 있는 모바일 주소로 바꿔 읽습니다.
21
- - **PDF, 여러 링크, JavaScript 페이지까지** 한 도구로 처리합니다.
22
- - **API 키가 필요 없습니다.** 요약은 사용 중인 Claude가 합니다.
19
+ - **토큰 약 95% 절감.** 메뉴·광고·스크립트·이미지 주소를 빼고 본문만 넘깁니다. 하나만 물으면 `find`가 관련 부분만 돌려줍니다.
20
+ - **다른 도구가 놓치는 것도 읽습니다.** JavaScript 페이지, PDF, Word·PowerPoint·Excel·한글(.hwpx), Stack Overflow, GitHub 이슈·PR, 문서 사이트 통째로(`llms.txt` 지원), 네이버 블로그와 EUC-KR·Shift_JIS 같은 옛 인코딩까지.
21
+ - **내 PC에서 실행됩니다.** API 키·계정·비용이 없습니다. 회사 프록시 뒤에서도 동작합니다.
22
+ - **기본이 안전합니다.** 내부망은 막고, 봇 확인은 우회하지 않으며, 그 밖의 곳에는 접속하지 않습니다.
23
23
 
24
- ## 빠른 시작 (Claude Code 기준, 3단계)
24
+ ## 빠른 시작
25
25
 
26
- **1. 설치** — 터미널에서 한 줄. npm에서 자동으로 받아 실행하므로 `npm install`을 따로 할 필요가 없습니다.
26
+ [Node.js](https://nodejs.org) 22.12 이상이 필요합니다. Claude Code에서:
27
27
 
28
28
  ```bash
29
29
  claude mcp add linkbrief -s user -- npx -y linkbrief-mcp
30
30
  ```
31
31
 
32
- Windows(PowerShell·명령 프롬프트)에서는 `npx`를 `cmd /c`로 감싸야 연결이 안정적입니다:
32
+ Windows에서는 `npx` 대신 `cmd /c npx`:
33
33
 
34
34
  ```powershell
35
35
  claude mcp add linkbrief -s user -- cmd /c npx -y linkbrief-mcp
36
36
  ```
37
37
 
38
- **2. 연결 확인** — Claude Code를 다시 열고 대화창에 `/mcp`를 입력하면 연결된 MCP 서버 목록이 나옵니다. `linkbrief`가 연결됨으로 보이고 도구 `fetch_page`, `fetch_pages`가 있으면 준비 끝입니다. (터미널에서는 `claude mcp list`)
39
-
40
- **3. 그냥 부탁하기** — 명령어를 외울 필요가 없습니다. 링크와 함께 평소처럼 말하면 Claude가 알아서 linkbrief를 불러 씁니다.
41
-
42
- > 이 글 3줄로 요약해 줘: https://blog.naver.com/아이디/글번호
43
-
44
- Claude Desktop(클릭 한 번 설치), Codex, Cursor 설정은 아래 [설치](#설치)를 보세요.
45
-
46
- ### 어떻게 동작하나요?
47
-
48
- linkbrief는 **에이전트가 쓰는 도구**입니다. 무엇을 언제 읽을지는 Claude(에이전트)가 대화를 보고 스스로 정합니다.
49
-
50
- ```
51
- 사용자: "이 두 기사 비교해 줘: 링크1 링크2"
52
- │
53
- ▼
54
- Claude(에이전트) ── 링크가 여러 개네 → fetch_pages 호출
55
- │ 글이 길어서 잘렸네 → fetch_page로 이어 읽기
56
- ▼
57
- linkbrief (내 PC에서 실행) ── 페이지·PDF를 받아 본문만 Markdown으로 정리
58
- │
59
- ▼
60
- Claude가 읽고 비교·요약해서 답변
61
- ```
62
-
63
- - 링크가 하나면 `fetch_page`, 여러 개면 `fetch_pages`를 Claude가 골라 씁니다.
64
- - 글이 길면 결과 끝의 안내를 보고 Claude가 **스스로 다음 부분을 이어서** 읽습니다.
65
- - 처음 쓸 때 Claude가 도구 사용 허락을 물으면 허용하세요. 매번 묻지 않게 하려면 허락 창에서 "항상 허용"을 고르면 됩니다.
38
+ Claude Code를 다시 열고 `/mcp`에서 `linkbrief`가 연결됐는지 확인한 뒤, 링크와 함께 부탁하면 끝입니다.
66
39
 
67
- ## 토큰 절감 효과
40
+ <details>
41
+ <summary><b>Claude Desktop, Codex, Cursor, 소스에서 설치</b></summary>
68
42
 
69
- 블로그·뉴스·위키 등 실제 국내외 페이지를 원본 HTML 그대로 넘길 때와 linkbrief 결과를 비교했습니다 (글자 수 기준, 2026-11-26 측정).
43
+ **Claude Desktop (클릭 한 번)** — [최신 릴리스](https://github.com/KDDYYY/linkbrief-mcp/releases/latest)에서 `linkbrief.mcpb`를 내려받아 더블클릭하세요.
70
44
 
71
- | | 원본 HTML | linkbrief 결과 |
72
- |---|---:|---:|
73
- | 분량 | 약 202만 자 | 약 9만 자 |
74
- | **절감** | | **약 95% (페이지별 92~99%)** |
75
-
76
- 토큰 수는 글자 수에 대체로 비례하므로, 같은 내용을 읽는 데 드는 토큰도 이 정도 줄어듭니다. 토큰이 줄면 **사용량 한도가 덜 차고, 응답이 빨라지고, 긴 대화에서도 앞 내용을 덜 잊습니다.**
77
-
78
- 절감이 일어나는 곳:
79
-
80
- | 방법 | 효과 |
81
- |---|---|
82
- | **본문만 추출** (Mozilla Readability) | 메뉴·광고·댓글·푸터·스크립트 제거 — 절감의 대부분 |
83
- | **이미지·아이콘 제거** | 이미지 주소만으로 분량이 2배가 되는 페이지도 있습니다 |
84
- | **링크 주소 제거** (기본값) | 링크 글자만 남김. 링크가 많은 문서에서 49~66% 추가 감소. 필요하면 `include_links`로 유지 |
85
- | **관련 부분만 찾기** | `find`는 검색어가 든 블록과 그 앞뒤만 돌려줍니다. 긴 문서에서 전체 대비 76~88% 감소 |
86
- | **목차 먼저, 한 문단만** | `outline`은 제목과 분량만, `section`은 한 문단만 돌려줍니다. 긴 문서에서 전체 대비 82~91% 감소 (아래 표) |
87
- | **나눠 읽기** | 한 번에 2만 자까지만 넘기고, 더 필요할 때만 `start_index`로 이어 읽음 |
88
- | **여러 링크는 페이지당 상한** | `fetch_pages`는 기본 페이지당 8천 자 |
89
- | **10분 캐시** | 같은 페이지를 이어 읽을 때 다시 내려받지 않음 (두 번째 요청이 1천 분의 몇 초 만에 끝남) |
90
-
91
- 목차를 먼저 보고 한 문단만 읽을 때와 전체를 읽을 때 비교 (글자 수, 2026-11-27 측정):
92
-
93
- | 페이지 | 전체 | 목차 + 한 문단 | 절감 |
94
- |---|---:|---:|---:|
95
- | 영어 위키백과 「Large language model」 | 101,576 | 8,172 + 5,021 | 87% |
96
- | 나무위키 「김치」 | 46,131 | 2,733 + 5,355 | 82% |
97
- | arXiv 논문 PDF (15쪽) | 39,790 | 1,638 + 1,916 | 91% |
98
-
99
- ## 설치
100
-
101
- Node.js 22.12 이상이 필요합니다 (Node 20은 2026년 4월 지원 종료).
102
-
103
- **Claude Code**
104
-
105
- ```bash
106
- claude mcp add linkbrief -s user -- npx -y linkbrief-mcp
107
- ```
108
-
109
- Windows(PowerShell·명령 프롬프트)에서는 `npx`를 `cmd /c`로 감싸야 연결이 안정적입니다:
110
-
111
- ```powershell
112
- claude mcp add linkbrief -s user -- cmd /c npx -y linkbrief-mcp
113
- ```
114
-
115
- **Claude Desktop, 클릭 한 번으로** — [최신 릴리스](https://github.com/KDDYYY/linkbrief-mcp/releases/latest)에서 `linkbrief.mcpb`를 내려받아 더블클릭하거나, 설정 → 확장 프로그램에 끌어다 놓으세요. GitHub 토큰(선택)도 거기서 넣을 수 있습니다.
116
-
117
- **Claude Desktop, 설정 파일로** — `claude_desktop_config.json`에 추가 (설정 → 개발자 → 설정 편집):
45
+ **Claude Desktop (설정 파일)** — 설정 → 개발자 → 설정 편집:
118
46
 
119
47
  ```json
120
- {
121
- "mcpServers": {
122
- "linkbrief": { "command": "npx", "args": ["-y", "linkbrief-mcp"] }
123
- }
124
- }
48
+ { "mcpServers": { "linkbrief": { "command": "npx", "args": ["-y", "linkbrief-mcp"] } } }
125
49
  ```
126
50
 
127
- **Codex (OpenAI)** — `~/.codex/config.toml`에 추가 (Codex CLI·IDE 확장·앱 공통):
51
+ **Codex** — `~/.codex/config.toml` (Windows는 `command = "cmd"`, `args = ["/c", "npx", "-y", "linkbrief-mcp"]`):
128
52
 
129
53
  ```toml
130
54
  [mcp_servers.linkbrief]
@@ -132,259 +56,144 @@ command = "npx"
132
56
  args = ["-y", "linkbrief-mcp"]
133
57
  ```
134
58
 
135
- Windows에서 `npx`를 찾지 못하면 `command = "cmd"`, `args = ["/c", "npx", "-y", "linkbrief-mcp"]`로 바꾸세요. Codex CLI가 있다면 `codex mcp add linkbrief -- npx -y linkbrief-mcp`로도 등록할 수 있습니다.
59
+ **Cursor 등 다른 MCP 클라이언트** — `npx -y linkbrief-mcp`를 stdio 서버로 등록하세요.
136
60
 
137
- **Cursor 등 다른 MCP 클라이언트** — 명령 `npx -y linkbrief-mcp`를 stdio 서버로 등록하면 됩니다.
138
-
139
- **소스에서 직접 설치** — npm을 거치지 않고 GitHub 코드를 그대로 쓰려면:
61
+ **소스에서 설치**
140
62
 
141
63
  ```bash
142
- git clone https://github.com/KDDYYY/linkbrief-mcp.git
143
- cd linkbrief-mcp
144
- npm install
64
+ git clone https://github.com/KDDYYY/linkbrief-mcp.git && cd linkbrief-mcp && npm install
145
65
  claude mcp add linkbrief -s user -- node "$(pwd)/server.mjs"
146
66
  ```
147
67
 
148
- Windows PowerShell에서는 마지막 줄을 `claude mcp add linkbrief -s user -- node "$PWD\server.mjs"` 로 바꾸세요.
149
-
150
- **설치 확인** — Claude Code 대화창의 `/mcp` 또는 터미널의 `claude mcp list`에서 `linkbrief`가 연결됨(`✔ Connected`)으로 보이면 준비된 것입니다. 설치·설정을 바꾼 뒤에는 Claude를 **다시 시작**해야 적용됩니다.
151
-
152
- ## 사용 방법
153
-
154
- Claude에게 링크와 함께 평소 말투로 부탁하면 됩니다. Claude가 알아서 linkbrief 도구를 불러 본문을 읽습니다. 처음 쓸 때 도구 사용 허락을 묻는 창이 뜨면 허용해 주세요.
155
-
156
- **기본 요약**
157
-
158
- > 이 글 한국어로 요약해 줘: https://blog.naver.com/아이디/글번호
159
-
160
- **외국어 글을 한국어로** — 영어·불어·중국어·일본어·태국어·베트남어 등 어떤 언어든 됩니다.
161
-
162
- > https://fr.wikipedia.org/wiki/Kimchi 핵심만 5줄로 한국어 정리해 줘
68
+ </details>
163
69
 
164
- **PDF** — 논문, 보도자료, 보고서 링크도 그대로 주면 됩니다. 자세한 방법은 아래 [PDF 읽기](#pdf-읽기)를 보세요.
70
+ ## 이렇게 부탁하세요
165
71
 
166
- > 이 논문 핵심 기여 3가지와 실험 결과만 정리해 줘: https://arxiv.org/pdf/1706.03762
72
+ 명령어를 외울 필요 없이, 평소처럼 말하고 링크만 붙이면 됩니다.
167
73
 
168
- **코드 리뷰·디버깅**
169
-
170
- > 이 PR 논의 내용 요약하고 바뀐 파일 목록 보여 줘: https://github.com/owner/repo/pull/123
171
-
172
- > 여기서 채택된 해결책이 뭐고 왜 되는지 설명해 줘: https://stackoverflow.com/questions/11227809
173
-
174
- **문서 사이트 한 섹션 통째로** — `fetch_site`가 시작 페이지와 같은 폴더 아래 링크를 따라 읽습니다 (최대 30쪽, robots.txt 준수). 사이트가 AI용 목차 `llms.txt`를 제공하면(Stripe, Vercel, Anthropic 등 많은 문서 사이트) 그것부터 씁니다.
175
-
176
- > 파이썬 튜토리얼 읽고 한 장짜리 요약표 만들어 줘: https://docs.python.org/3/tutorial/index.html
177
-
178
- **Office 문서** — Word·PowerPoint·Excel·한글(.hwpx) 링크도 PDF처럼 읽습니다.
179
-
180
- > 이 발표 자료 슬라이드별로 요약해 줘: https://example.org/files/q3-review.pptx
181
-
182
- **원하는 형식으로**
183
-
184
- > 이 기사 3줄 요약하고, 등장하는 숫자·날짜만 표로 뽑아 줘: https://n.news.naver.com/article/...
185
-
186
- > 이 블로그 글에서 사용한 도구와 단계별 방법만 정리해 줘: https://blog.naver.com/...
187
-
188
- **여러 링크 한 번에** — 최대 10개까지 한 번에 읽어 비교합니다 (`fetch_pages`). 일부가 실패해도 나머지는 읽습니다.
189
-
190
- > 이 세 기사의 논조를 비교해서 공통점과 차이점을 표로 정리해 줘: https://... https://... https://...
191
-
192
- **출처 확인** — 결과 맨 위에 사이트·작성자·작성일·주소가 붙어 있어, 요약에 출처를 함께 달라고 할 수 있습니다.
193
-
194
- > 요약 끝에 출처(사이트, 작성자, 날짜)도 적어 줘: https://...
195
-
196
- **질문에 필요한 부분만** — 긴 문서에 대한 질문이면 에이전트가 `find`로 관련 부분만 찾아 읽습니다:
197
-
198
- > 이 문서에서 유산균 얘기만 정리해 줘: https://namu.wiki/w/김치
199
-
200
- **필요한 부분만** — 에이전트가 목차를 보고 필요한 문단만 골라 읽습니다. 문단마다 인용용 링크(`…#s-2`)가 붙습니다. 직접 부탁해도 됩니다:
201
-
202
- > 이 문서 목차부터 보여 주고, 역사 부분만 읽어서 정리해 줘: https://namu.wiki/w/김치
203
-
204
- **긴 문서** — 한 번에 2만 자까지 읽고, 더 길면 Claude가 `start_index`로 이어서 읽습니다. 처음부터 끝까지 읽게 하려면:
74
+ | 부탁 | linkbrief가 하는 일 |
75
+ |---|---|
76
+ | *3줄로 요약해 줘:* `https://blog.naver.com/…` | 본문만 가져옵니다 (어떤 언어든) |
77
+ | *이 문서에서 유산균 얘기만 정리해 줘:* `https://namu.wiki/w/김치` | `find`로 관련 부분만 돌려줍니다 |
78
+ | *핵심 기여 3가지만:* `https://arxiv.org/pdf/…` | PDF를 쪽별로 읽습니다 |
79
+ | *이 PR 요약하고 바뀐 파일 보여 줘:* `https://github.com/…/pull/123` | 본문, 댓글 전체, 변경 파일 |
80
+ | *채택된 답이 왜 되는지 설명해 줘:* `https://stackoverflow.com/questions/…` | 질문과 추천 답변 (공식 API) |
81
+ | *이 튜토리얼로 요약표 만들어 줘:* `https://docs.python.org/3/tutorial/` | 섹션 전체를 읽습니다 (`llms.txt`가 있으면 먼저) |
82
+ | *세 기사 논조 비교해 줘:* `<링크> <링크> <링크>` | 최대 10개를 한 번에 읽습니다 |
205
83
 
206
- > 이 문서 끝까지 다 읽고 장별로 요약해 줘: https://...
84
+ 결과 맨 위에 사이트·작성자·작성일·주소가 붙어, 문단 단위(`…#s-2`)까지 출처를 달 수 있습니다.
207
85
 
208
- **링크 주소가 필요할 때** — 기본값은 링크 글자만 남겨 분량을 줄입니다. 출처 주소까지 필요하면:
86
+ ## 측정된 절감 효과
209
87
 
210
- > 이 페이지의 참고 링크 주소까지 포함해서 정리해 줘 (include_links 켜고): https://...
88
+ 실제 블로그·뉴스·위키 페이지에서 에이전트에게 넘어간 글자 수 기준 (2026년 11월):
211
89
 
212
- ### PDF 읽기
90
+ | 방법 | 절감 |
91
+ |---|---:|
92
+ | 원본 HTML 대신 linkbrief로 페이지 전체 | **약 95%** (페이지별 92~99%) |
93
+ | `find` — 물어본 부분만 | 긴 문서에서 추가로 **76~88%** |
94
+ | `outline` 후 한 `section`만 | 긴 문서에서 추가로 **82~91%** |
213
95
 
214
- **1. PDF 주소를 구합니다.** 웹페이지의 PDF 링크·다운로드 버튼에서 오른쪽 클릭 → **링크 주소 복사**, 또는 브라우저에 PDF가 열려 있으면 **주소창**을 복사합니다.
96
+ 토큰이 줄면 사용량 한도가 덜 차고, 답이 빨라지고, 긴 대화에서도 앞 내용을 덜 잊습니다.
215
97
 
216
- ![PDF 링크를 복사해 Claude에 붙여 넣는 3단계](docs/images/pdf-link.png)
98
+ ## PDF와 문서 파일
217
99
 
218
- **2. Claude에 주소와 함께 부탁합니다.** linkbrief가 PDF를 받아 페이지별로 글자를 뽑고, Claude가 정리합니다.
100
+ PDF, `.docx`, `.pptx`, `.xlsx`, `.hwpx` 링크를 붙여 넣으세요. 다운로드 링크에서 오른쪽 클릭 → *링크 주소 복사*. 내 PC에 있는 파일은 에이전트에 직접 첨부하면 됩니다.
219
101
 
220
102
  ![arXiv 논문 PDF를 linkbrief로 읽어 한국어 4줄로 요약하는 과정](docs/images/pdf-demo.gif)
221
103
 
222
- <sub>예시: `fetch_page` 결과는 실제 linkbrief 출력(저자 이메일이 나오는 줄 앞에서 생략)이고, 요약은 Claude가 그 결과로 작성한 것입니다.</sub>
223
-
224
- 알아 두면 좋은 점:
104
+ ## 지원 현황
225
105
 
226
- | 상황 | 동작 |
106
+ | | |
227
107
  |---|---|
228
- | 주소가 `.pdf`로 끝나지 않음 (`download.do?id=…` 등) | 서버가 PDF를 보내 주면 자동으로 PDF로 읽습니다 |
229
- | 결과에 `## Page 3` 같은 쪽 표시 | "몇 쪽에 나오는지", "3쪽만 요약해 줘"처럼 물어볼 수 있습니다 |
230
- | 긴 PDF | 2만 자씩 나눠 읽습니다. "끝까지 읽고 요약해 줘"라고 하면 Claude가 이어서 읽습니다 |
231
- | 결과 맨 위 `PDF, 15 pages` 줄 | 쪽수와 PDF에 적힌 제목·작성자·작성일이 함께 붙습니다 |
232
- | **내 컴퓨터에 있는 PDF 파일** | linkbrief는 인터넷 주소만 읽습니다. Claude 대화창에 **파일을 직접 첨부**하세요 |
233
- | 로그인해야 받을 수 있는 PDF, 버튼을 눌러야 받아지는 PDF | 주소만으로 받을 수 없어 읽지 못합니다. 내려받아 직접 첨부하세요 |
234
- | 스캔한 이미지 PDF | 글자가 없어 읽지 못합니다 (`PDF has no extractable text`) |
235
- | 30MB가 넘는 PDF | 읽지 않습니다 |
108
+ | ✅ 웹 페이지 | 모든 언어. JavaScript 페이지는 설치된 Chrome·Edge로. Shift_JIS, GBK, Big5, EUC-KR 등 |
109
+ | ✅ 개발자 사이트 | GitHub 이슈·PR·코드 파일 · Stack Overflow·Stack Exchange · Hacker News · arXiv · `llms.txt` 문서 사이트 |
110
+ | ✅ 문서 | PDF, Word, PowerPoint, Excel, 한글(.hwpx) |
111
+ | ✅ 국내 사이트 | 네이버 블로그, 네이버·다음 뉴스, 나무위키, 티스토리, 브런치, 벨로그 |
112
+ | ❌ 미지원 | 로그인·봇 확인이 필요한 페이지(Medium, Reddit), Google 검색 결과, YouTube 자막, 스캔 PDF |
236
113
 
237
- ### JavaScript로 그려지는 페이지
114
+ ## 기본이 안전합니다
238
115
 
239
- 일반 요청으로 본문이 비어 오거나 차단(403·429·503)되면, linkbrief가 **PC에 설치된 Chrome 또는 Edge를 화면 없이 띄워** 다시 읽습니다. 별도 설정은 필요 없습니다.
116
+ - **내부망은 그대로 비공개.** `localhost`, 가정·사내망, 클라우드 메타데이터 주소는 거절하고 리다이렉트마다 다시 검사합니다. 악성 페이지가 에이전트를 속여 공유기나 사내망을 읽게 할 수 없습니다.
117
+ - **우회하지 않습니다.** 봇 확인은 알려 줄 뿐 풀지 않습니다. `fetch_site`는 robots.txt를 지키고 요청 사이에 쉽니다.
118
+ - **딴 곳에 접속하지 않습니다.** 사용자가 준 링크(와 GitHub·Stack Exchange 공개 API)에만 접속합니다. 원격 수집·키·계정이 없습니다.
119
+ - **격리된 브라우저.** JavaScript 재시도는 매번 빈 프로필로 열어 내 로그인·쿠키를 건드리지 않습니다.
240
120
 
241
- - 브라우저를 새로 내려받지 않습니다. 이미 설치된 Chrome·Edge를 씁니다 (선택 패키지 `puppeteer-core`).
242
- - 매번 **빈 프로필**로 열기 때문에 내 로그인·쿠키는 쓰이지 않습니다.
243
- - 브라우저가 페이지 안에서 보내는 모든 요청에도 내부망 차단 검사를 적용합니다.
244
- - 끄기: 환경 변수 `LINKBRIEF_BROWSER=off`. 다른 브라우저 지정: `LINKBRIEF_BROWSER=<실행 파일 경로>`.
245
- - Cloudflare 같은 **봇 확인 페이지는 우회하지 않고**, 그렇다고 알려 줍니다.
121
+ <details>
122
+ <summary><b>도구 설명</b></summary>
246
123
 
247
- ### 잘 안 될 때
124
+ **`fetch_page`** — 한 페이지·문서
248
125
 
249
- | 증상 | 해결 |
250
- |---|---|
251
- | Claude가 도구를 안 쓰고 "링크를 열 수 없다"고 함 | Claude를 다시 시작했는지, `claude mcp list`에 `✔ Connected`인지 확인. "linkbrief로 읽어 줘"라고 직접 말해도 됩니다 |
252
- | `Page text too short` | 로그인이 필요한 페이지이거나, JavaScript 페이지인데 Chrome·Edge가 없는 경우입니다 |
253
- | `This site shows a bot check` | 사이트가 봇 확인(Cloudflare 등)을 요구합니다. linkbrief는 우회하지 않습니다 (예: Medium, Reddit, npm 웹사이트) |
254
- | `GitHub API: API rate limit exceeded` | 환경 변수 `GITHUB_TOKEN`을 넣으세요 (Claude Desktop 확장은 설정 칸에 입력) |
255
- | `robots.txt on … asks automated tools not to read …` | 사이트가 자동 읽기를 거부했습니다 (`fetch_site`, 또는 `LINKBRIEF_ROBOTS=always`일 때) |
256
- | `Old binary .hwp files are not supported` | .hwpx나 PDF로 저장하거나, 파일을 직접 첨부하세요 |
257
- | `Refusing to fetch a private or local address` | `localhost`·사내망 주소는 보안상 막혀 있습니다 |
258
- | `PDF has no extractable text` | 스캔 이미지로 된 PDF입니다 (글자 인식 OCR은 지원 안 함) |
259
- | `Could not reach ...` / 시간 초과 | 사이트가 느리거나 막혔습니다. 잠시 후 다시 시도하세요 (자동으로 1회 재시도합니다) |
260
- | `Google search result pages block automated access` | Google 검색 결과 대신 결과 글의 주소를 직접 주세요 |
261
- | 설치 시 `npx` 오류, `EBADENGINE` 경고 | Node.js 22.12 이상인지 확인: `node --version` |
262
-
263
- ## 도구
264
-
265
- ### `fetch_page` — 한 페이지 읽기
266
-
267
- | 인자 | 기본값 | 설명 |
268
- |---|---|---|
269
- | `url` | (필수) | http/https 주소 (웹 페이지 또는 PDF) |
270
- | `max_length` | 20000 | 한 번에 돌려줄 최대 글자 수 (1,000~100,000) |
271
- | `start_index` | 0 | 긴 글의 다음 부분을 읽을 시작 위치. 잘린 경우 결과 끝에 다음 값이 안내됩니다 |
272
- | `include_links` | false | 링크 주소까지 유지할지. 기본은 링크 글자만 남깁니다 |
273
- | `render` | false | 처음부터 브라우저로 읽기. 보통은 필요 없습니다 (자동 대체됨) |
274
- | `outline` | false | 제목 목차만 돌려주기 (각 문단의 분량과 첫 문장 포함) |
275
- | `section` | — | 한 문단(하위 문단 포함)만 돌려주기: 목차 번호(`"#3"`)나 제목(`"역사"`, `"Page 4"`) |
276
- | `find` | — | 이 단어나 `"따옴표 구절"`이 나오는 부분만 앞뒤 문맥과 함께 돌려주기. `section`과 같이 쓰면 그 문단 안에서만 찾음 |
277
-
278
- ### `fetch_site` — 문서 사이트·섹션 읽기
279
-
280
- | 인자 | 기본값 | 설명 |
126
+ | 인자 | 기본값 | |
281
127
  |---|---|---|
282
- | `url` | (필수) | 시작 페이지. 이 페이지와 같은 폴더 아래 링크만 따라갑니다 |
283
- | `max_pages` | 10 | 최대 쪽수 (1~30) |
284
- | `max_length_per_page` | 4000 | 쪽당 최대 글자 수 (500~20,000) |
285
- | `include_links` | false | 링크 주소까지 유지할지 |
128
+ | `url` | 필수 | 웹 페이지, PDF, Office 파일 |
129
+ | `find` | — | 이 단어나 `"따옴표 구절"`이 나오는 부분만 |
130
+ | `outline` | false | 제목 목차만 (문단 분량, 바로가기 포함) |
131
+ | `section` | — | 한 문단만: `"#3"` 또는 제목(`"역사"`, `"Page 4"`) |
132
+ | `max_length` / `start_index` | 20000 / 0 | 긴 글 나눠 읽기. 이어 읽는 방법은 결과에 안내됩니다 |
133
+ | `include_links` | false | 링크 주소 유지 (끄면 토큰 절약) |
134
+ | `render` | false | 처음부터 브라우저로 읽기 (보통 자동) |
286
135
 
287
- 가까운 링크부터 차례로 읽고, 요청 사이에 쉬며, robots.txt는 항상 지킵니다. 사이트에 `/llms.txt`가 있으면 그것을 먼저 읽고, 거기 나열된 문서를 다음 순서로 읽습니다.
136
+ **`fetch_pages`** — `urls` 최대 10개, `max_length_per_page`(8000), `include_links`.
288
137
 
289
- ### `fetch_pages` — 여러 페이지 한 번에
138
+ **`fetch_site`** — `url`(시작 페이지, 같은 폴더 아래 링크만 따라감), `max_pages`(10, 최대 30), `max_length_per_page`(4000), `include_links`. 사이트에 `/llms.txt`가 있으면 먼저 읽고, robots.txt를 지키며, 45초가 지나면 읽은 만큼 돌려줍니다.
290
139
 
291
- | 인자 | 기본값 | 설명 |
292
- |---|---|---|
293
- | `urls` | (필수) | 주소 1~10개 |
294
- | `max_length_per_page` | 8000 | 페이지당 최대 글자 수 (1,000~50,000) |
295
- | `include_links` | false | 링크 주소까지 유지할지 |
140
+ </details>
296
141
 
297
- 결과는 항상 이런 모양입니다:
142
+ <details>
143
+ <summary><b>설정</b> (선택, 환경 변수)</summary>
298
144
 
299
- ```
300
- # 제목
301
- Source: 사이트 | Author: 작성자 | Published: 2026-11-25 | URL: https://...
145
+ | 변수 | 효과 |
146
+ |---|---|
147
+ | `HTTPS_PROXY`, `HTTP_PROXY`, `NO_PROXY` | 회사 프록시 (브라우저 재시도 포함) |
148
+ | `GITHUB_TOKEN` | GitHub API 한도 시간당 60회 → 5,000회 |
149
+ | `LINKBRIEF_ROBOTS=always` | 링크 하나를 읽을 때도 robots.txt 지키기 |
150
+ | `LINKBRIEF_BROWSER=off` / `=<경로>` | 브라우저 재시도 끄기, 또는 브라우저 지정 |
302
151
 
303
- 본문 (Markdown)
304
- ```
152
+ </details>
305
153
 
306
- ## 지원 현황
154
+ <details>
155
+ <summary><b>잘 안 될 때</b></summary>
307
156
 
308
- | 대상 | 상태 |
157
+ | 메시지 | 해결 |
309
158
  |---|---|
310
- | 네이버 블로그, 네이버 뉴스, 다음 뉴스, 티스토리, 브런치, 벨로그 | ✅ |
311
- | 위키백과(모든 언어), 나무위키, MDN·Python 문서, Google 블로그, GitHub 저장소 | ✅ |
312
- | GitHub 이슈·PR(댓글 전체, 변경 파일), GitHub 코드 파일(원본) | ✅ GitHub API 사용 (시간당 60회, `GITHUB_TOKEN`이 있으면 더 많이) |
313
- | Stack Overflow, Super User, Server Fault, Ask Ubuntu, *.stackexchange.com 질문 | ✅ Stack Exchange API 사용 (질문 + 추천순 답변 10개) |
314
- | Hacker News 글·댓글, arXiv (요약 페이지 → 논문 본문) | ✅ |
315
- | BBC, 르몽드, 슈피겔, NHK, 인민망, 타이랏, VnExpress 등 해외 뉴스 | ✅ |
316
- | PDF (영어·한국어 확인, 페이지별 구분) | ✅ |
317
- | Word(.docx), PowerPoint(.pptx), Excel(.xlsx, 시트당 처음 200행), 한글(.hwpx) | ✅ |
318
- | 예전 한글 형식(.hwp) | ❌ .hwpx나 PDF로 저장해서 쓰세요 |
319
- | JavaScript로 그려지는 페이지 | ✅ Chrome·Edge가 있으면 자동 |
320
- | EUC-KR, Shift_JIS, EUC-JP, GBK/GB2312, Big5, TIS-620, windows-1258 | ✅ |
321
- | Medium, Reddit 등 봇 확인을 거는 사이트 (Stack Overflow는 질문 페이지 외) | ❌ 우회하지 않습니다 |
322
- | Google 검색 결과 페이지 | ❌ Google이 자동 접근을 막습니다. Claude의 웹 검색을 쓰세요 |
323
- | YouTube 자막, 로그인이 필요한 글, 스캔 PDF, 이미지·동영상 | ❌ |
324
-
325
- 실제 사이트 점검 결과 (`npm run check:live`, 2026-11-27) — Medium·Reddit(봇 확인)과 Google 검색은 의도적으로 거절합니다:
159
+ | 에이전트가 "링크를 열 수 없다"고 함 | 에이전트를 다시 시작하고 `/mcp`에서 `linkbrief` 연결 확인. "linkbrief로 읽어 줘"라고 말해도 됩니다 |
160
+ | `Page text too short` | 로그인이 필요하거나, JavaScript 페이지인데 Chrome·Edge가 없음 |
161
+ | `This site shows a bot check` | 사이트가 자동 읽기를 막습니다. 우회하지 않습니다 |
162
+ | `GitHub API: API rate limit exceeded` | `GITHUB_TOKEN`을 넣으세요 |
163
+ | `Refusing to fetch a private or local address` | 보안상 `localhost`·사내망은 막혀 있습니다 |
164
+ | `PDF has no extractable text` | 스캔 PDF입니다 (OCR 미지원) |
165
+ | `Old binary .hwp files are not supported` | .hwpx나 PDF로 저장하세요 |
166
+ | `npx` 오류 / `EBADENGINE` | `node --version`이 22.12 이상인지 확인 |
326
167
 
327
- ![국내외 38개 사이트 점검 결과](docs/images/live.png)
168
+ </details>
328
169
 
329
- ## 설정
170
+ <details>
171
+ <summary><b>실제 사이트 38곳 점검 결과</b></summary>
330
172
 
331
- 모두 선택 사항이며 환경 변수로 넣습니다 (Claude Desktop·Codex 설정의 `env`):
173
+ `npm run check:live` (2026-11-27). Medium·Reddit·Google 검색은 의도적으로 거절합니다.
332
174
 
333
- | 변수 | 효과 |
334
- |---|---|
335
- | `HTTPS_PROXY` / `HTTP_PROXY`, `NO_PROXY` | 회사 프록시: 요청과 브라우저 재시도가 프록시를 거침. `NO_PROXY`의 주소는 직접 연결 |
336
- | `GITHUB_TOKEN` | GitHub 이슈·PR을 읽는 API 한도를 시간당 60회 → 5,000회로 |
337
- | `LINKBRIEF_ROBOTS=always` | 링크 하나를 읽을 때도 robots.txt 지키기 (`fetch_site`는 항상 지킴) |
338
- | `LINKBRIEF_BROWSER=off` / `=<경로>` | 브라우저 재시도 끄기, 또는 특정 Chrome·Edge 지정 |
339
-
340
- ## 보안
175
+ ![국내외 38개 사이트 점검 결과](docs/images/live.png)
341
176
 
342
- - **내부망 차단:** `localhost`, 사설 IP(10.x, 192.168.x 등), 링크 로컬, 클라우드 메타데이터 주소(169.254.169.254)는 거절합니다. 리다이렉트와 브라우저 안의 요청도 하나하나 다시 검사합니다. 웹페이지 속 악성 지시에 속은 Claude가 내 공유기나 사내망을 읽지 못하게 하기 위해서입니다.
343
- - **크기 제한:** 웹 페이지 5MB, PDF·Office 문서 30MB(압축 해제 후 60MB)까지만 읽고, 그 밖의 파일 형식은 거절합니다.
344
- - **예의 바른 크롤링:** `fetch_site`는 한 사이트의 한 폴더 안에서만 움직이고, robots.txt를 지키며, 요청 사이에 쉽니다. 사용자가 준 링크 하나는 브라우저로 여는 것처럼 읽습니다.
345
- - **브라우저 격리:** 헤드리스 브라우저는 매번 빈 프로필로 열고 닫습니다.
346
- - 가져온 본문은 Claude에게 "지시가 아닌 데이터"로 표시해 넘깁니다.
177
+ </details>
347
178
 
348
- ## 개발
179
+ <details>
180
+ <summary><b>개발·기여</b></summary>
349
181
 
350
182
  ```bash
351
183
  npm install
352
- npm test # 단위 테스트, 로컬 서버 종단 테스트, 무작위 입력 테스트 (네트워크 불필요)
353
- npm run check:live # 실제 사이트 점검 (인터넷 필요)
354
- npm run check:live -- <URL> # 특정 주소만 점검
355
- node page.mjs <URL> # 한 페이지의 추출 결과 보기
356
- node page.mjs <URL> --render # 브라우저로 읽은 결과 보기
184
+ npm test # 단위·로컬 서버·프록시·무작위 입력 테스트 (오프라인)
185
+ npm run check:live # 실제 사이트
186
+ node page.mjs <URL> # 한 페이지의 추출 결과 보기
357
187
  ```
358
188
 
359
- | 파일 | 역할 |
360
- |---|---|
361
- | `server.mjs` | stdio 실행 진입점 |
362
- | `tools.mjs` | MCP 도구: `fetch_page`·`fetch_pages`·`fetch_site` |
363
- | `page.mjs` | 가져오기·보안 검사·인코딩·본문 추출(Readability → Markdown)·PDF·캐시 |
364
- | `browser.mjs` | 설치된 Chrome·Edge로 JavaScript 페이지 읽기 (선택) |
365
- | `office.mjs` | Word·PowerPoint·Excel·한글(.hwpx) 문서 |
366
- | `robots.mjs` | robots.txt 해석 |
367
- | `manifest.json`, `server.json` | Claude Desktop 확장과 MCP Registry 정보 (`npm run build:mcpb`로 `dist/linkbrief.mcpb` 생성) |
368
- | `sites.mjs` | 사이트별 규칙 (주소 바꾸기, 거절 안내) |
369
- | `test.mjs`, `test-http.mjs`, `test-proxy.mjs`, `test-fuzz.mjs` | 단위 테스트, 로컬 서버로 실제 요청 흐름과 MCP 도구 전체 검사, 로컬 프록시로 프록시 지원 검사, 고정 시드 무작위 입력 검사 |
370
- | `fixtures/` | 테스트용 HTML (실제 글이 아닌, 구조만 본뜬 직접 작성한 내용) |
371
-
372
- ### 사이트 추가하기
373
-
374
- `sites.mjs`의 `sites` 배열에 규칙을 추가하고 `test.mjs`에 테스트를 넣어 주세요.
375
-
376
- ```js
377
- {
378
- name: "example",
379
- match: (u) => u.hostname === "example.com",
380
- rewrite: (u) => u.href.replace("/view/", "/print/"), // 본문을 담은 주소로 바꾸기
381
- // refuse: "이 사이트는 ...라서 가져올 수 없습니다", // 또는 이유를 알리고 거절
382
- }
383
- ```
189
+ 코드: `tools.mjs`(MCP 도구), `page.mjs`(가져오기·보안·추출·PDF), `sites.mjs`(사이트별 규칙), `office.mjs`, `browser.mjs`, `robots.mjs`.
190
+
191
+ 새 사이트는 `sites.mjs`에 규칙(`rewrite`, `pick`, `load`, `refuse`)을 추가하고 `test.mjs`에 테스트를 넣어 주세요. `fixtures/`의 테스트 HTML은 실제 글을 복사하지 말고 직접 작성해 주세요.
384
192
 
385
- 테스트용 HTML이 필요하면 실제 글을 복사하지 말고, 그 사이트의 HTML 구조만 본떠 직접 쓴 내용으로 `fixtures/`에 넣어 주세요.
193
+ "이 사이트가 안 돼요" 이슈를 주소와 함께 올려 주시면 특히 반갑습니다.
194
+
195
+ </details>
386
196
 
387
197
  ## 라이선스
388
198
 
389
199
  MIT
390
-
package/README.md CHANGED
@@ -6,129 +6,49 @@
6
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
7
  [![license](https://img.shields.io/npm/l/linkbrief-mcp)](LICENSE)
8
8
 
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.
9
+ **Give your AI agent any link. It reads only what matters — with ~95% fewer tokens.**
10
10
 
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.
11
+ linkbrief is an MCP server for Claude, Codex, Cursor and other agents. It fetches web pages, PDFs and Office files from your own computer and hands the agent clean Markdown: just the article, with title, source, author and date.
12
12
 
13
13
  ![Claude summarizing a French Wikipedia article in English with linkbrief](docs/images/usage-en.png)
14
14
 
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>
15
+ <sub>Real linkbrief output; the summary is Claude's. Source: French Wikipedia, "Kimchi" (CC BY-SA).</sub>
16
16
 
17
17
  ## Why linkbrief
18
18
 
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.
19
+ - **~95% fewer tokens.** Menus, ads, scripts and image URLs are dropped. Ask about one thing and `find` returns only the passages that mention it.
20
+ - **Reads what others miss.** JavaScript pages, PDFs, Word/PowerPoint/Excel, Stack Overflow, GitHub issues and PRs, whole docs sites (it follows `llms.txt`), and Asian sites in legacy encodings.
21
+ - **Runs on your machine.** No API key, no account, no cost. Works behind corporate proxies.
22
+ - **Safe by default.** Private networks are blocked, bot checks are never bypassed, and nothing else is ever contacted.
27
23
 
28
- ## Quick start (Claude Code)
24
+ ## Quick start
29
25
 
30
- **1. Install** — one line. `npx` fetches the package from npm, so there is nothing else to install.
26
+ Needs [Node.js](https://nodejs.org) 22.12+. For Claude Code:
31
27
 
32
28
  ```bash
33
29
  claude mcp add linkbrief -s user -- npx -y linkbrief-mcp
34
30
  ```
35
31
 
36
- On Windows (PowerShell or Command Prompt), wrap `npx` in `cmd /c` for a reliable connection:
32
+ On Windows, use `cmd /c npx` instead of `npx`:
37
33
 
38
34
  ```powershell
39
35
  claude mcp add linkbrief -s user -- cmd /c npx -y linkbrief-mcp
40
36
  ```
41
37
 
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`.)
38
+ Reopen Claude Code, type `/mcp` to see `linkbrief` connected, then paste a link and ask. That's it.
43
39
 
44
- **3. Just ask** — no commands to learn. Paste a link and say what you want:
40
+ <details>
41
+ <summary><b>Claude Desktop, Codex, Cursor, from source</b></summary>
45
42
 
46
- > Summarize this in 5 bullet points: https://en.wikipedia.org/wiki/Large_language_model
43
+ **Claude Desktop (one click)** — download `linkbrief.mcpb` from the [latest release](https://github.com/KDDYYY/linkbrief-mcp/releases/latest) and double-click it.
47
44
 
48
- Setup for Claude Desktop (one-click), Codex and Cursor is under [Install](#install).
49
-
50
- ### How it works
51
-
52
- linkbrief is a **tool your agent uses**. The agent decides what to read and when.
53
-
54
- ```
55
- You: "Compare these two articles: <link 1> <link 2>"
56
- │
57
- ▼
58
- Agent (Claude, Codex, …) ── two links → calls fetch_pages
59
- │ page was cut off → calls fetch_page to read the rest
60
- ▼
61
- linkbrief (runs on your machine) ── fetches pages/PDFs, keeps only the main content as Markdown
62
- │
63
- ▼
64
- Agent reads it and answers
65
- ```
66
-
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.
70
-
71
- ## Token savings
72
-
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).
74
-
75
- | | Raw HTML | linkbrief |
76
- |---|---:|---:|
77
- | Size | ~2.02M characters | ~92K characters |
78
- | **Saved** | | **~95% (92–99% per page)** |
79
-
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.**
81
-
82
- Where the savings come from:
83
-
84
- | Method | Effect |
85
- |---|---|
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% |
102
-
103
- ## Install
104
-
105
- Requires Node.js 22.12 or later.
106
-
107
- **Claude Code**
108
-
109
- ```bash
110
- claude mcp add linkbrief -s user -- npx -y linkbrief-mcp
111
- ```
112
-
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):
45
+ **Claude Desktop (config)** — Settings → Developer → Edit Config:
122
46
 
123
47
  ```json
124
- {
125
- "mcpServers": {
126
- "linkbrief": { "command": "npx", "args": ["-y", "linkbrief-mcp"] }
127
- }
128
- }
48
+ { "mcpServers": { "linkbrief": { "command": "npx", "args": ["-y", "linkbrief-mcp"] } } }
129
49
  ```
130
50
 
131
- **Codex (OpenAI)** — add to `~/.codex/config.toml` (CLI, IDE extension and app):
51
+ **Codex** — `~/.codex/config.toml` (on Windows use `command = "cmd"`, `args = ["/c", "npx", "-y", "linkbrief-mcp"]`):
132
52
 
133
53
  ```toml
134
54
  [mcp_servers.linkbrief]
@@ -136,272 +56,143 @@ command = "npx"
136
56
  args = ["-y", "linkbrief-mcp"]
137
57
  ```
138
58
 
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`.
140
-
141
- **Cursor and other MCP clients** — register `npx -y linkbrief-mcp` as a stdio server.
59
+ **Cursor and other MCP clients** — add `npx -y linkbrief-mcp` as a stdio server.
142
60
 
143
61
  **From source**
144
62
 
145
63
  ```bash
146
- git clone https://github.com/KDDYYY/linkbrief-mcp.git
147
- cd linkbrief-mcp
148
- npm install
64
+ git clone https://github.com/KDDYYY/linkbrief-mcp.git && cd linkbrief-mcp && npm install
149
65
  claude mcp add linkbrief -s user -- node "$(pwd)/server.mjs"
150
66
  ```
151
67
 
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.
155
-
156
- ## Usage
157
-
158
- Talk to your agent as usual and include the link. It calls linkbrief by itself.
159
-
160
- **Summarize**
161
-
162
- > Summarize this in 5 bullet points: https://en.wikipedia.org/wiki/Large_language_model
163
-
164
- **Read another language, answer in yours**
165
-
166
- > Summarize this Japanese news page in English: https://www3.nhk.or.jp/news/
167
-
168
- **PDFs** — papers, reports and press releases work with just the link. See [Reading PDFs](#reading-pdfs).
68
+ </details>
169
69
 
170
- > List the paper's three main contributions and its results: https://arxiv.org/pdf/1706.03762
70
+ ## What you can ask
171
71
 
172
- **Code review and debugging**
72
+ No commands to learn — talk to your agent as usual and include the link.
173
73
 
174
- > Summarize the discussion on this PR and list the changed files: https://github.com/owner/repo/pull/123
175
-
176
- > What is the accepted fix here, and why does it work? https://stackoverflow.com/questions/11227809
177
-
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.
179
-
180
- > Read the Python tutorial and give me a one-page cheat sheet: https://docs.python.org/3/tutorial/index.html
181
-
182
- **Office files** — Word, PowerPoint, Excel and Hangul (.hwpx) links work like PDFs.
183
-
184
- > Summarize this deck slide by slide: https://example.org/files/q3-review.pptx
185
-
186
- **Pick the format**
187
-
188
- > Summarize this in 3 lines, then put every number and date in a table: https://…
189
-
190
- > From this tutorial, list only the tools used and the steps: https://…
191
-
192
- **Several links at once** — up to 10 per call (`fetch_pages`). If one fails, the others still come back.
193
-
194
- > Compare how these three articles cover the story, as a table: https://… https://… https://…
195
-
196
- **Cite sources** — every result starts with site, author, date and URL, so you can ask for citations.
197
-
198
- > Summarize this and end with the source (site, author, date): https://…
199
-
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:
201
-
202
- > What does this article say about hallucination? https://en.wikipedia.org/wiki/Large_language_model
203
-
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:
205
-
206
- > Show me the outline of this page first, then read only the section on training: https://en.wikipedia.org/wiki/Large_language_model
207
-
208
- **Long documents** — up to 20,000 characters per call; the agent continues with `start_index` when it needs more.
74
+ | You ask | linkbrief does |
75
+ |---|---|
76
+ | *Summarize this in 5 bullets:* `https://en.wikipedia.org/wiki/…` | Returns only the article, any language |
77
+ | *What does it say about hallucination?* `<long page>` | `find` returns just the matching passages |
78
+ | *List the paper's contributions:* `https://arxiv.org/pdf/…` | Reads the PDF page by page |
79
+ | *Summarize this PR and its changed files:* `https://github.com/…/pull/123` | Description, every comment, changed files |
80
+ | *Why does the accepted answer work?* `https://stackoverflow.com/questions/…` | Question and top answers, via the official API |
81
+ | *Make a cheat sheet from these docs:* `https://docs.python.org/3/tutorial/` | Reads the section, `llms.txt` first if the site has one |
82
+ | *Compare these three articles:* `<link> <link> <link>` | Reads up to 10 links at once |
209
83
 
210
- > Read this whole document and summarize each chapter: https://…
84
+ Every result starts with site, author, date and URL, so your agent can cite its sources — down to the section (`…#History`).
211
85
 
212
- **Keep link URLs** — off by default to save tokens. Turn them on when you need them:
86
+ ## Measured savings
213
87
 
214
- > Summarize this page and keep the reference links (include_links on): https://…
88
+ Characters sent to the agent, on real blog, news and wiki pages (November 2026):
215
89
 
216
- ### Reading PDFs
90
+ | Approach | Saved |
91
+ |---|---:|
92
+ | Whole page through linkbrief, vs. raw HTML | **~95%** (92–99% per page) |
93
+ | `find` — only the passages you ask about | a further **76–88%** on long documents |
94
+ | `outline`, then one `section` | a further **82–91%** on long documents |
217
95
 
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**.
96
+ Fewer tokens mean your usage limits last longer, answers come faster, and long chats keep more context.
219
97
 
220
- ![How to copy a PDF link and paste it to Claude](docs/images/pdf-link-en.png)
98
+ ## PDFs and documents
221
99
 
222
- **2. Ask your agent with the address.** linkbrief downloads the PDF and extracts its text page by page.
100
+ Paste the link to a PDF, `.docx`, `.pptx`, `.xlsx` or `.hwpx` — right-click a download link → *Copy link address*. For files on your computer, attach them to your agent directly.
223
101
 
224
102
  ![Reading an arXiv paper PDF with linkbrief and summarizing it in four lines](docs/images/pdf-demo-en.gif)
225
103
 
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>
104
+ ## Works with
227
105
 
228
- | Situation | What happens |
106
+ | | |
229
107
  |---|---|
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 |
108
+ | ✅ Web pages | Any language; JavaScript pages via your installed Chrome/Edge; Shift_JIS, GBK, Big5, EUC-KR and more |
109
+ | ✅ Developer sites | GitHub issues, PRs and code files · Stack Overflow & Stack Exchange · Hacker News · arXiv · docs sites with `llms.txt` |
110
+ | ✅ Documents | PDF, Word, PowerPoint, Excel, Hangul (.hwpx) |
111
+ | ✅ Korean sites | Naver Blog, Naver/Daum News, Namuwiki, Tistory, Brunch, Velog |
112
+ | ❌ Not supported | Pages behind a login or a bot check (Medium, Reddit), Google Search result pages, YouTube transcripts, scanned PDFs |
238
113
 
239
- ### JavaScript-heavy pages
114
+ ## Safe by default
240
115
 
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.
116
+ - **Your network stays private.** `localhost`, home/office networks and cloud metadata addresses are refused — checked again on every redirect — so a malicious page can't make your agent read your router or intranet.
117
+ - **No bypassing.** Bot checks are reported, not solved. `fetch_site` honours robots.txt and pauses between requests.
118
+ - **Nothing extra.** linkbrief only contacts the links you give it (and GitHub's or Stack Exchange's public API for those sites). No telemetry, no keys, no accounts.
119
+ - **Isolated browser.** The JavaScript fallback uses a fresh profile every time — your logins and cookies are never touched.
242
120
 
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.**
121
+ <details>
122
+ <summary><b>Tools reference</b></summary>
248
123
 
249
- ### Troubleshooting
124
+ **`fetch_page`** — one page or document
250
125
 
251
- | Message or symptom | What to do |
252
- |---|---|
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 |
126
+ | Argument | Default | |
283
127
  |---|---|---|
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 |
128
+ | `url` | required | Web page, PDF or Office file |
129
+ | `find` | — | Only passages mentioning these words or `"quoted phrases"` |
130
+ | `outline` | false | Only the headings, with section sizes and anchors |
131
+ | `section` | — | One section: `"#3"` or heading text (`"History"`, `"Page 4"`) |
132
+ | `max_length` / `start_index` | 20000 / 0 | Paging for long text; the reply says how to continue |
133
+ | `include_links` | false | Keep link URLs (off saves tokens) |
134
+ | `render` | false | Use the browser first (normally automatic) |
288
135
 
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.
136
+ **`fetch_pages`** — up to 10 `urls`, `max_length_per_page` (8000), `include_links`.
290
137
 
291
- ### `fetch_pages` — read several pages
138
+ **`fetch_site`** — `url` (start page; only links under its folder are followed), `max_pages` (10, up to 30), `max_length_per_page` (4000), `include_links`. Reads `/llms.txt` first when the site has one, honours robots.txt, and stops after 45 seconds with what it has.
292
139
 
293
- | Argument | Default | Description |
294
- |---|---|---|
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 |
298
-
299
- An outline looks like this:
300
-
301
- ```
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.
140
+ </details>
306
141
 
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, …
310
- ```
142
+ <details>
143
+ <summary><b>Settings</b> (optional environment variables)</summary>
311
144
 
312
- Every full result has this shape:
145
+ | Variable | Effect |
146
+ |---|---|
147
+ | `HTTPS_PROXY`, `HTTP_PROXY`, `NO_PROXY` | Corporate proxy, also for the browser fallback |
148
+ | `GITHUB_TOKEN` | GitHub API limit from 60 to 5,000 requests/hour |
149
+ | `LINKBRIEF_ROBOTS=always` | Honour robots.txt for single links too |
150
+ | `LINKBRIEF_BROWSER=off` or `=<path>` | Disable the browser fallback, or pick a browser |
313
151
 
314
- ```
315
- # Title
316
- Source: Site | Author: Name | Published: 2026-11-25 | URL: https://…
152
+ </details>
317
153
 
318
- Main content as Markdown
319
- ```
154
+ <details>
155
+ <summary><b>Troubleshooting</b></summary>
320
156
 
321
- ## Supported sites
322
-
323
- | Target | Status |
157
+ | Message | What to do |
324
158
  |---|---|
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)
159
+ | Agent says it can't open links | Restart the agent; `/mcp` should show `linkbrief` connected. Or say "read it with linkbrief" |
160
+ | `Page text too short` | The page needs a login, or it needs JavaScript and no Chrome/Edge was found |
161
+ | `This site shows a bot check` | The site blocks automated reading; linkbrief won't bypass it |
162
+ | `GitHub API: API rate limit exceeded` | Set `GITHUB_TOKEN` |
163
+ | `Refusing to fetch a private or local address` | Blocked for safety: `localhost` and private networks |
164
+ | `PDF has no extractable text` | Scanned PDF; OCR isn't supported |
165
+ | `Old binary .hwp files are not supported` | Save as .hwpx or PDF |
166
+ | `npx` errors / `EBADENGINE` | Check `node --version` is 22.12 or later |
343
167
 
344
- ## Settings
168
+ </details>
345
169
 
346
- All optional, as environment variables (in Claude Desktop/Codex config under `env`):
170
+ <details>
171
+ <summary><b>Live check against 38 real sites</b></summary>
347
172
 
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 |
173
+ `npm run check:live` (2026-11-27). Medium, Reddit and Google Search are refused on purpose.
354
174
 
355
- ## Security
175
+ ![Live check results for 38 sites](docs/images/live.png)
356
176
 
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.
177
+ </details>
362
178
 
363
- ## Development
179
+ <details>
180
+ <summary><b>Development and contributing</b></summary>
364
181
 
365
182
  ```bash
366
183
  npm install
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
184
+ npm test # unit, local-server, proxy and fuzz tests (offline)
185
+ npm run check:live # real sites
186
+ node page.mjs <URL> # see what linkbrief extracts from one page
372
187
  ```
373
188
 
374
- | File | Role |
375
- |---|---|
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) |
386
-
387
- ### Adding a site
388
-
389
- Add a rule to the `sites` array in `sites.mjs` and a test to `test.mjs`:
390
-
391
- ```js
392
- {
393
- name: "example",
394
- match: (u) => u.hostname === "example.com",
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
399
- }
400
- ```
189
+ Code: `tools.mjs` (MCP tools), `page.mjs` (fetching, safety, extraction, PDFs), `sites.mjs` (per-site rules), `office.mjs`, `browser.mjs`, `robots.mjs`.
190
+
191
+ To support a new site, add a rule to `sites.mjs` (`rewrite`, `pick`, `load` or `refuse`) with a test in `test.mjs`. Test HTML in `fixtures/` must be written by you, not copied from a real article.
401
192
 
402
- If a test needs HTML, write your own that mimics the site's structure instead of copying a real article into `fixtures/`.
193
+ "This site doesn't work" issues with the URL are especially welcome.
403
194
 
404
- Issues and pull requests are welcome — especially "this site doesn't work" reports with the URL.
195
+ </details>
405
196
 
406
197
  ## License
407
198
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "linkbrief-mcp",
3
3
  "mcpName": "io.github.KDDYYY/linkbrief-mcp",
4
- "version": "0.4.0",
4
+ "version": "0.4.1",
5
5
  "description": "MCP server that lets Claude, Codex and other agents read any link — web pages, PDFs, JavaScript pages — as clean Markdown from your own computer, with ~95% fewer tokens than raw HTML. Handles any language and legacy encodings.",
6
6
  "type": "module",
7
7
  "bin": {