For the complete documentation index, see llms.txt. This page is also available as Markdown.

Registry Caching

mcpd includes a built-in caching system to improve performance when working with remote MCP server registries. The caching system stores registry manifests locally to avoid repeated network requests.

Cache Directory

All commands that access remote registries (add and search) support optional parameters to configure caching behavior.

You can specify the cache directory in multiple ways:

  • CLI flag: --cache-dir <path>

  • Default: ~/.cache/mcpd/registries/

XDG_CACHE_HOME environment variable

mcpd honors the XDG Base Directory Specification, respecting the XDG_CACHE_HOME environment variable. This forms the base directory where mcpd will create a cache folder for registry manifests.

Cache Time-to-Live (TTL)

You can configure how long cached registry manifests remain valid:

  • CLI flag: --cache-ttl <duration>

  • Default: 24h

The duration format accepts values like:

  • 1h (1 hour)

  • 30m (30 minutes)

  • 24h (24 hours)

  • 1h30m (1 hour 30 minutes)

Caching Control

Disabling Cache

To disable caching entirely and always fetch fresh data:

Refreshing Cache

To force refresh cached manifests (ignoring TTL):

Cache Behavior

When Caching is Enabled (Default)

  1. First Request: Downloads registry manifest from remote URL and stores it in the cache directory

  2. Subsequent Requests: Uses cached file if it exists and hasn't expired (based on TTL)

  3. Expired Cache: Automatically downloads fresh manifest when TTL expires

  4. Cache Miss: Falls back to remote URL if cache file is corrupted or missing

When Caching is Disabled

  1. No Directory Creation: Cache directory is never created on the filesystem

  2. Always Remote: All requests go directly to remote registry URLs

  3. No Storage: No files are written to disk

Cache File Naming

Cache files are stored using SHA-256 hashes of the registry URLs:

Examples

Basic Usage with Custom Cache Directory

Combining Cache Options

Common Issues

If registry results look stale, retry with --refresh-cache or bypass cache once with --no-cache.

If cache directory creation fails, ensure:

  • Parent directory is writable

  • Sufficient disk space is available

  • No conflicting file already exists at the cache path

For step-by-step diagnosis of registry lookup or cache problems, see Troubleshooting.

Last updated