mcp server fetch python
An MCP server for fetching and transforming web content into various formats.
An MCP server for fetching and transforming web content into various formats.
An MCP server for fetching and transforming web content into various formats. This server provides comprehensive tools for extracting content from web pages, including support for JavaScript-rendered content and media files.
The server provides four specialized tools:
url
: URL of the target web page (text, JSON, XML, csv, tsv, etc.) (required)Best used for structured data formats or when fast, direct access is needed
get-rendered-html: Fetches fully rendered HTML content using a headless browser
url
: URL of the target web page (required)Essential for modern web applications and SPAs that require JavaScript rendering
get-markdown: Converts web page content to well-formatted Markdown
url
: URL of the target web page (required)Preserves structural elements while providing clean, readable text output
get-markdown-from-media: Performs AI-powered content extraction from media files
url
: URL of the target media file (images, videos) (required)To use with Claude Desktop, add the server configuration:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
"mcpServers": {
"mcp-server-fetch-python": {
"command": "uvx",
"args": [
"mcp-server-fetch-python"
]
}
}
The following environment variables can be configured:
get-markdown-from-media
tool. This key is needed for AI-powered image analysis and content extraction."mcpServers": {
"mcp-server-fetch-python": {
"command": "uvx",
"args": [
"mcp-server-fetch-python"
],
"env": {
"OPENAI_API_KEY": "sk-****",
"PYTHONIOENCODING": "utf-8",
"MODEL_NAME": "gpt-4o",
}
}
}
Alternatively, you can install and run the server locally:
git clone https://github.com/tatn/mcp-server-fetch-python.git
cd mcp-server-fetch-python
uv sync
uv build
Then add the following configuration to Claude Desktop config file:
"mcpServers": {
"mcp-server-fetch-python": {
"command": "uv",
"args": [
"--directory",
"pathtomcp-server-fetch-python", # Replace with actual path to the cloned repository
"run",
"mcp-server-fetch-python"
]
}
}
You can start the MCP Inspector using npxwith the following commands:
npx @modelcontextprotocol/inspector uvx mcp-server-fetch-python
npx @modelcontextprotocol/inspector uv --directory pathtomcp-server-fetch-python run mcp-server-fetch-python
[
{
"description": "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.",
"inputSchema": {
"properties": {
"url": {
"description": "URL of the target web page (text, JSON, XML, csv, tsv, etc.).",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
},
"name": "get-raw-text"
},
{
"description": "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.",
"inputSchema": {
"properties": {
"url": {
"description": "URL of the target web page (ordinary HTML including JavaScript, etc.).",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
},
"name": "get-rendered-html"
},
{
"description": "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.",
"inputSchema": {
"properties": {
"url": {
"description": "URL of the target web page (ordinary HTML, etc.).",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
},
"name": "get-markdown"
},
{
"description": "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.",
"inputSchema": {
"properties": {
"url": {
"description": "URL of the target web page (images, videos, etc.).",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
},
"name": "get-markdown-from-media"
}
]