惊人的Web URL阅读器
Markdown首选原生MCP服务器 text/markdown 当网站支持响应时,返回到仅用于HTML或JavaScript繁重页面的Playwright渲染,并(可选)总结下游LLM工具的结果。默认情况下,我们发送 Accept: text/markdown, text/plain;q=0.99, text/html;q=0.9, */*;q=0.8;通过以下方式覆盖 AMAZING_READER_ACCEPT_HEADER 如果你的客户需要其他东西。
快速开始
- 安装Playwright Chromium二进制文件一次:
uvx --from git+https://github.com/paullesiak/amazing_web_url_reader python -m amazing_web_url_reader --install-browser- 将您的MCP感知代理指向同一位置
uvx命令(见下面的示例)。使用python -m amazing_web_url_reader可以从任何工作目录工作,因此像LM Studio这样的主机不必知道仓库的位置。可执行文件会自动与存储库的主分支保持最新状态。要强制uvx每次刷新Git签出,请添加UVX_ALWAYS_REFRESH=1到MCP服务器环境(或运行uvx --upgrade ...手动提取最新更改)。
配置选项
| 变量 | 必填? | 默认 | 目的 |
|---|---|---|---|
AMAZING_READER_ACCEPT_HEADER | 可选 | text/markdown, text/plain;q=0.99, text/html;q=0.9, */*;q=0.8 | 广告不同 Accept 标题指向目标站点。保持 text/markdown 在保留本土降价谈判价值方面。 |
AMAZING_READER_SUMMARY_TOKENS | 可选 | 未设置(无摘要) | 全局回退令牌目标 use_ollama_summarization 为真,但请求遗漏了 summary_target_tokens. |
OLLAMA_HOST | 可选 | http://localhost:11434 | 摘要后端的默认主机。 |
OLLAMA_MODEL | 可选 | gpt-oss:20b | 摘要的默认LLM。 |
MCP_DEBUG | 可选 | 未设置 | 设置为 1 用于详细日志记录(stdio连接、跟踪等)。 |
工具参数(read_web_url_amazing)镜像MCP架构: url (必填)加可选 wait_for_selector, wait_time, scroll_to_bottom, truncate, max_length, use_ollama_summarization, summary_target_tokens, ollama_host,以及 ollama_model.
当上游服务器响应时 Content-Type: text/markdown,该工具直接返回该正文并报告 render_method: "native_markdown"否则,它将回退到 render_method: "playwright" 在从页面呈现和提取内容之后。
MCP代理示例
OpenAI Codex(configuration.toml)
[[mcp_servers]]
name = "amazing-web-url-reader"
type = "stdio"
command = "uvx"
args = [
"--from", # required: tell uvx to pull straight from GitHub
"git+https://github.com/paullesiak/amazing_web_url_reader",
"python",
"-m",
"amazing_web_url_reader"
]
[mcp_servers.env]
# Optional overrides — delete the ones you don't need.
AMAZING_READER_ACCEPT_HEADER = "text/markdown, text/plain;q=0.99, text/html;q=0.9, */*;q=0.8"
AMAZING_READER_SUMMARY_TOKENS = "1500"
OLLAMA_HOST = "http://localhost:11434"
OLLAMA_MODEL = "gpt-oss:20b"
MCP_DEBUG = "0"克劳德代码(mcpServers JSON)
{
"mcpServers": {
"amazing-web-reader": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/paullesiak/amazing_web_url_reader",
"python",
"-m",
"amazing_web_url_reader"
],
"env": {
"AMAZING_READER_SUMMARY_TOKENS": "0",
"AMAZING_READER_ACCEPT_HEADER": "text/markdown, text/plain;q=0.99, text/html;q=0.9, */*;q=0.8",
"OLLAMA_HOST": "http://localhost:11434",
"OLLAMA_MODEL": "gpt-oss:20b"
}
}
}
}这些代码段演示了服务器理解的每个环境变量;你可以自由地把它们剥回你关心的那些。重新运行您的代理会自动通过以下方式从GitHub获取最新代码 uvx.
