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 🙏

© 2026 – Pkg Stats / Ryan Hefner

serialdev-mcp

v1.2.8

Published

MCP server for SerialDev prompt session management

Readme

MCP System

A Model Context Protocol (MCP) system built with Next.js 14, Vercel Functions, and Firebase, featuring Google authentication, API key management, and lease management.

Features

  • Google Authentication: Secure user login with Google OAuth
  • API Key Authentication: Secure API key generation and management
  • Lease Management: Project-based lease acquisition and release
  • Prompt Sessions: Track and manage AI prompt sessions
  • Web Dashboard: Modern UI for managing API keys and projects
  • Automated Cleanup: Cron jobs for expired lease and session cleanup
  • Firebase Integration: Firestore for data persistence and user authentication

Architecture

``` /app /api /mcp/v1 # MCP API endpoints /auth # API key management /cron # Cleanup jobs /page.tsx # Dashboard (protected) /components /auth # Authentication components /dashboard # Dashboard UI components /lib /domain # Business logic services /middleware # Authentication middleware firebase-admin.ts # Firebase Admin SDK firebase-client.ts # Firebase Client SDK auth-context.tsx # Authentication context api-key.ts # API key utilities ```

API Endpoints

MCP Endpoints (require API key authentication)

  • POST /api/mcp/v1/create-prompt-session - Create prompt session and journal prompt
  • POST /api/mcp/v1/complete-prompt-session - Complete session and optionally journal response
  • POST /api/mcp/v1/abort-prompt-session - Abort session and journal abort event

Management Endpoints (require user authentication)

  • GET/POST /api/auth/api-keys - Manage API keys
  • PATCH/DELETE /api/auth/api-keys/[keyId] - Update/delete API key
  • GET/POST /api/auth/projects - Manage projects

Cron Jobs

  • /api/cron/sweep-expired - Clean up expired leases and sessions (every 2 minutes)
  • /api/cron/cleanup-journal - Clean up old journal entries (daily at 2 AM)

Setup

1. Firebase Setup

  1. Create Firebase Project

    • Go to Firebase Console
    • Create a new project
    • Enable Firestore Database
    • Enable Authentication with Google provider
  2. Get Firebase Configuration

    • Go to Project Settings → General
    • Copy the Firebase config object (for client-side)
    • Go to Project Settings → Service Accounts
    • Generate new private key (for server-side)
  3. Configure Google Authentication

    • Go to Authentication → Sign-in method
    • Enable Google provider
    • Add your domain to authorized domains

2. Environment Variables

```bash cp .env.example .env.local

Fill in all Firebase credentials and secrets

```

Required Environment Variables:

  • FIREBASE_PROJECT_ID - Your Firebase project ID
  • FIREBASE_CLIENT_EMAIL - Service account email
  • FIREBASE_PRIVATE_KEY - Service account private key
  • NEXT_PUBLIC_FIREBASE_API_KEY - Firebase web API key
  • NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN - Firebase auth domain
  • NEXT_PUBLIC_FIREBASE_PROJECT_ID - Firebase project ID (public)
  • NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET - Firebase storage bucket
  • NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID - Firebase messaging sender ID
  • NEXT_PUBLIC_FIREBASE_APP_ID - Firebase app ID
  • API_KEY_SALT - Random string for API key hashing
  • CRON_SECRET - Secret for cron job authentication

3. Install Dependencies

```bash npm install ```

4. Development

```bash npm run dev ```

Visit http://localhost:3000 and sign in with Google to access the dashboard.

5. Deploy to Vercel

  1. Connect your repository to Vercel
  2. Add all environment variables in Vercel dashboard
  3. Deploy

Usage

Accessing the Dashboard

  1. Visit your deployed URL or http://localhost:3000
  2. Click "Continue with Google" to sign in
  3. Access the dashboard to manage API keys and projects

Creating API Keys

  1. In the dashboard, go to the API Keys section
  2. Click "Create API Key"
  3. Enter a name for your key
  4. Save the generated key (shown only once)

Creating Projects

  1. In the dashboard, go to the Projects section
  2. Click "Create Project"
  3. Enter project name and description
  4. Configure lease policies as needed

Using the API

```bash

Acquire a lease

curl -X POST https://your-domain.com/api/mcp/v1/acquire-lease
-H "X-API-Key: sk_live_your_api_key"
-H "Content-Type: application/json"
-d '{"projectId": "your-project-id"}'

Create a prompt session (projectId optional when key is scoped to exactly one project)

curl -X POST https://your-domain.com/api/mcp/v1/create-prompt-session
-H "X-API-Key: sk_live_your_api_key"
-H "Content-Type: application/json"
-d '{"promptText": "Hello, world!"}' ```

Data Models

Users

  • Google OAuth profile information
  • API keys and projects ownership

Projects

  • Lease policies (TTL, grace periods)
  • Status tracking
  • User ownership

API Keys

  • Secure hash storage
  • Scope and project restrictions
  • Usage tracking
  • User ownership

Leases

  • Holder information
  • Expiration management
  • Status transitions

Prompt Sessions

  • Session lifecycle tracking
  • Actor attribution
  • LLM metadata

Security

  • Google OAuth for user authentication
  • API keys are hashed using SHA-256
  • User-based data isolation
  • Cron endpoints protected with bearer tokens
  • All MCP endpoints require valid API key authentication
  • Client-side route protection

Testing

Setup Sample Data

```bash npm run setup-sample-data ```

Test API Endpoints

```bash npm run test-api ```

License

MIT