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.1.tar.gz (7.8 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.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcs_types_cache-0.1.1.tar.gz
  • Upload date:
  • Size: 7.8 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.1.tar.gz
Algorithm Hash digest
SHA256 e11a6d0d87e71cf7674a753e2ca7fb81d0893719156d1c5be501ab73b4010f0d
MD5 90b330cdb86e2bd927012439d59b53df
BLAKE2b-256 d16e03a6a02bd0fc9ed2a623f2123cf1fcfce38dfc8b1fc5e7c006cafc1a1101

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcs_types_cache-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b4f8f08a9f36e843b5aa9ef2d1f28d410635514f5c56b76d43a0d5e748377bd5
MD5 17170bf0017eb7b76f95aeaaec5d9f26
BLAKE2b-256 8f4e01a232d4779ead84773528eb10c7366d09989b610aba8ecabd0362b255ee

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