mcp_server_webcrawl.utils package

Submodules

mcp_server_webcrawl.utils.blobs module

class ThumbnailManager[source]

Bases: object

Manages thumbnail generation and caching for image files and URLs.

__init__()[source]
get_thumbnails(paths)[source]

Convert URLs or file paths to base64 encoded strings.

Parameters:

paths (list[str]) – List of URLs or file paths to convert

Returns:

Dictionary mapping paths to their base64 representation or None if failed

Return type:

dict[str, str | None]

mcp_server_webcrawl.utils.cli module

get_help_short_message(version)[source]
Parameters:

version (str) –

Return type:

str

get_help_long_message(version)[source]
Parameters:

version (str) –

Return type:

str

mcp_server_webcrawl.utils.logger module

get_logger_configuration()[source]

Get log name, path, and level (in that order)

Returns:

A tuple containing name, path, and level

Return type:

tuple[str, Path, int]

get_logger()[source]

Get logger, usually in order to write to it

Returns:

a writable logging object (error/warn/info/debug)

Return type:

Logger

initialize_logger()[source]

Validate and set up logger for writing

Returns:

None

Return type:

None

mcp_server_webcrawl.utils.server module

initialize_mcp_server()[source]

MCP stdio streams require utf-8 explicitly set for Windows (default cp1252) or internationalized content will fail.

Return type:

None

mcp_server_webcrawl.utils.tools module

get_crawler_tools(sites=None)[source]

Generate crawler tools based on available sites.

Parameters:

sites (list[SiteResult] | None) – optional list of site results to include in tool descriptions

Returns:

List of Tool objects for sites and resources

Module contents

to_isoformat_zulu(dt)[source]

Convert datetime to iso Z.

python<=3.10 struggles with Z and fractions of seconds, will throw. smooth out the iso string, second precision isn’t key here

Parameters:

dt (datetime) –

from_isoformat_zulu(dt_string)[source]

Convert ISO string to datetime.

python<=3.10 struggles with Z and fractions of seconds, will throw. smooth out the iso string, second precision isn’t key here

Parameters:

dt_string (str | None) –

Return type:

datetime