Vercel KV
Vercel KV is an edge-compatible, REST-based key-value store that works seamlessly with Vercel deployments. FrontMCP supports Vercel KV as an alternative to standard Redis for session storage and caching.Zero Infrastructure
No Redis server to manage—Vercel handles everything
Edge Compatible
Works in Vercel Edge Functions and serverless environments
Auto-Configuration
Environment variables are set automatically when you connect a KV store
Drop-in Replacement
Switch from Redis with a single config change
When to Use Vercel KV
| Use Case | Vercel KV | Standard Redis |
|---|---|---|
| Vercel deployment | ✅ Recommended | ⚠️ Requires external service |
| Edge Functions | ✅ Native support | ❌ Not supported |
| Self-hosted | ❌ Vercel only | ✅ Full control |
| Pub/Sub needed | ❌ Not supported | ✅ Native support |
| Resource subscriptions | ❌ Requires Redis | ✅ Full support |
Quick Start
1
Create KV Store in Vercel
Go to your Vercel Dashboard → Storage → Create Database → KV
2
Connect to Project
Select your project and environment. Vercel automatically adds
KV_REST_API_URL and KV_REST_API_TOKEN to your environment.3
Configure FrontMCP
4
Deploy
Configuration
Basic Configuration
Full Configuration
Configuration Options
Selects Vercel KV as the storage provider.
The Vercel KV REST API URL. Automatically set when you connect a KV store to your Vercel project.
The Vercel KV REST API token. Automatically set when you connect a KV store to your Vercel project.
Prefix added to all keys. Useful for namespacing when sharing a KV store across multiple apps.
Default time-to-live in milliseconds for session data. Defaults to 1 hour.
Environment Variables
| Variable | Required | Description |
|---|---|---|
KV_REST_API_URL | Yes | REST API endpoint for your KV store |
KV_REST_API_TOKEN | Yes | Authentication token for your KV store |
Vercel Dashboard Setup
1
Navigate to Storage
In your Vercel Dashboard, click Storage in the top navigation.
2
Create KV Database
Click Create Database and select KV (Durable Redis).
3
Name Your Store
Choose a name like
frontmcp-sessions and select a region close to your deployment.4
Connect to Project
Select your FrontMCP project and choose which environments (Production, Preview, Development) should have access.
5
Verify Environment Variables
Go to your project Settings → Environment Variables to confirm
KV_REST_API_URL and KV_REST_API_TOKEN are set.Usage with CachePlugin
Vercel KV works seamlessly with the CachePlugin usingtype: 'global-store':
Comparison: Vercel KV vs Standard Redis
| Feature | Vercel KV | Standard Redis |
|---|---|---|
| Infrastructure | Managed by Vercel | Self-managed or cloud service |
| Edge Compatible | ✅ Yes | ❌ No |
| Serverless Friendly | ✅ Optimized | ⚠️ Connection overhead |
| Pub/Sub | ❌ Not available | ✅ Full support |
| Resource Subscriptions | ❌ Not supported | ✅ Full support |
| Latency | ~5-15ms (REST) | ~1-5ms (TCP) |
| Pricing | Pay per request | Pay for instance |
| Setup Complexity | Minimal | Moderate |
Limitations
- No Pub/Sub Support: Vercel KV is REST-based and does not support Redis pub/sub. If your app uses resource subscriptions, you’ll need standard Redis.
- Higher Latency: REST API calls have slightly higher latency than direct Redis TCP connections. For most use cases, this difference is negligible.
- Vercel-Only: Vercel KV only works in Vercel deployments. For other platforms, use standard Redis.
- Request-Based Pricing: Unlike Redis instances with flat pricing, Vercel KV charges per request. High-traffic apps should evaluate costs.
Hybrid Configuration: Vercel KV + Redis
Need resource subscriptions but still want Vercel KV’s edge compatibility for sessions? Use thepubsub option to configure Redis specifically for pub/sub features while keeping Vercel KV for everything else.
The
pubsub option only accepts Redis configuration—Vercel KV is not supported for pub/sub since it’s REST-based and doesn’t support the Redis pub/sub protocol.When to Use Hybrid Configuration
| Scenario | Configuration |
|---|---|
| Sessions only, no subscriptions | redis: { provider: 'vercel-kv' } |
| Full Redis features needed | redis: { host: '...' } |
| Edge sessions + Redis subscriptions | redis: { provider: 'vercel-kv' } + pubsub: { host: '...' } |
Recommended Redis Services for Pub/Sub
When using hybrid configuration, you need a Redis service for pub/sub:| Provider | Notes |
|---|---|
| Upstash | Serverless Redis, pairs well with Vercel |
| Redis Cloud | Managed Redis Enterprise |
| AWS ElastiCache | AWS-managed Redis |
Migration from Redis
Switching from standard Redis to Vercel KV requires only a configuration change:- Before (Redis)
- After (Vercel KV)
The
@vercel/kv package is an optional peer dependency. It’s only loaded when you use provider: 'vercel-kv', so it won’t affect bundle size for non-Vercel deployments.Troubleshooting
Error: Vercel KV requires url and token
Error: Vercel KV requires url and token
Cause: The
KV_REST_API_URL or KV_REST_API_TOKEN environment variables are not set.Solution:- Ensure you’ve created a KV store in the Vercal Dashboard
- Connect the KV store to your project
- Check that environment variables are set in Project Settings → Environment Variables
- If running locally, add variables to your
.envfile
Module not found: @vercel/kv
Module not found: @vercel/kv
Cause: The
@vercel/kv package is not installed.Solution:Sessions not persisting across requests
Sessions not persisting across requests
Cause: Each serverless invocation may create a new connection.Solution: This is expected behavior. Vercel KV handles connection pooling internally. Ensure your session store is properly configured and
defaultTtlMs is set appropriately.Resource subscriptions not working
Resource subscriptions not working
Cause: Vercel KV does not support Redis pub/sub, which is required for resource subscriptions.Solution: Use standard Redis for apps that require resource subscription functionality. Consider a managed Redis service like Upstash or Redis Cloud.

