Amazon ElastiCache/MemoryDB Valkey MCP Server
An AWS Labs Model Context Protocol (MCP) server for Amazon ElastiCache Valkey datastores.
Features
This MCP server provides tools to operate on Valkey data types. For example, it allows an agent to operate with Valkey Strings using commands such as SET, SETRANGE, GET, GETRANGE, APPEND, INCREMENT and more.
Supported Data Types
Strings- Store, retrieve, append, increment, decrement, length and more.Lists- Manage List collections with push/pop operations.Sets and Sorted Sets- Store and retrieve items from Sets.Hashes- Store and retrieve items in Hashes. Check for existence of items in a hash, increment item values in a Hash, and more.Streams- Store, retrieve, trim items in Streams.Bitmaps- Bitmaps let you perform bitwise operations on strings.JSONs- Store and retrieve JSON documents with path-based access.HyperLogLog- Store and count items in HyperLogs.
Advanced Features
- Cluster Support: Support for standalone and clustered Valkey deployments.
- SSL/TLS Security: Configure secure connections using SSL/TLS.
- Connection Pooling: Pools connections by default to enable efficient connection management.
- Readonly Mode: Prevent write operations to ensure data safety.
Prerequisites
- Install
uvfrom Astral or the GitHub README - Install Python using
uv python install 3.10 - Access to a Valkey datastore.
- For instructions to connect to an Amazon ElastiCache/MemoryDB Valkey datastore click here.
Installation
| Kiro | Cursor | VS Code |
|---|---|---|
Here are some ways you can work with MCP across AWS tools (e.g., for Kiro, ~/.kiro/settings/mcp.json):
{
"mcpServers": {
"awslabs.valkey-mcp-server": {
"command": "uvx",
"args": [
"awslabs.valkey-mcp-server@latest"
],
"env": {
"VALKEY_HOST": "127.0.0.1",
"VALKEY_PORT": "6379",
"FASTMCP_LOG_LEVEL": "ERROR"
},
"autoApprove": [],
"disabled": false
}
}
}
To run in readonly mode:
{
"mcpServers": {
"awslabs.valkey-mcp-server": {
"command": "uvx",
"args": [
"awslabs.valkey-mcp-server@latest",
"--readonly"
],
"env": {
"VALKEY_HOST": "127.0.0.1",
"VALKEY_PORT": "6379",
"FASTMCP_LOG_LEVEL": "ERROR"
},
"autoApprove": [],
"disabled": false
}
}
}
Windows Installation
For Windows users, the MCP server configuration format is slightly different:
{
"mcpServers": {
"awslabs.valkey-mcp-server": {
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "uv",
"args": [
"tool",
"run",
"--from",
"awslabs.valkey-mcp-server@latest",
"awslabs.valkey-mcp-server.exe"
],
"env": {
"VALKEY_HOST": "127.0.0.1",
"VALKEY_PORT": "6379",
"FASTMCP_LOG_LEVEL": "ERROR"
},
}
}
}
To run in readonly mode:
{
"mcpServers": {
"awslabs.valkey-mcp-server": {
"command": "uvx",
"args": [
"tool",
"run",
"--from",
"awslabs.valkey-mcp-server@latest",
"awslabs.valkey-mcp-server.exe",
"--readonly"
],
"env": {
"VALKEY_HOST": "127.0.0.1",
"VALKEY_PORT": "6379",
"FASTMCP_LOG_LEVEL": "ERROR"
},
"autoApprove": [],
"disabled": false
}
}
}
Or using Docker after a successful docker build -t awslabs/valkey-mcp-server .:
{
"mcpServers": {
"awslabs.valkey-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"--interactive",
"--env",
"FASTMCP_LOG_LEVEL=ERROR",
"--env",
"VALKEY_HOST=127.0.0.1",
"--env",
"VALKEY_PORT=6379",
"awslabs/valkey-mcp-server:latest"
],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
To run in readonly mode with Docker:
{
"mcpServers": {
"awslabs.valkey-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"--interactive",
"--env",
"FASTMCP_LOG_LEVEL=ERROR",
"--env",
"VALKEY_HOST=127.0.0.1",
"--env",
"VALKEY_PORT=6379",
"awslabs/valkey-mcp-server:latest",
"--readonly"
],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
Configuration
The server can be configured using the following environment variables:
| Name | Description | Default Value |
|---|---|---|
VALKEY_HOST |
ElastiCache Primary Endpoint or MemoryDB Cluster Endpoint or Valkey IP or hostname | "127.0.0.1" |
VALKEY_PORT |
Valkey port | 6379 |
VALKEY_USERNAME |
Default database username | None |
VALKEY_PWD |
Default database password | "" |
VALKEY_USE_SSL |
Enables or disables SSL/TLS | False |
VALKEY_CA_PATH |
CA certificate for verifying server | None |
VALKEY_SSL_KEYFILE |
Client's private key file | None |
VALKEY_SSL_CERTFILE |
Client's certificate file | None |
VALKEY_CERT_REQS |
Server certificate verification | "required" |
VALKEY_CA_CERTS |
Path to trusted CA certificates | None |
VALKEY_CLUSTER_MODE |
Enable Valkey Cluster mode | False |
Example Usage
Here are some example natural language queries that the server can handle:
"Store user profile data in a hash"
"Add this event to the activity stream"
"Cache API response for 5 minutes"
"Store JSON document with nested fields"
"Add score 100 to user123 in leaderboard"
"Get all members of the admins set"
Development
Running Tests
uv venv
source .venv/bin/activate
uv sync
uv run --frozen pytest
Building Docker Image
docker build -t awslabs/valkey-mcp-server .
Running Docker Container
docker run -p 8080:8080 \
-e VALKEY_HOST=host.docker.internal \
-e VALKEY_PORT=6379 \
awslabs/valkey-mcp-server
To run in readonly mode:
docker run -p 8080:8080 \
-e VALKEY_HOST=host.docker.internal \
-e VALKEY_PORT=6379 \
awslabs/valkey-mcp-server --readonly
Metadata
Release files for awslabs.valkey-mcp-server 1.0.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| awslabs_valkey_mcp_server-1.0.18.tar.gz | 123.9 kB | With provenance | Details for awslabs_valkey_mcp_server-1.0.18.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| awslabs_valkey_mcp_server-1.0.18-py3-none-any.whl | Python 3 | none | any | Details for awslabs_valkey_mcp_server-1.0.18-py3-none-any.whl |
Total release size: 161.5 kB
Release files / awslabs_valkey_mcp_server-1.0.18.tar.gz
| Download URL | awslabs_valkey_mcp_server-1.0.18.tar.gz |
|---|---|
| Size | 123.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ce8e078aef39c17c0e72e12f3a009f14f8bd9ff4e297bb82abebf5e6bbd9f6d
|
|
BLAKE2b-256 checksum How to use checksums |
88b0d1afb44f429f330b39bf3ce941d2b64faa1eced1f373fdf087f9983d93e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 9, 2026.
Transparency logRelease files / awslabs_valkey_mcp_server-1.0.18-py3-none-any.whl
| Download URL | awslabs_valkey_mcp_server-1.0.18-py3-none-any.whl |
|---|---|
| Size | 37.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1569f639c6a39b4b70bfa77b13b8917064e2d5e35d9b89f7571c7580cfb96a8e
|
|
BLAKE2b-256 checksum How to use checksums |
d6748794d851258d2f62c715b27e580b404ddf6a8728b6a5171135281aa8dcef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 9, 2026.
Transparency logSecurity for awslabs.valkey-mcp-server 1.0.18
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for awslabs_valkey_mcp_server-1.0.18.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 9, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.