Skip to main content
Glama

MCP Server Fetch Python

by tatn

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 密钥或处理媒体文件时出现问题,将返回错误消息

用法

克劳德桌面

要与 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-python
npx @modelcontextprotocol/inspector uv --directory path\\to\\mcp-server-fetch-python run mcp-server-fetch-python

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

用于获取 Web 内容并将其转换为各种格式的 MCP 服务器。

  1. 特征
    1. 工具
  2. 用法
    1. 克劳德桌面
  3. 环境变量
    1. 本地安装
  4. 发展
    1. 调试

Related MCP Servers

  • A
    security
    A
    license
    A
    quality
    A powerful MCP server for fetching and transforming web content into various formats (HTML, JSON, Markdown, Plain Text) with ease.
    Last updated -
    4
    146
    12
    TypeScript
    MIT License
    • Apple
    • Linux
  • A
    security
    A
    license
    A
    quality
    A simple MCP server that facilitates website fetching through a configurable server platform using stdio or SSE transport, allowing integration with tools like Cursor for streamlined access.
    Last updated -
    2
    23
    Python
    MIT License
  • -
    security
    A
    license
    -
    quality
    An MCP server that enables fetching web content using the Node.js undici library, supporting various HTTP methods, content formats, and request configurations.
    Last updated -
    66
    8
    TypeScript
    MIT License
    • Apple
    • Linux
  • A
    security
    A
    license
    A
    quality
    An MCP server that retrieves web page content using Playwright headless browser, capable of extracting main content and converting to Markdown format.
    Last updated -
    2
    584
    699
    TypeScript
    MIT License
    • Apple

View all related MCP servers

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/tatn/mcp-server-fetch-python'

If you have feedback or need assistance with the MCP directory API, please join our Discord server