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

@br1j/windsweeper-sdk

v0.1.0

Published

Node.js SDK for Windsweeper MCP

Readme

Windsweeper SDK for Node.js

This package provides a client for interacting with the Windsweeper MCP (Model Control Protocol) server. It allows you to validate rules and code, apply templates, generate content, and manage resources.

Installation

npm install windsweeper-sdk

Quick Start

import { createClient } from 'windsweeper-sdk';

// Create a client
const client = createClient({ 
  serverUrl: 'http://localhost:9001',
  apiKey: 'your-api-key' // Optional
});

// Check server health
const isHealthy = await client.checkHealth();
console.log(`Server is ${isHealthy ? 'healthy' : 'unhealthy'}`);

// List resources
const resources = await client.listResources('my-server');
console.log(`Found ${resources.resources.length} resources`);

// Validate a rule
const validationResult = await client.validateRule('your-rule-content');
if (validationResult.valid) {
  console.log('Rule is valid!');
} else {
  console.log('Rule validation failed:', validationResult.issues);
}

API Reference

createClient(options)

Creates a new Windsweeper client instance.

Parameters:

  • options - Configuration options
    • serverUrl - URL of the Windsweeper MCP server
    • apiKey - Optional API key for authentication
    • timeout - Request timeout in milliseconds (default: 30000)

Returns: A configured WindsweeperClient instance

Client Methods

checkHealth()

Checks if the server is healthy.

Returns: Promise<boolean> - True if the server is healthy

listResources(serverName, cursor?)

Lists resources from the MCP server.

Parameters:

  • serverName - Name of the server to list resources from
  • cursor - Optional pagination cursor

Returns: Promise<{ resources: Resource[]; nextCursor?: string }> - List of resources and optional next page cursor

getResource<T>(serverName, resourceId)

Gets a specific resource from the MCP server.

Parameters:

  • serverName - Name of the server to get the resource from
  • resourceId - ID of the resource to get

Returns: Promise<T> - The requested resource

validateRule(content, options?)

Validates a rule definition.

Parameters:

  • content - Rule content to validate
  • options - Additional validation options
    • languageId - Language of the rule content (default: 'yaml')
    • uri - Optional URI of the rule

Returns: Promise<ValidationResult> - Validation result

validateCode(code, ruleIds, languageId)

Validates code against multiple rules.

Parameters:

  • code - Code to validate
  • ruleIds - IDs of rules to validate against
  • languageId - Language of the code

Returns: Promise<Record<string, ValidationResult>> - Map of rule IDs to validation results

applyTemplate(templateId, variables)

Applies a template.

Parameters:

  • templateId - ID of the template to apply
  • variables - Variables to use in the template

Returns: Promise<string> - Generated content

generate(prompt, options?)

Generates content.

Parameters:

  • prompt - Prompt to generate from
  • options - Generation options
    • mode - Generation mode
    • format - Output format
    • temperature - Temperature for generation
    • maxTokens - Maximum tokens to generate
    • includeSources - Whether to include sources in the response

Returns: Promise<string> - Generated content

Types

The following TypeScript interfaces are exported:

  • ValidationIssue - Issue found during validation
  • ValidationResult - Result of a validation operation
  • Resource - A resource from the MCP server
  • GenerateOptions - Options for generation requests
  • WindsweeperClientOptions - Options for creating a client

Development

Building

npm run build

Testing

npm test

License

MIT