Skip to main content

Shared cache types (CachePort, FileCacheStore) for the Model Context Standard.

Project description

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

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

mcs_types_cache-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

mcs_types_cache-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file mcs_types_cache-0.1.0.tar.gz.

File metadata

  • Download URL: mcs_types_cache-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for mcs_types_cache-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f905bf88c9944458de904bf131f1a9c3ec350c285e39a30c8ebe15655ad503d3
MD5 7c75184e0ec5d4a135cdc1ca716c5c35
BLAKE2b-256 88021e13cefea354080dcc91d86d9abe06825db1cfa29fb20c941e92a3d441bb

See more details on using hashes here.

File details

Details for the file mcs_types_cache-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcs_types_cache-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2502d8b21d1a43165ed1f4262e9821966e3136a7ff003441d4fec9a4755bf437
MD5 9fff37422948b7c83ea4e32c9a0a83de
BLAKE2b-256 ef6e91284eae603a7589e858a80ca31bb650a5b6d8bd7930288bbd8389c059a3

See more details on using hashes here.

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