Momento MCP Server for Scalable Low Latency Caching
Boost app performance and cut costs with the Momento MCP server for scalable, low-latency caching that handles load at any scale.
npx -y @momentohq/mcp-momentoOverview
The Momento MCP Server is a lightweight Model Context Protocol (MCP) server implementation that connects MCP-aware tools (like MCP Inspector or LLM apps) to Momento Cache. It exposes a small set of cache and control-plane operations (get, set, list-caches, create-cache, delete-cache) so applications and developer tools can store and retrieve context quickly during model interactions.
Designed for simplicity and low latency, this server is distributed as an npm package (@gomomento/mcp-momento) and can be run directly with npx or embedded into local development workflows. It is useful when you need a minimal, standards-compatible cache endpoint backed by Momento that can handle high-throughput read/write patterns typical of model context usage.
Features
- Minimal MCP server implementing cache read/write and basic cache management operations
- Backed by Momento Cache for low-latency, in-memory storage
- Supports configurable default TTL (time-to-live) for cached items
- Control-plane operations to list, create, and delete caches (requires super user API key)
- Quickstart-ready via npx; easy to integrate with MCP Inspector and local tools
- Simple environment configuration for cache name and credentials
Installation / Configuration
Install the package with npm or invoke it directly with npx.
Install locally:
Run via npx (recommended for quick runs):
Environment variables
# required
# optional (defaults shown)
# default: mcp-momento
# default: 60 seconds
Notes:
- To run control-plane operations (list-caches, create-cache, delete-cache) you must use a super user Momento API key from the Momento Console.
- The server reads MOMENTO_API_KEY at startup to authenticate to the Momento service.
Available Tools
The server exposes the following MCP tools (operations). Inputs and typical return shapes are summarized below.
| Tool | Inputs | Returns |
|---|---|---|
| get | key (string), cacheName (string, optional) | Hit (value) / Miss / Error |
| set | key (string), value (string), ttl (int, optional), cacheName (string, optional) | Success / Error |
| list-caches | — | Success (comma-separated cache names) / Error |
| create-cache | name (string) | Success / Error |
| delete-cache | name (string) | Success / Error |
Example: get a key
Example: set a value with TTL
Usage with MCP Inspector or NPX
Run with MCP Inspector:
# using the MCP Inspector to run the server
Example NPX integration (e.g., Claude Desktop mcpServers config)
Local Development
Steps to run and modify the server locally:
- Clone the repository: git clone https://github.com/momentohq/mcp-momento
- Install dependencies:
- Build:
- Run with MCP Inspector:
Use Cases
- LLM conversation state: persist recent messages or dialogue state between model requests to keep context small and fast to access.
- Shared ephemeral state: cache intermediate computations, embeddings, or retrieval results for repeated model queries.
- Tooling and debugging: use MCP Inspector with this server to inspect cache behavior, validate TTLs, and prototype cache-backed model flows.
- Dynamic cache management: create or delete caches programmatically from tools or CI (requires a super user API key), useful for test isolation or automated workspace setup.
Concrete example — session cache for an assistant:
- On user message, call set with key “session:{sessionId}” and store serialized context with TTL 600.
- On subsequent requests, call get to retrieve the session context and append recent messages as model context.
- If you need to reset a session, call delete-cache (or set an empty value) as part of session teardown.
Links & Resources
- GitHub: https://github.com/momentohq/mcp-momento
- npm package: https://www.npmjs.com/package/@gomomento/mcp-momento
- Momento Console (to create API keys): https://console.gomomento.com/
- MCP Inspector: https://www.npmjs.com/package/@modelcontextprotocol/inspector
This MCP server is intended as a compact, easy-to-run bridge between MCP-compatible clients and Momento Cache, enabling low-latency caching patterns for model-driven applications.