← AgentReader

How to let an AI agent read web pages and PDFs as clean Markdown

An agent's built-in fetch often returns more than the model can use: token-heavy HTML, an empty JavaScript shell, a cookie or consent wall, raw PDF bytes, or a 200 that is really a bot check or paywall teaser. AgentReader is a remote reader for that job. You send a URL and get back the page's main content as clean Markdown (or JSON with title, author, date, links and tables). Navigation, ads, scripts and cookie banners are removed, and code blocks are kept verbatim.

This guide covers three ways to use it: the remote MCP server at https://agentreader.xyz/mcp (Claude Desktop, Cursor, Cline, and Claude Code), the REST API, and the LangChain and LlamaIndex Python packages. The first 5 reads a day per IP need no key and no signup.

If you are in Claude Desktop, Cursor, Cline or another MCP client, add the remote server and call read_url. If you are calling it from your own code, use the REST API: it is the same reader the MCP tools use. If you already load documents in LangChain or LlamaIndex, the packages call that API for you.

What you get back

The default response is GitHub-flavoured Markdown of the main content. With format=json you also get title, author, date, site name, description, language, content type, word count, links, tables and metadata. Every read reports its size in the x-agentreader-tokens, x-agentreader-raw-tokens and x-agentreader-saved-percent headers (estimates at about 4 characters per token).

It handles static pages (plain fetch, then Mozilla Readability and Turndown), JavaScript-only pages (headless Chromium when a plain fetch returns too little, or force it with render=always), cookie and consent walls, and PDF URLs. JSON, plain text, Markdown and CSV URLs are read as text. News homepages can return a headline list (mode=links); RSS and Atom feeds return their items. You can also pull structured fields without an LLM, with extract=title,author,date,price.

A PDF uses the same read_url tool or /v1/read endpoint as a web page: pass the URL of the file, not an upload. You get the text layer as Markdown. In JSON mode, title, author and meta.pages come from the PDF metadata, and meta.warning is set when very little text could be extracted. See PDF to Markdown API for limits.

MCP: Claude Desktop, Cursor and Cline

The MCP server is remote, over Streamable HTTP, with nothing to install: https://agentreader.xyz/mcp. The tools are:

Claude Desktop (and claude.ai)

Claude Desktop, claude.ai and ChatGPT connectors can't send an API key header. Add a custom connector with this URL:

https://agentreader.xyz/mcp

That is enough for the free daily reads. After you buy credits at /buy, put the key in the connector URL and keep that URL private:

https://agentreader.xyz/mcp?api_key=ar_...

Some apps store connector URLs in plain text, so treat that URL like a password; if it leaks, email hello@agentreader.xyz and we'll move your credits to a new key.

Cursor and Cline

Cursor and other clients that use an mcpServers config, including Cline, can add the same remote server. For the free tier:

{
  "mcpServers": {
    "agentreader": {
      "url": "https://agentreader.xyz/mcp"
    }
  }
}

With prepaid credits, send the key as a header:

{
  "mcpServers": {
    "agentreader": {
      "url": "https://agentreader.xyz/mcp",
      "headers": {
        "Authorization": "Bearer ar_..."
      }
    }
  }
}

Claude Code can add the same server from the terminal:

claude mcp add --transport http agentreader https://agentreader.xyz/mcp

With a key, add --header "Authorization: Bearer ar_...".

REST API

The same reader is one GET (or a POST with a JSON body). No key is needed for the free daily reads:

# Markdown (default)
curl "https://agentreader.xyz/v1/read?url=https://react.dev/learn"

# JSON: title, author, date, links, tables, wordCount, meta
curl "https://agentreader.xyz/v1/read?url=https://react.dev/learn&format=json"

# A PDF URL (one read, however many pages)
curl "https://agentreader.xyz/v1/read?url=https://arxiv.org/pdf/1706.03762"

# With prepaid credits
curl -H "Authorization: Bearer ar_..." "https://agentreader.xyz/v1/read?url=https://react.dev/learn"

Useful query parameters: format=markdown|json, mode=auto|article|links|full, render=auto|never|always, and extract= for structured fields. You can also send the key as x-api-key. URL aliases u and link work, a missing scheme is treated as https, and path style /v1/read/https://... is accepted. Web search is GET https://agentreader.xyz/v1/search?q=..., priced like a read.

All parameters: llms.txt · OpenAPI.

LangChain and LlamaIndex

Two open-source loaders (MIT) on PyPI call the same API. They use the free tier without a key, or prepaid credits when you set AGENTREADER_API_KEY (or pass api_key=).

pip install langchain-agentreader

from langchain_agentreader import AgentReaderLoader

docs = AgentReaderLoader([
    "https://react.dev/learn",
    "https://arxiv.org/pdf/1706.03762",
]).load()
print(docs[0].metadata["title"])
print(docs[0].page_content[:500])

Optional arguments: mode (auto, article, links, full), render (auto, never, always), extract (for example "title,author,date,price"), continue_on_failure. Package: langchain-agentreader on PyPI.

pip install llama-index-readers-agentreader

from llama_index.readers.agentreader import AgentReaderWebReader

docs = AgentReaderWebReader().load_data([
    "https://react.dev/learn",
    "https://arxiv.org/pdf/1706.03762",
])

Package: llama-index-readers-agentreader on PyPI. More detail is on the Python packages page.

What it doesn't do

A PDF costs one read, however many pages it has (files up to 20 MB). A target page that does not exist (the site answers HTTP 404 or 410) returns HTTP 404 with code not_found, not charged. If a result looks wrong or empty, call report_issue or POST /v1/report so we can look at it.

Pricing

The first 5 reads a day per IP are free, with no key. They reset daily at 00:00 UTC. After that: $3 for 2,000 reads ($1.50 per 1,000) or $10 for 7,000 reads ($1.43 per 1,000) + VAT where applicable by card at /buy, one-time, credits don't expire. The page issues an API key. Agents with a wallet can pay per call with x402 ($0.005 USDC), or buy a bundle (500 reads for $1 or 5,000 reads for $8 in USDC).

Only successful reads are charged. Blocked sites, paywalled pages, timeouts and errors are free. A web search costs the same as a read.

More: URL to Markdown API · PDF to Markdown API · Python packages · vs Jina Reader and Firecrawl · llms.txt.