Momento缓存
STDIOOfficial用于Momento缓存的MCP服务器实现
用于Momento缓存的MCP服务器实现
A simple Model Context Protocol (MCP) server implementation for Momento Cache.
Available on npmjs as @gomomento/mcp-momento
get
key string -- the key to look up in the cache.cacheName string -- the name cache where the key presides (optional)Hit with the found value if the key was found.Miss if the key was not found.Error if the request failed.set
key: string -- the key to set in the cachevalue: string -- the value to set for the given keyttl: integer -- the number of seconds to keep this value in the cache (optional)cacheName: string -- the name of the cache to store the key in (optional)Success if the key was successfully written to the cache.Error if the request failed.list-caches
Success with a comma separated list of cache namesError if the request failedcreate-cache
name: string - the name of the cache to createSuccess if the cache was successfully createdError if the request faileddelete-cache
name: string - the name of the cache to deleteSuccess if the cache was successfully deletedError if the request failedGet a Momento API key from the Momento Console. Note - to run control plane tools (list-caches, create-cache, delete-cache), you must use a super user API key.
Set environment variables to configure the cache name and Time To Live (TTL) for items in the cache.
# required export MOMENTO_API_KEY="your-api-key" # optional export MOMENTO_CACHE_NAME="your-cache-name" export DEFAULT_TTL_SECONDS=60
If you do not set these values, it will use mcp-momento as the cache name and 60 seconds for the default time to live.
npx -y @modelcontextprotocol/inspector npx @gomomento/mcp-momento@latest
Note: if you're using nodenv, replace the plain npx with the path to your npx binary (e.g. /Users/username/.nodenv/shims/npx).
{ "mcpServers": { "momento": { "command": "npx", "args": [ "-y", "@gomomento/mcp-momento" ], "env": { "MOMENTO_API_KEY": "your-api-key", "MOMENTO_CACHE_NAME": "your-cache-name", "DEFAULT_TTL_SECONDS": 60 } } } }
Install dependencies:
npm install
Build the server:
npm run build
Run with MCP Inspector
export MOMENTO_API_KEY="your-api-key" npx @modelcontextprotocol/inspector node dist/index.js