MCP servers
The Model Context Protocol (MCP) lets AI tools call outside services. There are two kinds of MCP server you can use with KVNest:
- The KVNest MCP server, hosted by us: create instances, wait for them, get their connection URL, check metrics and delete them. Ask for "a Redis cache for this app" and the agent can do the whole setup.
- A Redis or Valkey MCP server, which runs on your machine: read and write keys in one of your instances, for debugging or exploring data.
The KVNest MCP server
It's a remote server at this address, using the Streamable HTTP transport:
https://kvnest.com/mcp1. Create an API token
The server knows who you are by a personal API token. In the dashboard, open API tokens and click New token. Pick an expiry, or none, and copy the token: it starts with kvn_ and is shown only once. The dialog also has the setup below with your token filled in. You can have up to 5 active tokens.
2. Add it to your AI tool
Replace kvn_YOUR_TOKEN with your token.
Claude Code
Run in your terminal. Add --scope user to use it in every project.
claude mcp add --transport http kvnest https://kvnest.com/mcp \ --header "Authorization: Bearer kvn_YOUR_TOKEN"Cursor
Add to ~/.cursor/mcp.json, or .cursor/mcp.json in a project.
{ "mcpServers": { "kvnest": { "url": "https://kvnest.com/mcp", "headers": { "Authorization": "Bearer kvn_YOUR_TOKEN" } } }}VS Code
Add to .vscode/mcp.json. VS Code asks for the token once and stores it securely.
{ "servers": { "kvnest": { "type": "http", "url": "https://kvnest.com/mcp", "headers": { "Authorization": "Bearer ${input:kvnest-token}" } } }, "inputs": [ { "type": "promptString", "id": "kvnest-token", "description": "KVNest API token", "password": true } ]}Claude Desktop
Add to claude_desktop_config.json (Settings › Developer › Edit config). It connects through mcp-remote, which needs Node.js.
{ "mcpServers": { "kvnest": { "command": "npx", "args": ["-y", "mcp-remote", "https://kvnest.com/mcp", "--header", "Authorization:${KVNEST_AUTH}"], "env": { "KVNEST_AUTH": "Bearer kvn_YOUR_TOKEN" } } }}Tools
Every tool acts only on the instances of the token's owner.
| Tool | What it does | Access |
|---|---|---|
list_plans | Plans with their memory, connection limit, persistence and price. | Read |
list_instances | Your instances with their status, plan and endpoint. | Read |
get_instance | One instance by ID or name, to wait for it to become Ready. | Read |
create_instance | A new Redis or Valkey instance (Valkey by default); Starter, the free plan, by default. Optionally with modules and an eviction policy. | Creates |
get_connection | Host, port, username, password and the rediss:// URL, as default or another user. | Read |
get_metrics | Memory, clients, operations per second, hit rate, keys, latency and evictions. | Read |
configure_instance | Turns the JSON, Bloom and Search modules (plus TimeSeries on Redis) on or off, or changes the eviction policy; restarts the instance. | Deletes |
create_user | A readonly or readwrite user, optionally limited to key patterns. | Creates |
set_allowed_sources | Replaces the IP addresses and ranges allowed to connect; empty allows any. | Deletes |
rotate_password | A new password for a user, with hours of grace for the old one. | Deletes |
delete_user | Deletes a user and disconnects its clients. | Deletes |
delete_instance | Deletes an instance and its data; needs its name typed again. | Deletes |
Things to ask
- "Create a free KVNest instance called my-app-cache and put its URL in .env as VALKEY_URL."
- "Which of my KVNest instances is closest to its memory limit?"
- "Add a Redis cache to this endpoint, using my KVNest instance."
Keep it safe
- A token can do anything with your instances that you can, including deleting them. It can't create other tokens or change your account.
delete_instanceis marked as destructive, so your AI tool should ask you first, and it only works when the agent types the instance's name again.get_connectionreturns the password. The server tells agents to put it in an environment variable or.envfile, but check that it doesn't end up in your code or a commit.- Give every tool or machine its own token with an expiry, and delete it from the API tokens page when you're done. The page shows when each token was last used.
Work with your data
To let an agent read and write keys, run a Redis or Valkey MCP server on your machine and point it at an instance. Both are open source and run with uv. Copy the host and password, or the whole URL, from the instance page in the dashboard.
Prefer a dedicated instance for this, never the only copy of important data, and use read-only mode when the agent only needs to look.
Redis MCP server
redis/mcp-redis has tools for strings, hashes, lists, sets, sorted sets, streams and pub/sub, and works with Redis and Valkey instances alike. Its search, vector and JSON tools need an instance with modules turned on. With Claude Code:
claude mcp add redis -- uvx --from redis-mcp-server@latest redis-mcp-server \ --url "rediss://default:<password>@inst-<id>.eu.kvnest.com:6380/0"For other tools, add it to their MCP configuration:
{ "mcpServers": { "redis": { "command": "uvx", "args": [ "--from", "redis-mcp-server@latest", "redis-mcp-server", "--url", "rediss://default:<password>@inst-<id>.eu.kvnest.com:6380/0" ] } }}Valkey MCP server
AWS Labs' Valkey MCP server sorts commands into read, write and admin tools; admin commands are off unless you enable them. --readonly also turns off writes; remove it to let the agent change data.
{ "mcpServers": { "valkey": { "command": "uvx", "args": ["awslabs.valkey-mcp-server@latest", "--readonly"], "env": { "VALKEY_HOST": "inst-<id>.eu.kvnest.com", "VALKEY_PORT": "6380", "VALKEY_USERNAME": "default", "VALKEY_PWD": "<password>", "VALKEY_USE_SSL": "true" } } }}Both connect over TLS to your instance's hostname, so the certificate checks out without extra settings. Run into trouble? See troubleshooting ; the same causes apply.
Prefer scripts to agents? The REST API takes the same tokens.