Skip to main content

Web Tool MCP Server

一个基于FastMCP框架的Web工具MCP服务器,提供网页内容获取和搜索功能。

功能特性

  • 网页内容获取: 获取指定URL的网页内容
  • 内容搜索: 在网页内容中搜索特定关键词
  • HTML解析: 自动解析HTML并提取文本内容
  • 错误处理: 完善的错误处理和超时机制

安装

从源码安装

# 克隆项目
git clone https://github.com/linview/sandbox_agent.git
cd sandbox_agent/mcp/web_tool

# 安装依赖
pip install -e .

从PyPI安装(发布后)

pip install web-tool-mcp-server

使用方法

命令行使用

# 直接运行
python -m web_tool.server

# 或使用安装的命令
web-tool-server

在Cursor中配置

在Cursor的MCP配置文件中添加:

{
  "web-tools": {
    "command": "python",
    "args": ["-m", "web_tool.server"]
  }
}

或者如果通过pip安装:

{
  "web-tools": {
    "command": "web-tool-server"
  }
}

可用工具

1. get_web_page

获取网页内容

参数:

  • url (str): 要获取的网页URL

返回:

  • 网页的标题和文本内容

示例:

result = get_web_page("https://example.com")

2. search_web_content

在网页内容中搜索关键词

参数:

  • url (str): 要搜索的网页URL
  • search_term (str): 搜索关键词

返回:

  • 包含关键词的上下文内容

示例:

result = search_web_content("https://example.com", "python")

开发

项目结构

web_tool/
├── src/
│   └── web_tool/
│       ├── __init__.py
│       └── server.py
├── setup.py
├── pyproject.toml
└── README.md

本地开发

# 安装开发依赖
pip install -e .

# 运行测试
python -m web_tool.server

# 构建包
python -m build

# 检查包
twine check dist/*

依赖

  • fastmcp >= 1.0.0
  • pydantic >= 2.0.0
  • requests >= 2.28.0
  • beautifulsoup4 >= 4.11.0

许可证

MIT License

作者

linview (linview@gmail.com)

Metadata

Release files for web-tool-mcp-server 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for web-tool-mcp-server 0.0.2
File Size Uploaded Provenance
web_tool_mcp_server-0.0.2.tar.gz 4.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for web-tool-mcp-server 0.0.2
File Interpreter ABI Platform
web_tool_mcp_server-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 kB

Release files / web_tool_mcp_server-0.0.2.tar.gz

Download URL web_tool_mcp_server-0.0.2.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
06df2a24fa6de608246e7f366de123c4abfdb86e8ad1678f71ed4cf29d7f2720
BLAKE2b-256 checksum
How to use checksums
310e2bf23ad656b61cbd4422df4af869e47503fad84ab08e3780b8c08959f745
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release files / web_tool_mcp_server-0.0.2-py3-none-any.whl

Download URL web_tool_mcp_server-0.0.2-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
418b78d47ffb6b6b09abe41b3dd86a903fa86b98813adf0612570a906a059359
BLAKE2b-256 checksum
How to use checksums
59d9618f80b070527f6a32f50c84b73255920eb1255e3911dcbbba7b35c29028
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Security for web-tool-mcp-server 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page