Efficient MCP server for web content extraction and transformation with JavaScript rendering and media analysis tools
mcp-server-fetch-python
MCP Server?The mcp-server-fetch-python
serves as an essential component for AI applications seeking to fetch, extract, and transform web content into structured formats. This server leverages both traditional URL scraping techniques and advanced headless browser rendering capabilities, ensuring comprehensive data capture even from complex modern web pages that rely on JavaScript execution.
The get-raw-text
tool is designed to extract raw text content directly from URLs without the need for JavaScript rendering. It supports various data formats such as plain text, JSON, XML, CSV, and TSV files.
url
: The URL of the target web page (text, JSON, XML, csv, tsv, etc.).This tool fetches fully rendered HTML content using a headless browser, ensuring that JavaScript-rendered elements are also included in the output.
url
: The URL of the target web page (required).The get-markdown
tool converts web page content to well-formatted Markdown, preserving structural elements for easier readability.
url
: The URL of the target web page (required).This tool performs AI-powered content extraction from media files such as images and videos.
url
: The URL of the target media file (images, videos).The architecture of the mcp-server-fetch-python
is designed to seamlessly integrate with various AI applications using the Model Context Protocol (MCP). The server components are implemented as part of the broader MCP ecosystem, facilitating standardized data exchange between different application clients and upstream services.
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
This diagram illustrates the flow of data within the MCP protocol, from an AI application to the server and ultimately to a data source or tool.
To run mcp-server-fetch-python
in a local environment, follow these steps:
git clone https://github.com/tatn/mcp-server-fetch-python.git
cd mcp-server-fetch-python
uv sync
uv build
Then, configure your MCP client to use this server.
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
This table outlines the compatibility of mcp-server-fetch-python
with various MCP clients.
Web Content Analysis:
# Example Python code using the get-markdown tool
import mcp_server_fetch_python
url = "https://example.com/report"
response = mcp_server_fetch_python.get_markdown(url)
print(response.text)
Automated Content Extraction from Images and Videos:
# Example Python code using the get-markdown-from-media tool
import mcp_server_fetch_python
url_image = "https://example.com/image"
url_video = "https://example.com/video"
response_image = mcp_server_fetch_python.get_markdown_from_media(url_image)
print(response_image.text)
response_video = mcp_server_fetch_python.get_markdown_from_media(url_video)
print(response_video.text)
To configure mcp-server-fetch-python
for use with an MCP client like Claude Desktop, add the following to your .claude_desktop_config.json
file:
{
"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"
],
"env": {
"OPENAI_API_KEY": "sk-***", # Set your API key here
"PYTHONIOENCODING": "utf-8",
"MODEL_NAME": "gpt-4o"
}
}
}
}
The performance of mcp-server-fetch-python
is optimized for various use cases, ensuring that data fetching and transformation are both efficient and effective. Here’s a compatibility matrix highlighting the performance across different AI clients.
[Performance Data Available on Request]
OPENAI_API_KEY
: Required for using the get-markdown-from-media
tool.
{
"env": {
"OPENAI_API_KEY": "sk-***"
}
}
PYTHONIOENCODING
, especially when dealing with non-ASCII characters.get-markdown-from-media
tool and adjust as needed.Contributions are welcome! To contribute, follow these guidelines:
Explore more MCP-related documentation and resources at MCP Documentation.
By integrating mcp-server-fetch-python
into your AI applications, you can achieve robust data extraction and transformation capabilities, enhancing the overall functionality of your solutions.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods