# WeChat Mini-Program Cache Manager AI Agent Connect

> Deterministic WeChat Mini-Program storage and LRU cache eviction calculator.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_lm9vUcuKDhecyLm4mkmlXDI1NtnBppt1ISj6TJjc/ai-agent-connect
- **Tags:** wechat, cache, lru, storage, miniprogram

## Description

This MCP server provides deterministic tools for managing WeChat Mini-Program local storage. It helps developers ensure compliance with platform-specific limits (10240 KB or 20480 KB) by calculating available space and simulating Least Recently Used (LRU) eviction. Use `calculate_storage_status` to check if a new item fits, `simulate_lru_eviction` to identify which items to remove based on their `last_access_timestamp`, and `get_cache_inventory` to audit current cache contents.

## Tools

### get_cache_inventory
Provides a summary of the current cache contents to verify the state before performing calculations

### calculate_storage_status
Determines the current state of the cache and whether there is enough room to add a specific new item without triggering eviction

### simulate_lru_eviction
Calculates exactly which items must be removed to accommodate a new item using the LRU logic

## Prompt Examples

**Prompt:** 
```
Check if I can add a 500KB item to my cache which currently has 10000KB used out of 10240KB.
```

**Response:** 
```
No, the new item will exceed the limit. You need to evict items to free up at least 500KB.
```

**Prompt:** 
```
Show me the current cache inventory.
```

**Response:** 
```
The current cache contains 5 items with a total size of 8500 KB.
```

**Prompt:** 
```
Simulate eviction for a 2000KB item when the cache is at 10000/10240KB.
```

**Response:** 
```
To accommodate the 2000KB item, the system will evict 2 items, freeing 2100KB of space.
```

## Frequently Asked Questions

**How does the LRU eviction logic work?**
The system identifies items with the oldest `last_access_timestamp` and removes them sequentially until the new item fits within the specified `max_limit_kb`.

**What are the standard WeChat cache limits?**
Limits are typically 10240 KB for standard environments or 20480 KB for extended capacity environments.

**Can I use this with Claude Desktop?**
Yes, this MCP server can be connected to Claude Desktop, Cursor, VS Code, and any other MCP-compatible client via Vinkius Edge.
