npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@osiris-ai/redis-sdk

v0.1.1

Published

Osiris Redis SDK

Readme

@osiris-ai/redis-sdk

Redis database adapter for Osiris MCP authentication and session data storage with high-performance caching.

npm version License: MIT

Overview

The Redis SDK provides high-performance in-memory database storage for the Osiris ecosystem. Store MCP authentication data, user sessions, and tokens with automatic expiration and optimized Redis operations.

Key Features:

  • High Performance - In-memory storage with sub-millisecond response times
  • 🔄 Auto Expiration - Optional TTL for automatic data cleanup
  • 📊 Pipeline Operations - Optimized batch operations for better performance
  • 🔑 Key Organization - Structured key prefixing for data organization
  • 📝 Full TypeScript - Complete type safety and IDE support
  • 🛡️ Production Ready - Connection pooling and error handling

Installation

npm install @osiris-ai/redis-sdk ioredis
npm install --save-dev @types/redis

Quick Start

Basic Redis Setup

import { createMcpServer } from '@osiris-ai/sdk';
import { RedisDatabaseAdapter } from '@osiris-ai/redis-sdk';

const redisAdapter = new RedisDatabaseAdapter({
  host: 'localhost',
  port: 6379,
  keyPrefix: 'osiris:',
  // Optional: database number
  db: 0
}, 3600); // Optional: TTL in seconds

await createMcpServer({
  name: 'my-mcp',
  version: '1.0.0',
  auth: {
    useHub: true,
    hubConfig: {
      baseUrl: process.env.HUB_BASE_URL!,
      clientId: process.env.OAUTH_CLIENT_ID!,
      clientSecret: process.env.OAUTH_CLIENT_SECRET!,
    },
    database: redisAdapter
  },
  configure: (server) => {
    // Your MCP tools here
  }
});

Key Structure

The adapter organizes data with structured key prefixes:

osiris:auth:{id}                    // Authentication records
osiris:auth:connection:{service}:{connectionId}  // Service lookups
osiris:connection:auths:{connectionId}           // Connection auth sets
osiris:session:{id}                 // Session records
osiris:connection:{id}              // Connection records
osiris:package:connections:{packageId}          // Package connection sets
osiris:secret:{id}                  // Secret records
osiris:token:{deploymentId}:{service}           // Legacy tokens

API Reference

RedisDatabaseAdapter

High-performance Redis adapter implementing the Osiris DatabaseAdapter interface.

class RedisDatabaseAdapter implements DatabaseAdapter

Constructor

new RedisDatabaseAdapter(config: RedisOptions, ttl?: number)

Parameters:

  • config: Redis connection configuration
  • ttl: Optional time-to-live in seconds for automatic expiration

Configuration Options

interface RedisOptions {
  host?: string;          // Redis host (default: localhost)
  port?: number;          // Redis port (default: 6379)
  password?: string;      // Authentication password
  db?: number;            // Database number (default: 0)
  keyPrefix?: string;     // Key prefix (default: 'legion:')
  connectTimeout?: number; // Connection timeout
  lazyConnect?: boolean;  // Lazy connection
  tls?: any;             // TLS configuration
}

Core Methods

// Authentication management
await adapter.storeAuthentication(auth);
await adapter.getAuthentication(connectionId, service);
await adapter.updateAuthentication(id, updates);

// Session management with auto-expiration
await adapter.storeSession(session);
await adapter.getSession(sessionId);

// Connection management
await adapter.storeConnection(connection);
await adapter.getConnectionsForPackage(packageId);

Usage Examples

Environment Configuration

# .env file
REDIS_URL=redis://localhost:6379
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=your-password

# For production
REDIS_URL=redis://user:[email protected]:6379
REDIS_TTL=3600

Getting Started

  1. Install Redis:

    # macOS
    brew install redis
    brew services start redis
       
    # Ubuntu/Debian
    sudo apt-get install redis-server
       
    # Or use managed service (AWS ElastiCache, Railway, Upstash)
  2. Install the adapter:

    npm install @osiris-ai/redis-sdk ioredis
  3. Configure your MCP:

    import { RedisDatabaseAdapter } from '@osiris-ai/redis-sdk';
       
    const adapter = new RedisDatabaseAdapter({
      host: 'localhost',
      port: 6379,
      keyPrefix: 'my-app:'
    });

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Support

License

MIT License - see LICENSE file for details.


Built with ❤️ by the Osiris Labs team.