Skip to main content
Glama
README.md
<p align="center">
  <img src="https://raw.githubusercontent.com/vykio/webread-mcp/main/docs/banner.webp" alt="A small robot reading a page that unrolls out of a browser window" width="100%">
</p>

<h1 align="center">webread</h1>

<p align="center">
  <strong>Let your AI agent read the web like you do.</strong><br>
  An MCP server that fetches a page the way a browser does and hands back clean markdown.
</p>

<p align="center">
  <a href="https://github.com/vykio/webread-mcp/actions/workflows/ci.yml"><img src="https://github.com/vykio/webread-mcp/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
  <a href="https://pypi.org/project/webread/"><img src="https://img.shields.io/pypi/v/webread?color=3776ab" alt="PyPI"></a>
  <img src="https://img.shields.io/badge/python-3.10%2B-3776ab" alt="Python 3.10+">
  <a href="https://registry.modelcontextprotocol.io/v0/servers?search=io.github.vykio/webread"><img src="https://img.shields.io/badge/MCP_Registry-io.github.vykio%2Fwebread-7c3aed" alt="MCP Registry"></a>
  <a href="https://github.com/vykio/webread-mcp/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-22c55e" alt="MIT license"></a>
</p>

---

## Why

You paste a link into your coding agent and get back *"I couldn't fetch that page"*, or a vague
three-line summary of a 40-page doc. Usually the page is fine. The fetch tool is the problem:

- **It announces itself as a bot**, and a lot of sites turn away AI user agents on sight.
- **It summarizes through a second model** that truncates, paraphrases or declines.
- **It reads raw HTML**, so JavaScript apps come back as an empty `<div id="root">`.
- **It chokes on PDFs**, which is where half the interesting docs live.

`webread` is one tool, `read_url`, that fixes those four: it sends an ordinary browser request,
pulls out the main content with [trafilatura](https://github.com/adbar/trafilatura), and returns
the text itself, paginated, with nothing in between. Pages that need JavaScript are rendered in
headless Chromium when you install the optional browser extra.

## Features

|                         |                                                                                   |
| ----------------------- | --------------------------------------------------------------------------------- |
| đź§­ **Browser-like fetch** | Real Chrome headers, redirects followed, no robots.txt lookup (browsers don't either) |
| đź“° **Main-content extraction** | Article text as markdown with links and tables; nav, ads and footers dropped |
| đź“„ **PDF, JSON, text** | PDFs extracted page by page; JSON and plain text returned verbatim |
| ⚡ **JavaScript rendering** | Optional headless Chromium, used automatically when a page comes back empty |
| đź“‘ **Pagination** | `start` / `max_chars` to walk long pages; results cached 15 minutes |
| 🛑 **Honest failures** | Anti-bot challenges, HTTP errors and login walls are reported as such |
| 🖥️ **CLI included** | `webread <url>` prints the same output in your terminal |

## Quick start

You need [uv](https://docs.astral.sh/uv/). Nothing else to install: `uvx` fetches and caches the
server from [PyPI](https://pypi.org/project/webread/). Run without arguments, `webread` is the MCP
server; give it a URL and it prints the page in your terminal.

`webread` is also listed in the [official MCP Registry](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.vykio/webread)
as `io.github.vykio/webread`, so clients and directories that read the registry can install it by name.

### Claude Code

```bash
claude mcp add --scope user webread -- uvx webread
```

### Claude Desktop, Cursor, Windsurf, and other MCP clients

Add this to your client's MCP config (`claude_desktop_config.json`, `.cursor/mcp.json`, ...):

```json
{
  "mcpServers": {
    "webread": {
      "command": "uvx",
      "args": ["webread"]
    }
  }
}
```

### From the terminal

```bash
uvx webread https://en.wikipedia.org/wiki/Robots.txt
```

## Rendering JavaScript pages (optional)

Install the `browser` extra and a Chromium build that matches it:

```bash
# Linux: --with-deps also installs Chromium's system libraries (asks for sudo)
uvx --from "webread[browser]" playwright install --with-deps chromium
```

Then point your MCP client at the extra:

```bash
claude mcp add --scope user webread -- \
  uvx --from "webread[browser]" webread
```

With the extra installed, `render="auto"` (the default) first tries a plain HTTP fetch, which is
fast, and only starts Chromium when that fetch fails or returns less than a paragraph of text.
Whichever attempt produced more content wins.

## The `read_url` tool

| Parameter   | Type                              | Default  | What it does                                               |
| ----------- | --------------------------------- | -------- | ---------------------------------------------------------- |
| `url`       | string                            | required | The page to read. `https://` is assumed if missing.        |
| `start`     | int                               | `0`      | Character offset, to continue reading a long page.         |
| `max_chars` | int                               | `20000`  | Maximum characters returned by this call.                  |
| `render`    | `"auto"` \| `"never"` \| `"always"` | `"auto"` | When to use headless Chromium.                             |
| `raw`       | bool                              | `false`  | Return the raw body (HTML source, JSON) instead of extracted text. |

What the model gets back:

```text
URL: https://react.dev/learn
Title: Quick Start
Status: 200 (text/html, via http)

Welcome to the React documentation! This page will give you an introduction to 80% of the
React concepts that you will use on a daily basis.

### You will learn

- How to create and nest components
...
```

The tool is annotated read-only, and its description tells the model to treat page text as data,
not instructions.

### Making it the default

The server ships MCP instructions telling the model to prefer `read_url` over built-in fetch tools,
and most clients inject those into the system prompt. Models still have habits, so for a firmer
default add a line to your agent instructions (`~/.claude/CLAUDE.md`, `AGENTS.md`, Cursor rules...):

```markdown
To read a web page, use the webread MCP tool (read_url) instead of WebFetch.
```

In Claude Code you can go further and turn the built-in tool off by adding `"WebFetch"` to
`permissions.deny` in `~/.claude/settings.json`.

## How it works

```mermaid
flowchart LR
    A[read_url] --> B{cached?}
    B -- yes --> R[format and paginate]
    B -- no --> C[HTTP GET<br/>browser headers]
    C --> D{failed or<br/>nearly empty?}
    D -- no --> E[extract]
    D -- yes --> F[headless Chromium<br/>optional]
    F --> E
    E --> |HTML| G[trafilatura → markdown]
    E --> |PDF| H[pypdf → text]
    E --> |JSON / text| I[verbatim]
    G & H & I --> R
```

## What it will not do

`webread` makes the same request your browser would, once, when you ask. It deliberately does
**not**:

- **Bypass anti-bot systems.** No TLS fingerprint spoofing, no CAPTCHA solving, no proxy rotation.
  When Cloudflare or a similar service serves a challenge, the tool says so plainly.
- **Log in for you.** Pages behind a login return the login page. For those, use a tool that drives
  your own signed-in browser, such as Claude in Chrome.
- **Crawl.** One URL per call, and repeated calls hit a 15-minute cache.

### Use it responsibly

Skipping robots.txt is reasonable for a person reading one page through an assistant, which is
exactly what a browser does. It is not a license to scrape. If you point this at a site in bulk,
respect its terms of service, its rate limits and any text-and-data-mining opt-out it publishes.

## How it compares

|                                  | Built-in agent fetch tools | [`mcp-server-fetch`](https://github.com/modelcontextprotocol/servers/tree/main/src/fetch) | **webread** |
| -------------------------------- | :------------------------: | :-------------------------: | :-------------: |
| Returns the page text itself     | often summarized           | âś…                           | âś…               |
| Browser user agent by default    | ❌                          | ❌ (configurable)            | ✅               |
| Main-content extraction          | varies                     | readability                 | trafilatura     |
| PDF                              | varies                     | ❌                           | ✅               |
| JavaScript rendering             | ❌                          | ❌                           | optional        |
| Reports anti-bot challenges      | ❌                          | ❌                           | ✅               |

If you only need a plain fetcher, the reference `mcp-server-fetch` with `--ignore-robots-txt` and a
custom `--user-agent` gets you part of the way.

## Development

```bash
git clone https://github.com/vykio/webread-mcp
cd webread-mcp
uv run pytest            # tests run against a local HTTP server, no network needed
uv run webread https://example.com
```

The code is small: `fetch.py` does the work, `format.py` lays out the result, `server.py` exposes
it over MCP and `cli.py` is the terminal entry point.

### Releasing

1. Bump the version in `pyproject.toml` and in both `version` fields of `server.json`.
2. Commit, then push a tag: `git tag -a v0.2.0 -m "webread 0.2.0" && git push origin v0.2.0`.

The [release workflow](https://github.com/vykio/webread-mcp/blob/main/.github/workflows/release.yml) checks that the three versions match the tag,
runs the tests, publishes to PyPI through trusted publishing (no stored token), then updates the
MCP Registry entry.

## License

[MIT](https://github.com/vykio/webread-mcp/blob/main/LICENSE). The banner was generated with FLUX.1 [schnell] (Apache 2.0).

<!-- mcp-name: io.github.vykio/webread -->

TDQS

A4.7/5.0

Scored across 1 tool

Disambiguation5/5

There is only one tool, so an agent cannot misselect between competing options. Its purpose—fetch a URL and return readable content as markdown—is stated precisely, including what it replaces (WebFetch).

Naming Consistency5/5

The single name `read_url` follows the conventional verb_noun snake_case pattern and is self-descriptive. With one tool there is no mixed convention to worry about.

Tool Count3/5

The surface is a single tool, which the rubric treats as thin/borderline. It is a defensible minimal design for a pure fetcher, but there is no companion operation (e.g. multi-URL fetch or search) to round it out.

Completeness4/5

For a web reader the essential capability is covered thoroughly: chunking via `start`/`max_chars`, JS rendering modes, raw body access, and caching. Minor gaps remain—no batch/multi-URL read and no cache-control or link-extraction options—forcing repeated calls for several pages.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues