IntelligenceBank Product/ib-mcp-cache-server
Built by Metorial, the integration platform for agentic AI.
IntelligenceBank Product/ib-mcp-cache-server
Server Summary
Cache data between interactions
Retrieve frequently accessed data
Optimize resource usage
Enhance performance of language models
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.
git clone git@github.com:ibproduct/ib-mcp-cache-server
cd ib-mcp-cache-server
npm install
npm run build
{
"mcpServers": {
"memory-cache": {
"command": "node",
"args": ["/path/to/ib-mcp-cache-server/build/index.js"]
}
}
}
When the server is running properly, you'll see:
You can verify the server is running by:
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)
}
maxEntries (default: 1000)
maxMemory (default: 100MB)
defaultTTL (default: 1 hour)
checkInterval (default: 1 minute)
statsInterval (default: 30 seconds)
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.
Here are some examples of what gets cached:
When reading a file multiple times:
When performing calculations or analysis:
When the same data is needed multiple times:
The server automatically manages the caching process by:
You can override config.json settings using environment variables in your MCP settings:
{
"mcpServers": {
"memory-cache": {
"command": "node",
"args": ["/path/to/build/index.js"],
"env": {
"MAX_ENTRIES": "5000",
"MAX_MEMORY": "209715200", // 200MB
"DEFAULT_TTL": "7200", // 2 hours
"CHECK_INTERVAL": "120000", // 2 minutes
"STATS_INTERVAL": "60000" // 1 minute
}
}
}
}
You can also specify a custom config file location:
{
"env": {
"CONFIG_PATH": "/path/to/your/config.json"
}
}
The server will:
To see the cache in action, try these scenarios:
File Reading Test
Data Analysis Test
Project Navigation Test
The cache is working when you notice: