Skip to content

MCP for building with Valkey GLIDE for nodejs - migrating from other clients, or build what you dream about with easy access to the API.

Notifications You must be signed in to change notification settings

avifenesh/valkey-glidejs-mcp

Repository files navigation

πŸš€ Valkey GLIDE MCP Server

npm version License: MIT Node.js

A streamlined Model Context Protocol (MCP) server for Valkey GLIDE - providing intelligent migration assistance, code generation, and complete API coverage for AI assistants.

✨ Smart Tool Architecture

πŸ”§ 4 Intelligent Tools

Tool Purpose Key Features
api API exploration & search Context-aware search, smart filtering
generate Code generation Pattern detection, parameter inference
migrate Migration engine Complexity assessment, automatic routing
system System utilities Health, validation, docs, debugging

🧠 Intelligent Features

  • Smart Parameter Detection: Tools automatically understand your intent
  • Context-Aware Routing: Responses adapt based on query complexity
  • Unified Interfaces: Consistent experience across all operations

✨ Features at a Glance

🎯 Complete API Coverage: 673 methods across all GLIDE-supported commands
πŸ”„ Smart Migration: 100% success rate on 65+ tested migration patterns
⚑ Comprehensive Commands: Support for 296 commands supported by GLIDE
πŸ—οΈ Intelligent Generation: Context-aware code templates for all use cases
βœ… Runtime Validated: All migrations tested against live Valkey instances
πŸ”§ Production Ready: Based on actual GitHub repositories, not toy examples 🧠 AI-Optimized: Streamlined tool interface reduces cognitive load

🎯 What This Tool Does

This MCP server transforms AI assistants (Claude, Continue, Cline, Zed, etc.) into Valkey GLIDE experts by providing:

  • πŸ”„ Universal Migration: Seamlessly convert any ioredis/node-redis code to GLIDE
  • πŸ—οΈ Smart Code Generation: Generate production-ready GLIDE code for any pattern
  • πŸ“š Complete API Knowledge: Instant access to all 673 GLIDE methods and their usage
  • 🎯 Pattern Recognition: Handle complex real-world scenarios (locks, rate limiting, pub/sub, transactions)
  • βœ… Validation Tools: Verify code correctness and API compliance

πŸš€ Quick Start

One-Command Installation

# Install globally (recommended)
npm install -g valkey-glidejs-mcp

# Or use with npx (no installation)
npx valkey-glidejs-mcp@latest

πŸ”§ Setup for AI Assistants

πŸ“± Claude Desktop / Claude Code

Option 1: Using Claude Code CLI (Recommended)

# Current published package has missing files - use local development method:
clone https://github.com/avifenesh/valkey-glidejs-mcp.git
cd valkey-glidejs-mcp
npm install
# Then use in Claude:
claude mcp add --scope user valkey-glide npx tsx /path/to/valkey-glidejs-mcp/src/server.ts

Alternative (once fixed package is published):

claude mcp add --scope user valkey-glidejs-mcp npx valkey-glidejs-mcp@latest

Option 2: Manual Configuration Add to your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Current Workaround (until package fix):

{
  "mcpServers": {
    "valkey-glide": {
      "command": "npx",
      "args": ["tsx", "/full/path/to/valkey-glidejs-mcp/src/server.ts"]
    }
  }
}

Future (once package is fixed):

{
  "mcpServers": {
    "valkey-glide": {
      "command": "npx",
      "args": ["valkey-glidejs-mcp@latest"]
    }
  }
}

Then restart Claude Desktop.

πŸ”Œ Other MCP-Compatible Tools

Configuration:

  • Command: npx or valkey-glidejs-mcp (if globally installed)
  • Args: ["valkey-glidejs-mcp@latest"] (only if using npx)
  • Transport: stdio

Supported Tools: Continue, Cline, Zed, and any MCP-compatible AI assistant

πŸ’¬ What You Can Ask

Describe what you need - the system automatically routes to the right functionality:

πŸ”„ Migration

"Migrate this ioredis code to GLIDE"
"Convert my node-redis app to use GLIDE"
"How do I migrate Redis pipelines to GLIDE batch operations?"

πŸ—οΈ Code Generation

"Create a GLIDE client for my app"
"Generate a distributed lock with GLIDE"
"Build a rate limiter using GLIDE and streams"
"Show me pub/sub patterns with GLIDE"

πŸ“š API Documentation

"What GLIDE methods work with sorted sets?"
"How do I use GLIDE for geospatial operations?"
"Show me all available GLIDE string commands"
"Find GLIDE equivalent for ioredis.get()"

πŸ”§ System Operations

"Check server health"
"Validate this GLIDE code"
"Show documentation for caching patterns"
"Debug this Redis connection"

πŸ”§ Smart Tool Architecture

🧠 Intelligent Tool Consolidation

4 smart tools with context-aware routing for optimal AI agent experience:

Smart Tool Capabilities Intelligence Features
api Search, equivalents, categories, browsing β€’ Query complexity detection
β€’ Smart result filtering
β€’ Context-aware responses
generate Clients, patterns, applications, advanced β€’ Parameter inference
β€’ Pattern recognition
β€’ Complexity-based routing
migrate ioredis, node-redis transformations β€’ Source detection
β€’ Pattern analysis
β€’ Smart transformations
system Health, validation, docs, debugging β€’ Action inference
β€’ Error detection
β€’ Help routing

πŸ”„ Universal Migration Engine (migrate tool)

Complete Client Support: Handles both ioredis and node-redis with 65+ tested migration patterns

  • βœ… URL Parsing: Automatic redis:// and rediss:// URL handling with TLS/auth extraction
  • βœ… Smart Config Mapping: Intelligent conversion of connection options and retry strategies
  • βœ… Batch Processing: Converts deprecated pipelines to GLIDE Batch with non-atomic execution
  • βœ… Transaction Translation: Converts multi/exec to GLIDE Batch with atomic guarantees
  • βœ… Script Migration: Transforms redis.eval() to GLIDE Script objects with proper scoping
  • βœ… Pub/Sub Conversion: Complete event-driven pattern migration with examples
  • βœ… Native Operations: Direct mapping to GLIDE's native blocking and atomic operations

πŸ—οΈ Intelligent Code Generation (generate tool)

Production-Ready Templates for every Valkey use case:

  • Client Setup: Standalone, cluster, and advanced configurations
  • Data Structures: Strings, hashes, lists, sets, sorted sets, streams, geo, bitmaps, HyperLogLog, JSON
  • Advanced Patterns: Distributed locks, rate limiters, caching, pub/sub, transactions
  • Real-World Scenarios: Session management, job queues, idempotency, circuit breakers

πŸ“š Complete API Coverage (api tool)

673 Methods with comprehensive documentation:

  • πŸ” Smart Search: Find any method by name, category, or functionality
  • πŸ“‹ Category Browsing: Organized by command families (strings, lists, sets, etc.)
  • πŸ“– Detailed Docs: Usage examples, parameters, and return types for every method
  • βœ… Validation Tools: Verify API usage and code correctness

πŸ”§ System Utilities (system tool)

Unified Management: Health, validation, documentation, and debugging

  • ❀️ Health Monitoring: Server status and performance metrics
  • πŸ” Code Validation: Static analysis and GLIDE compliance checking
  • πŸ“– Documentation: Context-aware help and examples
  • πŸ› Debugging: Parameter validation and error diagnosis

πŸƒβ€β™‚οΈ Quick Example

import { GlideClient } from "@valkey/valkey-glide";

// Create client with smart configuration
const client = await GlideClient.createClient({
  addresses: [{ host: "localhost", port: 6379 }],
  // GLIDE automatically handles retries and optimization
});

// All operations are fully typed and validated
await client.set("user:1001", JSON.stringify({ name: "Alice", age: 30 }));
const userData = await client.get("user:1001");

// Advanced operations work seamlessly
await client.zadd("leaderboard", { alice: 95, bob: 87, charlie: 92 });
// Retrieve top 3 scores in reverse order using a range-by-index query
const topPlayers = await client.zrange(
  "leaderboard",
  { start: 0, end: 2, type: "byIndex" },
  { reverse: true },
);

// Clean shutdown
client.close();

πŸ“Š Performance & Quality Metrics

Metric Value Description
API Coverage 673 methods Complete GLIDE API surface
Command Support 296 commands GLIDE-supported commands
Migration Success 100% Tested on 65+ migration patterns
Test Coverage 65+ patterns Real GitHub repository code
Runtime Validation βœ… Live testing Against actual Valkey instances
Smart Tools 4 unified tools Context-aware routing

🎯 Key Differences from ioredis/node-redis

Aspect ioredis/node-redis GLIDE Migration Help
Geo Commands Arrays Maps βœ… Auto-converted
Scan Results Objects [cursor, keys[]] βœ… Format adjusted
Batching Pipeline chains Batch(false) βœ… Non-atomic exec
Transactions Multi/exec Batch(true) βœ… Atomic execution
Clustering Same client GlideClusterClient βœ… Auto-detected
Scripts Direct eval Script objects βœ… Properly scoped

πŸ’» Development & Contributing

Build from Source

# Clone and setup
git clone https://github.com/avifenesh/valkey-glidejs-mcp.git
cd valkey-glidejs-mcp
npm install
npm run build

# Run comprehensive tests (65+ migration patterns)
npm test

# Validate API mappings
npm run validate:glide

# Ingest latest command documentation
npm run ingest:commands

Contributing

We welcome contributions! See CONTRIBUTING.md for:

  • πŸ“ Commit message guidelines
  • πŸ”„ Development workflow
  • πŸ§ͺ Testing requirements
  • πŸ“š Documentation standards

πŸ“„ License & Links

License: MIT

Resources:


Made with ❀️ for the Valkey community

Empowering AI assistants with complete Valkey GLIDE knowledge

About

MCP for building with Valkey GLIDE for nodejs - migrating from other clients, or build what you dream about with easy access to the API.

Resources

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 5