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

flary

v0.2.13

Published

mixed assortment of tools for cloudflare workers

Readme

Flary

npm version license

A versatile toolkit for building and managing Cloudflare Workers applications, including AI integrations, project scaffolding, and component management.


Table of Contents


Prerequisites

Before you begin, ensure you have:

  1. Node.js 18.x or later installed
  2. A Cloudflare account
  3. Wrangler CLI installed and configured:
    npm install -g wrangler
    wrangler login

Installation

npm install flary

Features

  • 🚀 Project Scaffolding: Quickly set up modern Cloudflare Workers projects.
  • 🎨 Component Management: Import and organize components from v0.dev.
  • 🤖 AI Integration: Tools and utilities for AI applications.
  • 🔒 Secure MCP Integration: Model Context Protocol integration with robust authentication.

CLI Usage

Project Initialization

Create a new Flary project interactively:

flary init

This command will:

  • Prompt for your project name.
  • Allow template selection (e.g., Full-Stack React App).
  • Set up a complete project structure.
  • Configure dependencies and Wrangler automatically.

Follow the provided steps after creation:

  1. Navigate to your project:

    cd your-project-name
  2. Install dependencies:

    npm install
  3. Start development server:

    npm run dev

v0.dev Component Import

Import and organize components from v0.dev:

# Default directory (src/components)
flary v0 "https://v0.dev/chat/your-component-url"

# Custom directory
flary v0 --dir game-components "https://v0.dev/chat/your-component-url"

Options:

  • -d, --dir <directory>: Specify target subdirectory (relative to src/).
  • -h, --help: Display help information.

Deployment

Deploy your Flary application to Cloudflare Workers:

  1. Build your application:

    npm run build
  2. Deploy to Cloudflare Workers:

    npm run deploy
    # or directly with wrangler
    wrangler deploy

Your application will be deployed to https://<project-name>.<your-subdomain>.workers.dev

Environment Variables

Set environment variables for production:

# Set a secret
wrangler secret put MY_SECRET
# Set a variable in wrangler.toml
wrangler deploy --var MY_VAR=value

MCP Integration

Basic Usage

Initialize MCP instance and register tools:

import { z } from "zod";
import { MCP } from "flary";

const app = new MCP({
  name: "test-mcp",
  description: "A test MCP",
  version: "1.0.0",
});

const sumSchema = z
  .object({
    a: z.number().describe("The first number to add"),
    b: z.number().describe("The second number to add"),
  })
  .describe("Calculate the sum of two numbers");

async function calculateSum({ a, b }: z.input<typeof sumSchema>) {
  return a + b;
}
calculateSum.schema = sumSchema;

app.tool("calculate_sum", calculateSum);

export default app;
export const { McpObject } = app;

Authentication

Supports Bearer token authentication:

const app = new MCP({
  auth: {
    type: "bearer",
    token: "your-secret-token",
    validate: async (token) => token === (await getValidToken()),
  },
});

Connection Types

  • SSE (Server-Sent Events): Connect via / or /sse.
  • WebSockets: Connect via / or /ws.

Cursor Integration

Cursor uses SSE exclusively:

https://your-worker.workers.dev/?key=your-secret-token

No Authentication

Publicly accessible MCP server:

const app = new MCP({
  name: "test-mcp",
  description: "A test MCP",
  version: "1.0.0",
});

Durable Objects Setup

MCP requires Durable Objects for state management. Configure them in your wrangler.json:

{
  "durable_objects": {
    "bindings": [{ "name": "McpObject", "class_name": "McpObject" }]
  },
  "migrations": [{ "tag": "v1", "new_classes": ["McpObject"] }]
}

Make sure to export the McpObject from your worker entry point as shown in the Basic Usage example.


License

MIT © flary