MCP URL Fetcher
MCP URL 格式转换器
模型上下文协议 (MCP) 服务器可从任何 URL 获取内容并将其转换为所需的输出格式。
概述
MCP URL 格式转换器提供从任何 Web URL 检索内容并将其转换为各种格式(HTML、JSON、Markdown 或纯文本)的工具,无论原始内容类型如何。它旨在与任何兼容 MCP 的客户端(包括 Claude for Desktop)配合使用,使 LLM 能够以一致的格式访问、转换和分析 Web 内容。
Related MCP server: MCP Web Tools Server
特征
🔄格式转换:将任何 Web 内容转换为 HTML、JSON、Markdown 或纯文本
🌐通用输入支持:处理网站、API、原始文件等
🔍自动内容检测:智能识别源格式
🧰强大的库支持:使用行业标准库:
Cheerio 用于 HTML 解析
标记为 Markdown 处理
用于 XML 处理的 Fast-XML-Parser
CSVtoJSON 用于 CSV 转换
SanitizeHTML 安全性
拒绝 HTML 到 Markdown 的转换
🔧高级格式处理:
使用元数据提取进行 HTML 解析
JSON 漂亮打印和结构保存
Markdown 渲染与样式
CSV 到表格的转换
XML 到 JSON 的转换
📜历史记录跟踪:维护最近获取的 URL 的日志
🛡️安全焦点:内容清理以防止 XSS 攻击
安装
先决条件
Node.js 16.x 或更高版本
npm 或 yarn
快速入门
克隆存储库:
git clone https://github.com/yourusername/mcp-url-converter.git cd mcp-url-converter安装依赖项:
npm install构建项目:
npm run build运行服务器:
npm start
与 Claude for Desktop 集成
打开您的 Claude for Desktop 配置文件:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
将 URL 转换器服务器添加到您的配置中:
{ "mcpServers": { "url-converter": { "command": "node", "args": ["/absolute/path/to/mcp-url-converter/build/index.js"] } } }重启 Claude 桌面版
可用工具
fetch
从任何 URL 获取内容并自动检测最佳输出格式。
参数:
url(字符串,必需):获取内容的 URLformat(字符串,可选):要转换为的格式(auto,html,json,markdown,text)。默认值:auto
例子:
Can you fetch https://example.com and choose the best format to display it?fetch-json
从任何 URL 获取内容并将其转换为 JSON 格式。
参数:
url(字符串,必需):获取内容的 URLprettyPrint(布尔值,可选):是否以美观的方式打印 JSON。默认值:true
例子:
Can you fetch https://example.com and convert it to JSON format?fetch-html
从任何 URL 获取内容并将其转换为 HTML 格式。
参数:
url(字符串,必需):获取内容的 URLextractText(布尔值,可选):是否仅提取文本内容。默认值:false
例子:
Can you fetch https://api.example.com/users and convert it to HTML?fetch-markdown
从任何 URL 获取内容并将其转换为 Markdown 格式。
参数:
url(字符串,必需):获取内容的 URL
例子:
Can you fetch https://example.com and convert it to Markdown?fetch-text
从任何 URL 获取内容并将其转换为纯文本格式。
参数:
url(字符串,必需):获取内容的 URL
例子:
Can you fetch https://example.com and convert it to plain text?web-search和deep-research
这些工具为 Perplexity 搜索功能提供接口(当 MCP 主机支持时)。
可用资源
recent-urls://list
返回最近获取的带有时间戳和输出格式的 URL 列表。
例子:
What URLs have I fetched recently?安全
该服务器实施了多项安全措施:
使用
sanitize-html进行 HTML 清理以防止 XSS 攻击处理之前的内容验证
错误处理和安全默认值
使用 Zod 进行输入参数验证
安全输出编码
测试
您可以使用 MCP 检查器测试服务器:
npm run test故障排除
常见问题
连接错误:验证 URL 是否可访问且格式正确
转换错误:某些复杂内容可能无法在格式之间顺利转换
跨域问题:某些网站可能会阻止来自未知来源的请求
调试模式
要获取更多调试信息,请设置DEBUG环境变量:
DEBUG=mcp:* npm start执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。
致谢
使用模型上下文协议构建
使用现代的、积极维护的库,并注重安全
基于 OWASP 建议的清理方法
最后更新:2025年3月29日
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityBmaintenanceA production-ready Model Context Protocol server that enables language models to leverage AI-powered web scraping capabilities, offering tools for transforming webpages to markdown, extracting structured data, and executing AI-powered web searches.893MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that allows LLMs to interact with web content through standardized tools, currently supporting web scraping functionality.1MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that intelligently fetches and processes web content, transforming websites and documentation into clean, structured markdown with nested URL crawling capabilities.299MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables AI assistants to securely fetch and extract readable text content from web pages through a standardized interface.1MIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Jina AI Reader/Search MCP — turn any URL into clean LLM-ready markdown, plus web search.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nathanonn/mcp-url-fetcher'
If you have feedback or need assistance with the MCP directory API, please join our Discord server