Skip to main content

mcpwright-core

The shared runtime toolkit for the mcpwright suite of MCP servers. Not a server itself — a small library the suite's servers (edgar, census, soi, …) depend on so they don't each re-implement the same plumbing.

Status: extracted once three servers existed and the seams were clear ("wait for two, then DRY"). Composable pieces — import what you need; no server uses all of it.

What's in it

Import What it is
AsyncHttpClient Async httpx base: descriptive User-Agent, retry + exponential backoff on transient failures (429 / 5xx / network), optional throttling, and a streaming download_to(url, path) for large files. Subclass it and add your endpoint methods.
RateLimiter Serializes requests to a minimum spacing (RateLimiter.per_second(8)), for services with a fair-access policy like the SEC.
TTLCache In-memory cache with per-entry TTL + a byte budget (LRU eviction). For servers that make live calls; bulk-download servers don't need it.
READ_ONLY The ToolAnnotations(readOnlyHint=True, openWorldHint=True) every suite tool carries.
app_context(ctx, AppContext) Pulls the lifespan-managed app context out of an MCP request Context.
McpwrightError / HttpError The error hierarchy; each server's error type derives from these.

Usage

from mcpwright_core import AsyncHttpClient, RateLimiter, HttpError

class MyError(HttpError):
    pass

class MyClient(AsyncHttpClient):
    USER_AGENT = "my-mcp (https://github.com/mcpwright/my-mcp)"

    def __init__(self) -> None:
        super().__init__(error_cls=MyError, rate_limiter=RateLimiter.per_second(8))

    async def widget(self, widget_id: str) -> dict:
        return await self.get_json(f"https://api.example.com/widgets/{widget_id}")

Install

uv add mcpwright-core          # in a suite server's project

Servers pin a compatible range, e.g. mcpwright-core>=0.1,<0.2.

Develop

uv sync
uv run ruff check src/ && uv run ruff format --check src/
uv run mypy
uv run pytest

Built to the suite engineering standard: ruff + mypy (strict-ish) + pytest + pre-commit, CI on every PR, branch-protected main. Part of the mcpwright suite — built by Devender Gollapally.

Metadata

Release files for mcpwright-core 0.1.3

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

Source distribution (sdist)

Source distribution for mcpwright-core 0.1.3
File Size Uploaded Provenance Actions
mcpwright_core-0.1.3.tar.gz 11.0 kB Without provenance Details for mcpwright_core-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcpwright-core 0.1.3
File Interpreter ABI Platform Actions
mcpwright_core-0.1.3-py3-none-any.whl Python 3 none any Details for mcpwright_core-0.1.3-py3-none-any.whl

Total release size: 24.5 kB

Release files / mcpwright_core-0.1.3.tar.gz

Download URL mcpwright_core-0.1.3.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
06d6a6c903766151e6e670dee48e6eaa64fce5f9f4343de1cafa7faf31cd5eea
BLAKE2b-256 checksum
How to use checksums
b14fc126a5792b6d2b94963ace856fe7ce3e2c3e34bd48ef3638cebffa237fb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mcpwright_core-0.1.3-py3-none-any.whl

Download URL mcpwright_core-0.1.3-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a36cf6baaa257483cd85fc9e02abafa2b54c54411a93eac347b5dd48e2c0bde3
BLAKE2b-256 checksum
How to use checksums
f4547f5843c189acb41334809c5d89fd1dc087c87c29520b7e688d7875e77c35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for mcpwright-core 0.1.3

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.

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