Skip to main content

mcs-types-cache

Shared cache types for the Model Context Standard (MCS).

Contains CachePort (the protocol any cache backend must satisfy) and FileCacheStore (the default file-based implementation).

This package has zero dependencies. It exists so that credential providers, drivers, and other MCS components can persist state across process invocations without coupling to a specific storage backend.

Installation

pip install mcs-types-cache

Most users don't need to install this directly -- it's pulled in automatically by mcs-auth and other packages that use caching.

Usage

from mcs.types.cache import CachePort, FileCacheStore

# File-based cache (default)
cache = FileCacheStore(".mcs_token_cache")
cache.write("my_key", "my_value")
assert cache.read("my_key") == "my_value"
cache.delete("my_key")
assert cache.read("my_key") is None

Custom backends implement CachePort:

class RedisCacheStore:
    def read(self, key: str) -> str | None: ...
    def write(self, key: str, value: str) -> None: ...
    def delete(self, key: str) -> None: ...

Links

License

Apache-2.0

Metadata

Release files for mcs-types-cache 0.1.1

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

Source distribution (sdist)

Source distribution for mcs-types-cache 0.1.1
File Size Uploaded
mcs_types_cache-0.1.1.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcs-types-cache 0.1.1
File Interpreter ABI Platform
mcs_types_cache-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.4 kB

Release files / mcs_types_cache-0.1.1.tar.gz

Download URL mcs_types_cache-0.1.1.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e11a6d0d87e71cf7674a753e2ca7fb81d0893719156d1c5be501ab73b4010f0d
BLAKE2b-256 checksum
How to use checksums
d16e03a6a02bd0fc9ed2a623f2123cf1fcfce38dfc8b1fc5e7c006cafc1a1101
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Release files / mcs_types_cache-0.1.1-py3-none-any.whl

Download URL mcs_types_cache-0.1.1-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4f8f08a9f36e843b5aa9ef2d1f28d410635514f5c56b76d43a0d5e748377bd5
BLAKE2b-256 checksum
How to use checksums
8f4e01a232d4779ead84773528eb10c7366d09989b610aba8ecabd0362b255ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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