Memory Cache MCP Server
The Memory Cache MCP Server is a Model Context Protocol server that reduces token consumption by efficiently caching data between language model interactions.
Key capabilities:
Store data in the cache using unique keys, with optional time-to-live (TTL)
Retrieve previously cached data by its key
Clear specific cache entries or the entire cache
Monitor performance through cache statistics (hit/miss rates)
Automatically cache frequently accessed data like file content and computation results
Manage cache entries based on maximum entries and memory usage limits
Configure via
config.jsonor environment variablesIntegrate with any MCP client for automatic operation
Enhances interactions with Git repositories by caching repository content, file listings, and query results to reduce token consumption during version control operations.
Reduces token usage when interacting with GitHub repositories by caching repository content, issue details, PR information, and other GitHub-related data.
Improves efficiency when working with NPM packages and dependencies by caching package information, dependency trees, and installation results.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Memory Cache MCP Servercache the results from my last data analysis for 24 hours"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 git@github.com:ibproduct/ib-mcp-cache-server
cd ib-mcp-cache-serverInstall dependencies:
npm installBuild the project:
npm run buildAdd 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
Related MCP server: MCP Memory Server
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.
Here are some examples of what gets cached:
1. File Content Caching
When reading a file multiple times:
First time: Full file content is read and cached
Subsequent times: Content is retrieved from cache instead of re-reading the file
Result: Fewer tokens used for repeated file operations
2. Computation Results
When performing calculations or analysis:
First time: Full computation is performed and results are cached
Subsequent times: Results are retrieved from cache if the input is the same
Result: Fewer tokens used for repeated computations
3. Frequently Accessed Data
When the same data is needed multiple times:
First time: Data is processed and cached
Subsequent times: Data is retrieved from cache until TTL expires
Result: Fewer tokens used for accessing the same information
Automatic Cache Management
The server automatically manages the caching process by:
Storing data when first encountered
Serving cached data when available
Removing old/unused data based on settings
Tracking effectiveness through statistics
Optimization Tips
1. Set Appropriate TTLs
Shorter for frequently changing data
Longer for static content
2. Adjust Memory Limits
Higher for more caching (more token savings)
Lower if memory usage is a concern
3. Monitor Cache Stats
High hit rate = good token savings
Low hit rate = adjust TTL or limits
Environment Variable Configuration
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:
Look for config.json in its directory
Apply any environment variable overrides
Use default values if neither is specified
Testing the Cache in Practice
To see the cache in action, try these scenarios:
File Reading Test
Read and analyze a large file
Ask the same question about the file again
The second response should be faster as the file content is cached
Data Analysis Test
Perform analysis on some data
Request the same analysis again
The second analysis should use cached results
Project Navigation Test
Explore a project's structure
Query the same files/directories again
Directory listings and file contents will be served from cache
The cache is working when you notice:
Faster responses for repeated operations
Consistent answers about unchanged content
No need to re-read files that haven't changed
Available Tools
4 toolsclear_cacheC
Clear specific or all cache entries
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Specific key to clear (optional - clears all if not provided) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden but provides minimal behavioral insight. It implies a destructive action ('clear') but doesn't disclose permanence, side effects (e.g., performance impact), permissions required, or error handling. For a mutation tool, this leaves critical gaps in understanding its behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero waste. It's front-loaded with the core action and scope, making it easy to parse quickly. No extraneous details or repetition are present.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a destructive tool with no annotations and no output schema, the description is incomplete. It lacks information on permissions, side effects, return values, or error cases. Given the complexity of cache operations and the absence of structured safety hints, more context is needed for safe and effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents the optional 'key' parameter. The description adds marginal value by implying the scope ('specific or all'), but doesn't explain key formats, validation, or default behavior beyond what's in the schema. Baseline 3 is appropriate given high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('clear') and resource ('cache entries'), specifying it can target 'specific or all' entries. It distinguishes from siblings like 'get_cache_stats' (read-only) and 'retrieve_data' (data access), but doesn't explicitly differentiate from 'store_data' (which might involve cache updates).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives is provided. The description doesn't mention prerequisites (e.g., admin rights), typical scenarios (e.g., after data updates), or when to avoid it (e.g., during high traffic). It merely states what it does without contextual usage advice.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_cache_statsC
Get cache statistics
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Get cache statistics' implies a read-only operation, but it doesn't specify what the statistics include, whether they're real-time or aggregated, if there are rate limits, or what permissions might be required. The description lacks details on return format, potential side effects, or error conditions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise ('Get cache statistics'), which could be efficient if it were more informative. However, it's under-specified rather than appropriately concise—it lacks necessary details about what statistics are retrieved. While it's front-loaded, it doesn't earn its place by adding sufficient value beyond the tool name.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete for a tool that likely returns complex statistical data. It doesn't explain what the cache statistics include, how they're formatted, or any behavioral nuances. For a tool with no structured metadata, the description should provide more context to help an agent understand its functionality and output.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter information, which is appropriate here. A baseline of 4 is applied for zero-parameter tools, as the description doesn't need to compensate for any gaps in schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Get cache statistics' is a tautology that essentially restates the tool name 'get_cache_stats' without adding meaningful specificity. It doesn't distinguish what kind of statistics are retrieved (e.g., hit rates, memory usage, entry counts) or how they differ from what might be available through sibling tools like retrieve_data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when it's appropriate to get cache statistics (e.g., for monitoring, debugging, or performance analysis) or how it relates to sibling tools like clear_cache, retrieve_data, or store_data. There's no indication of prerequisites or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
retrieve_dataC
Retrieve data from the cache
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Key of the cached data to retrieve |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It states the tool retrieves data, implying a read-only operation, but doesn't disclose behavioral traits like error handling (e.g., what happens if the key doesn't exist), performance aspects, or any side effects. The description is minimal and lacks critical operational details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with no wasted words, making it front-loaded and easy to parse. However, it's overly concise to the point of under-specification, which slightly reduces its effectiveness. Every word earns its place, but more detail could improve clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has no annotations and no output schema, the description is incomplete. It doesn't explain what the retrieved data looks like, potential return values, or error conditions. For a retrieval tool with one parameter, more context is needed to guide effective use, making this description inadequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with the 'key' parameter clearly documented. The description adds no additional meaning beyond the schema, such as examples of key formats or constraints. Since schema coverage is high, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the action ('retrieve') and resource ('data from the cache'), which is clear but basic. It doesn't distinguish this tool from its sibling 'get_cache_stats', which might also retrieve cache-related information. The purpose is understandable but lacks specificity about what type of data or scope is involved.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'store_data' or 'clear_cache'. It doesn't mention prerequisites, such as needing data to be cached first, or context for when retrieval is appropriate versus other cache operations. Usage is implied but not explicitly stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
store_dataC
Store data in the cache with optional TTL
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Unique identifier for the cached data | |
| value | Yes | Data to cache | |
| ttl | No | Time-to-live in seconds (optional) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'optional TTL' which hints at expiration behavior, but doesn't describe what happens when data is stored (e.g., overwrites existing keys, requires specific permissions, has size limits, or returns confirmation). For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with a single sentence that communicates the core purpose and one key feature (optional TTL). Every word earns its place with no redundancy or unnecessary elaboration. It's front-loaded with the main action and resource.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a mutation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what happens after storage (success/failure indicators), whether the operation is idempotent, what errors might occur, or how it interacts with sibling tools. The 100% schema coverage helps with parameters, but behavioral context is lacking.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds minimal value beyond the schema by mentioning 'optional TTL', but doesn't provide additional context about parameter usage, constraints, or best practices. This meets the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Store data') and target ('in the cache'), which is specific and unambiguous. It distinguishes from sibling tools like 'retrieve_data' (read vs. write) and 'clear_cache' (store vs. delete). However, it doesn't explicitly mention what type of cache or differentiate from 'get_cache_stats' beyond the basic verb distinction.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'retrieve_data' or 'clear_cache'. It mentions optional TTL but doesn't explain when TTL should be applied or any prerequisites for usage. There's no context about when this tool is appropriate versus other storage methods.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly distinct purpose: clear_cache removes entries, get_cache_stats provides metrics, retrieve_data fetches data, and store_data saves data. There is no overlap or ambiguity between these four operations.
The naming is mixed: clear_cache and get_cache_stats follow a verb_noun pattern, but retrieve_data and store_data use a verb_object pattern. While readable, this inconsistency in structure (cache vs. data as the object) deviates from a uniform convention.
With 4 tools, this is well-scoped for a memory cache server. It covers the essential operations (store, retrieve, clear, stats) without being overly sparse or bloated, making each tool necessary and focused.
The toolset covers core cache operations: storing, retrieving, clearing, and monitoring. A minor gap is the lack of an update or delete specific entry tool, but agents can work around this by using clear_cache for deletion and store_data for updates, so it's mostly complete.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
An MCP memory server. One memory your agents share — across models, devices and apps.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Related MCP Servers
- FlicenseBqualityDmaintenanceA Model Context Protocol (MCP) server that optimizes token usage by caching data during language model interactions, compatible with any language model and MCP client.42
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides knowledge graph-based persistent memory for LLMs, allowing them to store, retrieve, and reason about information across multiple conversations and sessions.973,6462MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides persistent memory and conversation continuity for Claude Desktop and Claude Code, allowing users to save and restore project context when threads hit token limits.MIT
- AlicenseAqualityCmaintenanceAn MCP server that helps AI agents reduce token usage by compressing, summarizing, and managing conversation/context data more efficiently.11MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ibproduct/ib-mcp-cache-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server