
Memory Cache Server for use with supported MCP API Clients.
概览
A Model Context Protocol (MCP) server that reduces token consumption by efficiently caching data between language model interactions. Works with any MCP client and any language model that uses tokens. 5. The server will automatically start when you use your MCP client When the server is running properly, you'll see: 1. A message in the terminal: "Memory Cache MCP server running on stdio" 2. Improved performance when accessing the same data multiple times 3. No action required from you - the caching happens automatically You can verify the server is running by: 1. Opening your MCP client 2. Looking for any error messages in the terminal where you started the server 3. Performing operations that would benefit from caching (like reading the same file multiple times) The server can be configured through config.json or environment variables: 1.
README
以下为原文 README 节选,完整内容请查看原文。
Memory Cache Server
A Model Context Protocol (MCP) server that reduces token consumption by efficiently caching data between language model interactions. Works with any MCP client and any language model that uses tokens.
Installation
- Clone the repository:
git clone [email protected]:ibproduct/ib-mcp-cache-server
cd ib-mcp-cache-server
- Install dependencies:
npm install
- Build the project:
npm run build
- Add to your MCP client settings:
{
"mcpServers": {
"memory-cache": {
"command": "node",
"args": ["/path/to/ib-mcp-cache-server/build/index.js"]
}
}
}
- The server will automatically start when you use your MCP client
Verifying It Works
When the server is running properly, you’ll see:
- A message in the terminal: “Memory Cache MCP server running on stdio”
- Improved performance when accessing the same data multiple times
- No action required from you - the caching happens automatically
You can verify the server is running by:
- Opening your MCP client
- Looking for any error messages in the terminal where you started the server
- Performing operations that would benefit from caching (like reading the same file multiple times)
Configuration
The server can be configured through config.json or environment variables:
{
"maxEntries": 1000, // Maximum number of items in cache
"maxMemory": 104857600, // Maximum memory usage in bytes (100MB)
"defaultTTL": 3600, // Default time-to-live in seconds (1 hour)
"checkInterval": 60000, // Cleanup interval in milliseconds (1 minute)
"statsInterval": 30000 // Stats update interval in milliseconds (30 seconds)
}
Configuration Settings Explained
-
maxEntries (default: 1000)
- Maximum number of items that can be stored in cache
- Prevents cache from growing indefinitely
- When exceeded, oldest unused items are removed first
-
maxMemory (default: 100MB)
- Maximum memory usage in bytes
- Prevents excessive memory consumption
- When exceeded, least recently used items are removed
-
defaultTTL (default: 1 hour)
- How long items stay in cache by default
- Items are automatically removed after this time
- Prevents stale data from consuming memory
-
checkInterval (default: 1 minute)
- How often the server checks for expired items
- Lower values keep memory usage more accurate
- Higher values reduce CPU usage
-
statsInterval (default: 30 seconds)
- How often cache statistics are updated
- Affects accuracy of hit/miss rates
- Helps monitor cache effectiveness
How It Reduces Token Consumption
The memory cache server reduces token consumption by automatically storing data that would otherwise need to be re-sent between you and the language model. You don’t need to do anything special - the caching happens automatically when you interact with any language model through your MCP client.
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"memory-cache": {
"command": "node",
"args": ["/path/to/ib-mcp-cache-server/build/index.js"]
}
}
}