Integrations
Every way to plug Lyrenth in as your agent's web reader. One key works across all of them, and each reads through the same standing index and returns the same clean AIDocument.
MCP server
Give Claude, Cursor, Windsurf, Cline or any MCP client a web reader. Connect to the hosted endpoint with your key in a header, or run the package locally with npx.
Open →Frameworks and tools
LangChain and LlamaIndex packages, plus ready-made tools for the Vercel AI SDK and eve, and a tool-calling recipe for the OpenAI SDK.
Open →The HTTP API
Six endpoints, one credential. Use it directly from any language, with no package at all.
Open →Python and TypeScript
Both clients are dependency-free and wrap the same three calls: read one URL, read up to twenty, or get just the Markdown.
from lyrenth import Lyrenth
client = Lyrenth() # reads LYRENTH_API_KEY
doc = client.read("https://example.com/post")
print(doc.title)
print(doc.word_count, "words")
print(doc.markdown[:400]) # the cleaned body
# doc.raw is the full AIDocument envelope
# Up to 20 URLs in one call, each failure isolated.
for r in client.read_batch(["https://example.com/a", "https://example.com/b"]):
print(r.url, r.ok, r.error)
# Or just the text.
markdown = client.read_markdown("https://example.com/post")import { Lyrenth } from "lyrenth";
const lyrenth = new Lyrenth(); // reads LYRENTH_API_KEY
const doc = await lyrenth.read("https://example.com/post");
console.log(doc.title);
console.log(doc.wordCount, "words");
console.log(doc.markdown.slice(0, 400)); // the cleaned body
// doc.raw is the full AIDocument envelope
// Up to 20 URLs in one call, each failure isolated.
for (const r of await lyrenth.readBatch([
"https://example.com/a",
"https://example.com/b",
])) {
console.log(r.url, r.ok, r.error);
}
// Or just the text.
const markdown = await lyrenth.readMarkdown("https://example.com/post");The document you get back is flat and ready to use: title, description, markdown, the word count, and the canonical URL. When you want the whole grouped envelope, it is on raw. Errors raise a typed LyrenthError carrying the HTTP status, so you can branch on it.
One authenticated GET
The smallest possible integration: a URL in, Markdown out, from a shell or any HTTP client.
curl "https://api.lyrenth.com/v1/read?url=https://example.com/post" \ -H "Authorization: Bearer $LYRENTH_API_KEY"
Add &fresh=1 to force a live re-fetch, or &max_tokens=4000 to cap the body to a context budget. The full parameter list is in the API reference.
Edge templates
Two deployable templates that report AI agent visits to your dashboard from your own edge, so you see every AI reader of your site and not only the ones who come through Lyrenth.
Both do the same job. They watch the User-Agent on incoming requests, buffer anything that looks like an AI bot, and post aggregated counts to /v1/ingest/bot/<your-domain> after the response has already gone out, so your visitors never wait on it. Both are wrapped in try/catch at every step: if Lyrenth is unreachable, the failure is that no new data appears in your dashboard, never that your site is down. Neither one reads a request body, a response body, a cookie, or a visitor IP, and the query string is stripped from the path before anything is sent.
Both need your domain verified first, and the per-domain ingest token from /sites/<your-domain>/settings. Tokens start with aiwt_ and are not API keys: one can only post bot counts for its own domain.
Cloudflare Worker
A standalone worker bound to your zone's routes. It wraps the whole request, so it sees the response status too, and it works for any site behind Cloudflare whatever the site is built with.
- Copy your ingest token from the site settings page.
- Set
LYRENTH_DOMAINinwrangler.tomlto your domain, with no www prefix. - Replace the two
routesentries with your own zone. - Run
wrangler secret put LYRENTH_INGEST_TOKENand paste the token. Do not put it in the file. - Run
wrangler deploy.
Vercel Edge Middleware
One file inside your own Next.js project. Simplest path if you are already on Vercel. It runs before your route renders, so it records the bot and the path but not the response status.
- Copy your ingest token from the site settings page.
- Add
middleware.tsat your project root, or merge its recording call into the middleware you already have. - Add
LYRENTH_DOMAINandLYRENTH_INGEST_TOKENto the project environment variables. - Push. Vercel redeploys and the data starts arriving.
The worker page has the code for both, along with what is collected and what is not. Read the site-owner worker page.
Where the packages live
Everything on this page is a published package, not a snippet to copy.
| Registry | Package | What it is |
|---|---|---|
| npm | lyrenth | TypeScript SDK, with the Vercel AI SDK and eve tools |
| npm | lyrenth-mcp | MCP server, for the npx path |
| PyPI | lyrenth | Python SDK, with optional framework adapters |
| PyPI | langchain-lyrenth | LangChain read tool and document loader |
| PyPI | llama-index-readers-lyrenth | LlamaIndex reader |
| MCP registry | com.lyrenth/lyrenth-mcp | The official Model Context Protocol registry |
The MCP server is also listed on Claude directory, Cursor directory, Smithery, Glama, LobeHub and GitHub.
One key, every surface.
The free tier needs no card, and the same key works everywhere on this page.