Skip to main content

Web search (SearXNG) and fetch tools with MCP server

Project description

pvl-webtools

Web search (via SearXNG) and fetch tools with MCP server.

Documentation

Installation

pip install pvl-webtools

# With MCP server support
pip install pvl-webtools[mcp]

# With markitdown for LLM-friendly markdown output (recommended)
pip install pvl-webtools[markdown]

# With trafilatura for article text extraction
pip install pvl-webtools[extraction]

# Everything
pip install pvl-webtools[all]

Usage

Direct Usage

import asyncio
from pvlwebtools import web_search, web_fetch

async def main():
    # Search (requires SEARXNG_URL env var)
    results = await web_search("python async best practices", max_results=5)
    for r in results:
        print(f"{r.title}: {r.url}")

    # Fetch and extract article
    page = await web_fetch("https://example.com/article")
    print(page.content)

asyncio.run(main())

With SearXNG Client

from pvlwebtools import SearXNGClient

client = SearXNGClient(url="http://localhost:8888")
if client.check_health():
    results = await client.search("query", domain_filter="wikipedia.org")

As MCP Server

# Set SearXNG URL
export SEARXNG_URL="http://localhost:8888"

# Optional: enable verbose logging (sent to stderr)
export VERBOSE=1

# Run server
uvx pvl-webtools-mcp

Docker (Streamable HTTP)

# Pull and run
docker run -d -p 8000:8000 \
  -e SEARXNG_URL="http://your-searxng:8888" \
  ghcr.io/pvliesdonk/pvl-webtools:latest

# MCP endpoint available at http://localhost:8000/mcp

See Docker Deployment for full documentation.

Configuration

Environment Variable Description
SEARXNG_URL SearXNG instance URL (required for web_search)
LOG_LEVEL Optional logging level for the MCP server (DEBUG, INFO, etc.). Logs are emitted on stderr so stdio transport stays valid.
VERBOSE Convenience flag; set to 1/true to enable debug logging without specifying a level.

Legacy aliases PVL_MCP_LOG_LEVEL and PVL_MCP_VERBOSE are still accepted for backward compatibility.

Tools

web_search

Search the web via SearXNG metasearch engine.

  • query: Search query
  • max_results: 1-20 (default 5)
  • domain_filter: Limit to domain (e.g., "wikipedia.org")
  • recency: "all_time", "day", "week", "month", "year"

web_fetch

Fetch and extract content from URLs.

  • url: URL to fetch
  • extract_mode:
    • "markdown" (default): LLM-friendly markdown via markitdown
    • "article": Plain text via trafilatura
    • "raw": Raw HTML (truncated)
    • "metadata": Title, description, Open Graph tags

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pvl_webtools-1.0.0.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pvl_webtools-1.0.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file pvl_webtools-1.0.0.tar.gz.

File metadata

  • Download URL: pvl_webtools-1.0.0.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pvl_webtools-1.0.0.tar.gz
Algorithm Hash digest
SHA256 20a63bda7f1b84118037ee24cb2a2b59409456dd2a983cd5779e4c8345b1dde9
MD5 f84942586239dc6aa6ed846f83e3c7be
BLAKE2b-256 1c703fd1c6b2906e9a903a7144dc2f9544899fb5ad0f41337811f8e5137451a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pvl_webtools-1.0.0.tar.gz:

Publisher: release.yml on pvliesdonk/pvl-webtools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pvl_webtools-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pvl_webtools-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pvl_webtools-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 166de2c38575276b2403321ea0277890e7c4489cfd1ddeb61fa60366675fcea3
MD5 f57693fbb437a786c9e6346502e297fb
BLAKE2b-256 34fef804aff7c687ea30a449ec5262df1dc2e9353f60979f78edbc128ab508b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pvl_webtools-1.0.0-py3-none-any.whl:

Publisher: release.yml on pvliesdonk/pvl-webtools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page