光标的上下文窗口很宝贵。原始文档网站加载了导航、cookie 横幅和页脚,浪费了 40% 到 60% 的窗口空间。 Scavio 的结构化内容获取器加上 MCP 集成会剥离 chrome 并返回 LLM 就绪的降价,因此代理可以读取更多重要内容。
前置条件
- 光标IDE最新
- Scavio API 密钥
- Node.js 20+
操作指南
步骤 1: 打开光标 MCP 设置
Cursor 从 ~/.cursor/mcp.json 读取 MCP 服务器。
Bash
code ~/.cursor/mcp.json步骤 2: 注册 Scavio MCP
一个配置块添加了 scavio_fetch 和 scavio_search 工具。
JSON
{
"mcpServers": {
"scavio": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.scavio.dev/mcp"],
"env": { "SCAVIO_API_KEY": "${SCAVIO_API_KEY}" }
}
}
}步骤 3: 重新加载光标
重新启动 IDE 以发现 MCP 工具。
Text
# Cmd+Shift+P then Reload Window步骤 4: 在聊天中获取文档页面
要求 Cursor 提取并总结文档 URL。
Text
@scavio fetch https://docs.prisma.io/orm/prisma-migrate and summarize the breaking changes in v6.步骤 5: 验证代币节省
检查输入令牌计数与原始粘贴的情况。
Text
# Before: ~8,000 tokens of raw HTML
# After: ~2,500 tokens of structured markdownPython 示例
Python
# Cursor uses the MCP directly; no Python code required.
# Direct API call for parity:
import requests, os
API_KEY = os.environ['SCAVIO_API_KEY']
r = requests.post('https://api.scavio.dev/api/v1/extract',
headers={'x-api-key': API_KEY},
json={'url': 'https://docs.prisma.io/orm/prisma-migrate', 'format': 'markdown'})
print(r.json().get('markdown', '')[:500])JavaScript 示例
JavaScript
const API_KEY = process.env.SCAVIO_API_KEY;
const r = await fetch('https://api.scavio.dev/api/v1/extract', {
method: 'POST',
headers: { 'x-api-key': API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ url: 'https://docs.prisma.io/orm/prisma-migrate', format: 'markdown' })
});
console.log(((await r.json()).markdown || '').slice(0, 500));预期输出
JSON
Clean markdown representation of the doc page, stripped of nav and cookies. Cursor's context fills with content instead of chrome.