Getting started
Installation
Prerequisites: Python 3.10 or later, uv, Access to a Valkey datastore
Configure your MCP client: Add the following to your MCP client configuration:
{ "mcpServers": { "valkey": { "command": "uvx", "args": ["awslabs.valkey-mcp-server@latest"], "env": { "VALKEY_HOST": "<your-endpoint>", "VALKEY_USE_SSL": "true" } } } }
Replace <your-endpoint> with the endpoint of your Valkey datastore. Your coding agent must have network access to the endpoint.
Connecting to Amazon ElastiCache: If your Valkey serverless cache has a public endpoint, use the public endpoint address as VALKEY_HOST. No tunnel is required. The connection requires TLS 1.3 and an IAM authentication token. For details on generating the token, see Connect to a cache with a public endpoint.
For all other ElastiCache for Valkey caches, you cannot reach the cache directly from your local machine. For SSM tunnel setup, IAM auth token generation, and TLS handling in tunnel mode, see the ElastiCache connection guideVALKEY_HOST=127.0.0.1 in the config above.
Restart your MCP client after saving the configuration.
You can prompt your agent to verify the connection with:
Use the Valkey MCP server to verify the connection to my datastore and confirm that Valkey operations are available.
Configuration
Configure the Valkey MCP server through environment variables in your MCP client configuration. You can also use the --readonly flag to restrict agent access to read-only operations.
| Variable | Purpose |
|---|---|
VALKEY_HOST |
Specifies the endpoint of your Valkey datastore. Use 127.0.0.1 when connecting to a private ElastiCache cluster through a tunnel. |
VALKEY_USE_SSL |
Set to true to enable TLS. This is required for ElastiCache clusters with encryption in transit enabled. |
--readonly |
Restricts the server to the read tier and disables all write and administrative tools, making it suitable for production exploration. |
| Optional Search Parameters | |
EMBEDDINGS_PROVIDER |
Selects the embedding provider used by add_documents and search. Supported options are bedrock, openai, ollama, and hash. Use hash for local testing without credentials. |
BEDROCK_MODEL_ID |
Overrides the default Amazon Bedrock embedding model. |
OPENAI_API_KEY |
Provides the API key required when EMBEDDING_PROVIDER is set to openai. |