@mrclrchtr/supi-web
SuPi Web extension — fetch web pages as clean Markdown (web_fetch_md) and library docs via Context7 (web_docs_search, web_docs_fetch)
Package details
Install @mrclrchtr/supi-web from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@mrclrchtr/supi-web- Package
@mrclrchtr/supi-web- Version
1.3.1- Published
- May 17, 2026
- Downloads
- 376/mo · 376/wk
- Author
- mrclrchtr
- License
- MIT
- Types
- extension
- Size
- 86.9 KB
- Dependencies
- 6 dependencies · 2 peers
Pi manifest JSON
{
"extensions": [
"./src/extension.ts",
"node_modules/@mrclrchtr/supi-core/src/extension.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@mrclrchtr/supi-web
Fetch web pages as clean Markdown and query library documentation via Context7 for the pi coding agent.
Install
Included in @mrclrchtr/supi, or install standalone:
pi install npm:@mrclrchtr/supi-web
For local development:
pi install ./packages/supi-web
After editing the source, run /reload to pick up changes.
Package surfaces
@mrclrchtr/supi-web/api— programmatic exports (conversion helpers, fetch utilities, tool factories)@mrclrchtr/supi-web/extension— aggregated pi extension entrypoint that registers all three tools
pi.extensions still points at the real file path ./src/extension.ts inside the package. The /api and /extension paths are consumer-facing package exports, not manifest aliases.
What it adds
Registers three agent-callable tools:
| Tool | Purpose |
|---|---|
web_fetch_md |
Fetch an http(s) URL and return clean Markdown |
web_docs_search |
Search Context7 for libraries by name |
web_docs_fetch |
Retrieve up-to-date documentation for a specific library via Context7 |
web_fetch_md — Web Page to Markdown
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
url |
string |
required | http:// or https:// URL to fetch |
output_mode |
"auto" | "inline" | "file" |
"auto" |
auto returns inline if ≤15,000 chars, else writes to temp file |
abs_links |
boolean |
true |
Absolutize relative links and image sources |
timeout_ms |
number |
30000 |
Fetch timeout in milliseconds |
Content negotiation
The tool tries multiple strategies to get clean Markdown:
- HEAD negotiation — checks
content-typefor Markdown - Sniffing — range GET of first 8KB to detect Markdown/plain text vs HTML
- Sibling probing — tries
.md/.markdownvariants (e.g.page.mdforpage.html) - HTML conversion — full GET → JSDOM + Readability + Turndown → clean Markdown
web_docs_search — Library Lookup
Searches Context7's library index and returns a Markdown table of matching libraries with metadata.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
library_name |
string |
required | Library name to search for (e.g. "react", "next.js", "fastapi") |
query |
string |
required | What the agent is trying to do — used for relevance ranking |
Output
Returns a Markdown table with columns: Name, ID, Description, Trust Score, Benchmark Score, Snippet Count, Versions. The agent picks a library ID from these results to pass to web_docs_fetch.
web_docs_fetch — Documentation Retrieval
Fetches up-to-date documentation context for a specific library via Context7's API.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
library_id |
string |
required | Context7 library ID (e.g. /facebook/react, /vercel/next.js/v15.1.8) |
query |
string |
required | Specific question about the library |
raw |
boolean |
false |
When true, returns JSON-serialized snippet objects instead of plain text Markdown |
API Key (optional)
The tool reads the CONTEXT7_API_KEY environment variable automatically when set. Without a key, it works with lower rate limits. Get a key at context7.com/dashboard.
Source files
src/api.ts— public package exportssrc/extension.ts— aggregated extension entrypointsrc/web.ts—web_fetch_mdtool registrationsrc/docs.ts—web_docs_search+web_docs_fetchtool registrationsrc/context7-client.ts— thin wrapper around@upstash/context7-sdksrc/fetch.ts— HTTP fetch logicsrc/convert.ts— HTML to Markdown conversion
Commands
pnpm vitest run packages/supi-web/
pnpm exec tsc --noEmit -p packages/supi-web/tsconfig.json
pnpm exec biome check packages/supi-web/