Skip to main content
Glama
CormickKneey

Web Fetch MCP Server

by CormickKneey

Web Fetch MCP Server (Python)

基于 zcaceres/fetch-mcp 的 Python 实现,使用 FastMCP 框架。

功能

提供 4 个网页内容获取工具:

工具

描述

fetch_html

获取网页原始 HTML

fetch_json

获取并解析 JSON 数据

fetch_txt

获取纯文本(去除 HTML 标签)

fetch_markdown

获取网页并转换为 Markdown

所有工具支持以下参数:

  • url - 目标 URL(必填)

  • headers - 自定义请求头(可选)

  • max_length - 最大返回字符数,默认 50000(可选)

  • start_index - 起始字符位置,默认 0(可选)

Related MCP server: Fetch MCP Server

使用方式

本地运行

# 安装依赖
uv venv && source .venv/bin/activate
uv pip install -e .

# Stdio 模式
uv run python fetch_mcp_server.py

# SSE 模式(HTTP 服务)
uv run fastmcp run fetch_mcp_server.py:mcp --transport sse --port 8000

Docker 运行

# 构建镜像
docker build -t web-fetch-mcp .

# 运行容器
docker run -d -p 8000:8000 --name web-fetch-mcp web-fetch-mcp

# 或使用 docker-compose
docker-compose up -d

MCP 客户端配置

Streamable HTTP 模式(Docker 默认)

{
  "mcpServers": {
    "fetch": {
      "url": "http://localhost:8000/mcp"
    }
  }
}

SSE 模式

{
  "mcpServers": {
    "fetch": {
      "url": "http://localhost:8000/sse"
    }
  }
}

Stdio 模式

{
  "mcpServers": {
    "fetch": {
      "command": "python",
      "args": ["/path/to/fetch_mcp_server.py"]
    }
  }
}

环境变量

  • DEFAULT_LIMIT - 默认最大返回字符数(默认: 50000)

License

MIT

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

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/CormickKneey/web-fetch-mcp'

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