MCP Server Fetch Python
mcp-server-fetch-python
一个 MCP 服务器,用于获取网页内容并将其转换为各种格式。该服务器提供全面的工具来从网页中提取内容,包括对 JavaScript 渲染内容和媒体文件的支持。
特征
工具
该服务器提供了四种专用工具:
get-raw-text :直接从 URL 中提取原始文本内容,无需浏览器渲染
参数:
url:目标网页的 URL(文本、JSON、XML、csv、tsv 等)(必需)
最适合用于结构化数据格式或需要快速、直接访问的情况
get-rendered-html :使用无头浏览器获取完全渲染的 HTML 内容
参数:
url:目标网页的URL(必填)
对于需要 JavaScript 渲染的现代 Web 应用程序和 SPA 至关重要
get-markdown :将网页内容转换为格式良好的 Markdown
参数:
url:目标网页的URL(必填)
保留结构元素,同时提供清晰、可读的文本输出
get-markdown-from-media :从媒体文件中提取 AI 驱动的内容
参数:
url:目标媒体文件(图片、视频)的 URL(必需)
利用计算机视觉和 OCR 进行视觉内容分析
需要在环境变量中设置有效的 OPENAI_API_KEY
如果未设置 API 密钥或处理媒体文件时出现问题,将返回错误消息
Related MCP server: Fetch MCP
用法
克劳德桌面
要与 Claude Desktop 一起使用,请添加服务器配置:
在 MacOS 上: ~/Library/Application\ Support/Claude/claude_desktop_config.json
在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json
"mcpServers": {
"mcp-server-fetch-python": {
"command": "uvx",
"args": [
"mcp-server-fetch-python"
]
}
}环境变量
可以配置以下环境变量:
OPENAI_API_KEY :使用
get-markdown-from-media工具时必需。此密钥用于 AI 驱动的图像分析和内容提取。PYTHONIOENCODING :如果在输出中遇到字符编码问题,请设置为“utf-8”。
MODEL_NAME :指定要使用的模型名称。默认为“gpt-4o”。
"mcpServers": {
"mcp-server-fetch-python": {
"command": "uvx",
"args": [
"mcp-server-fetch-python"
],
"env": {
"OPENAI_API_KEY": "sk-****",
"PYTHONIOENCODING": "utf-8",
"MODEL_NAME": "gpt-4o",
}
}
}本地安装
或者,您可以在本地安装并运行服务器:
git clone https://github.com/tatn/mcp-server-fetch-python.git
cd mcp-server-fetch-python
uv sync
uv build然后将以下配置添加到Claude Desktop配置文件中:
"mcpServers": {
"mcp-server-fetch-python": {
"command": "uv",
"args": [
"--directory",
"path\\to\\mcp-server-fetch-python", # Replace with actual path to the cloned repository
"run",
"mcp-server-fetch-python"
]
}
}发展
调试
您可以使用npx通过以下命令启动 MCP Inspector:
npx @modelcontextprotocol/inspector uvx mcp-server-fetch-pythonnpx @modelcontextprotocol/inspector uv --directory path\\to\\mcp-server-fetch-python run mcp-server-fetch-pythonAvailable Tools
4 toolsget-markdownA
Converts web page content to well-formatted Markdown, preserving structural elements like tables and definition lists. Recommended as the default tool for web content extraction when a clean, readable text format is needed while maintaining document structure.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL of the target web page (ordinary HTML, etc.). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It describes the tool's behavior ('preserving structural elements like tables and definition lists') and output format ('well-formatted Markdown'), but lacks details on error handling, rate limits, or authentication needs. It's adequate but has gaps in behavioral disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, zero waste: the first states the purpose and key features, the second provides usage guidance. It's front-loaded with the core functionality and efficiently structured without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (single parameter, no output schema, no annotations), the description is mostly complete: it covers purpose, usage, and behavioral traits. However, it lacks details on output format specifics or error cases, leaving some gaps in context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents the 'url' parameter. The description adds context by specifying the type of web page ('ordinary HTML, etc.') and the goal of conversion, but doesn't provide additional syntax or format details beyond what the schema implies. Baseline 3 is appropriate as the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Converts web page content to well-formatted Markdown') and resource ('web page'), and distinguishes it from siblings by mentioning it's 'Recommended as the default tool for web content extraction' and preserves structural elements like tables and definition lists, unlike get-raw-text which likely doesn't preserve structure.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly provides when to use ('Recommended as the default tool for web content extraction when a clean, readable text format is needed while maintaining document structure') and implies alternatives (siblings like get-raw-text for less structured extraction or get-rendered-html for HTML output), giving clear context for selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-markdown-from-mediaB
Performs AI-powered content extraction from media files (images and videos) and converts the results to Markdown format. Specialized tool for visual content analysis that utilizes computer vision and OCR capabilities to generate descriptive text from media sources.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL of the target web page (images, videos, etc.). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions AI-powered extraction and computer vision/OCR capabilities, which adds some context about the tool's approach. However, it does not disclose critical behavioral traits such as rate limits, authentication needs, error handling, or whether the operation is read-only or has side effects, which is a significant gap for a tool with no annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized with two sentences that are front-loaded with the core purpose. The first sentence clearly states the tool's function, and the second adds specialized context. There is minimal redundancy, though the second sentence could be slightly more concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (AI-powered media analysis) and lack of annotations or output schema, the description is moderately complete. It explains the tool's purpose and specialization but omits details on output format, error conditions, and behavioral constraints. This leaves gaps for an agent to understand full usage, though the core functionality is adequately described.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with the 'url' parameter documented as 'URL of the target web page (images, videos, etc.)'. The description does not add meaning beyond this, as it does not elaborate on parameter usage, format, or constraints. The baseline score of 3 is appropriate since the schema adequately covers the single parameter.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Performs AI-powered content extraction from media files (images and videos) and converts the results to Markdown format.' It specifies the action (extraction and conversion), resources (media files), and distinguishes from siblings by focusing on visual content analysis with computer vision/OCR rather than text or HTML processing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context ('Specialized tool for visual content analysis') but does not explicitly state when to use this tool versus alternatives like 'get-markdown' or 'get-raw-text'. It suggests media files as input but lacks guidance on exclusions or prerequisites, leaving some ambiguity for the agent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-raw-textA
Extracts raw text content directly from URLs without browser rendering. Ideal for structured data formats like JSON, XML, CSV, TSV, or plain text files. Best used when fast, direct access to the source content is needed without processing dynamic elements.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL of the target web page (text, JSON, XML, csv, tsv, etc.). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses key behavioral traits such as operating 'without browser rendering' and handling 'structured data formats', but lacks details on error handling, rate limits, authentication needs, or output format specifics, which are important for a tool interacting with external URLs.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded, with three concise sentences that each add value: the first states the core purpose, the second specifies ideal use cases, and the third provides usage context. There is no wasted text.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (interacting with external URLs) and lack of annotations and output schema, the description is somewhat complete but has gaps. It covers purpose and usage well, but omits behavioral details like error responses, performance characteristics, or output structure, which are important for an agent to use it effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, so the schema already documents the 'url' parameter adequately. The description adds marginal value by implying the types of URLs supported ('text, JSON, XML, csv, tsv, etc.'), but does not provide additional syntax or format details beyond what the schema states.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('Extracts') and resource ('raw text content directly from URLs'), and distinguishes it from siblings by emphasizing 'without browser rendering' and 'structured data formats', contrasting with tools like get-rendered-html that likely involve rendering.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context on when to use this tool ('Ideal for structured data formats', 'Best used when fast, direct access to the source content is needed without processing dynamic elements'), but does not explicitly mention when not to use it or name specific alternatives among siblings like get-markdown.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-rendered-htmlB
Fetches fully rendered HTML content using a headless browser, including JavaScript-generated content. Essential for modern web applications, single-page applications (SPAs), or any content that requires client-side rendering to be complete.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL of the target web page (ordinary HTML including JavaScript, etc.). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the tool uses a headless browser and fetches JavaScript-generated content, which adds some context beyond the basic 'fetch' operation. However, it lacks details on performance characteristics (e.g., speed, timeouts), error handling, or output format, leaving significant gaps in understanding how the tool behaves in practice.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized with two sentences that are front-loaded with key information (purpose and method). Every sentence contributes meaningfully, though the second sentence could be slightly more concise by combining the examples of use cases.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (involving headless browsers and dynamic content) and the absence of both annotations and an output schema, the description is incomplete. It explains what the tool does and when to use it but lacks details on behavioral traits (e.g., performance, errors) and output format, which are critical for effective use. However, it covers the core purpose adequately for a basic understanding.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, with the single parameter 'url' clearly documented in the schema. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., no examples, constraints, or format details), so it meets the baseline for high schema coverage without compensating with extra value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with specific verbs ('fetches fully rendered HTML content') and resources ('using a headless browser'), and distinguishes it from likely siblings by emphasizing JavaScript-generated content and client-side rendering. However, it doesn't explicitly name or differentiate from the actual sibling tools (get-markdown, get-markdown-from-media, get-raw-text).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use this tool ('modern web applications, single-page applications (SPAs), or any content that requires client-side rendering'), which implicitly suggests alternatives for static content. It doesn't explicitly state when not to use it or name specific alternative tools, but the context is sufficiently detailed to guide usage decisions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v1.0.0- First observed
get-markdown - First observed
get-markdown-from-media - First observed
get-raw-text - First observed
get-rendered-html
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose with no overlap: get-markdown for general web content conversion, get-markdown-from-media for AI-powered media extraction, get-raw-text for direct access to structured data, and get-rendered-html for JavaScript-rendered content. The descriptions explicitly differentiate use cases, preventing misselection.
All tool names follow a consistent verb_noun pattern with 'get-' prefix and descriptive suffixes (e.g., get-markdown, get-raw-text). This uniformity makes the tool set predictable and easy to navigate, with no deviations in naming style.
With 4 tools, the server is well-scoped for web content extraction, covering key scenarios like general conversion, media analysis, raw data access, and rendered content. Each tool earns its place without redundancy, and the count is appropriate for the domain.
The tool set provides complete coverage for web content extraction, addressing diverse needs from structured data to dynamic pages and media files. There are no obvious gaps; agents can handle various extraction workflows without dead ends.
Maintenance
Related MCP Connectors
MCP server for web extraction and rendering via AceDataCloud WebExtrator
Free remote MCP server for fetching public web pages through a rotating proxy pool.
One MCP server for 180+ live web-data APIs returning clean JSON from sites that block scrapers.
An MCP server that provides bazaarvoic JOLT transformation capabilities.
Related MCP Servers
- AlicenseAqualityDmaintenanceA powerful MCP server for fetching and transforming web content into various formats (HTML, JSON, Markdown, Plain Text) with ease.49,628 npm42MIT
- AlicenseBqualityFmaintenanceAn MCP server that retrieves web page content using Playwright headless browser, capable of extracting main content and converting to Markdown format.33,693 npm1,085MIT
- AlicenseAqualityDmaintenanceMCP server for fetching web content with browser fingerprint camouflage, converting HTML to clean Markdown to bypass bot detection.11MIT
- AlicenseAqualityCmaintenanceAn MCP server for web content extraction, providing tools to fetch clean text, extract links, query by CSS selector, and search the web via DuckDuckGo.4MIT