@pagevistly/mcp
v0.1.4
Published
MCP server for PageVistly — agent-friendly web rendering (screenshot/PDF/OG image) with context economy
Maintainers
Readme
@pagevistly/mcp
PageVistly 的官方 MCP server —— 让 AI agent 以「上下文经济性」方式读取网页。
差异化:竞品 MCP 把整张截图(500KB+ base64)塞进 context window,我们返回压缩预览 + 页面文本 + 签名 URL,一次调用既「看」又「读」,还知道花了多少 token。
接入(Claude Desktop / Cursor)
{
"mcpServers": {
"pagevistly": {
"command": "npx",
"args": ["-y", "@pagevistly/mcp"],
"env": {
"PAGEVISTLY_API_KEY": "sk_live_xxx"
}
}
}
}Claude Desktop:~/Library/Application Support/Claude/claude_desktop_config.json
Cursor:~/.cursor/mcp.json
工具
read_page(url, detail, max_tokens)
核心工具。以 token 预算方式读取网页:
detail: "low"(默认)→ 返回文本摘要 + 小图预览(多模态模型可看)detail: "high"→ 只返回文本(纯文本模型用)max_tokens→ 控制文本内容的 token 预算
返回结构:title + text(页面文本)+ links + est_tokens(本次调用消耗)+ full_res_url(原图按需取)。
make_og_image(template, title, subtitle, author)
生成 1200×630 社交卡片图。模板:blog / product / default。
url_to_pdf(url, html, format, landscape)
URL 或原始 HTML 转打印级 PDF,返回 base64。格式:A4(默认)/ Letter / Legal,支持 landscape 横向。
check_changes(url)
检测网页自上次渲染以来的变化(监控类 agent 用)。首次调用建立基线,后续调用返回 changed + added / removed 行。
describe_screenshot(url)
用视觉模型描述截图内容——图表、Canvas、复杂 UI 等 DOM 文本提取不到的内容。
环境变量
| 变量 | 必填 | 说明 |
|---|---|---|
| PAGEVISTLY_API_KEY | ✅ | API Key(sk_live_...) |
| PAGEVISTLY_BASE_URL | 否 | 默认 https://api.pagevistly.com |
本地开发
cd mcp
npm install
npm run build # 编译到 dist/
npm run dev # tsx 直接跑发布到 npm
npm run build
npm publish --access public注意:
bin指向dist/index.js,发布前必须先npm run build。
