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

supermodel-ui-client

v0.0.1

Published

SuperModel MCP UI Client SDK - privacy-first client-side rendering with template-based widgets

Readme

SuperModel MCP-UI Client SDK

🔒 Privacy-first client-side UI rendering for MCP data

SuperModel Client SDK provides a privacy-focused alternative to server-side UI generation. Instead of sending sensitive data to remote servers for rendering, it fetches generic templates once and performs all data binding and rendering locally in the browser.

🌟 Key Features

  • 🔒 Privacy-First: Your sensitive data never leaves the client
  • ⚡ Performance: Templates cached locally, fast rendering
  • 🎨 Flexible: 6+ widget types with auto-detection
  • 🔌 MCP Compatible: Works with any MCP data server
  • ⚛️ React Ready: Built-in React components and hooks
  • 🌐 Framework Agnostic: Web components for any framework
  • 📱 Responsive: Mobile-first design patterns

🏗️ Architecture

graph TB
    A[MCP Data Server] -->|Raw JSON Data| B[SuperModel Client SDK]
    C[Template Server] -->|Generic Templates| B
    B -->|Local Rendering| D[UI Components]
    
    B -.->|One-time fetch| C
    B -->|Privacy Boundary| E[Your Browser]
    
    style E fill:#e1f5fe
    style B fill:#f3e5f5
    style A fill:#e8f5e8

🚀 Quick Start

Installation

npm install supermodel-client

React Usage

import React from 'react';
import { SuperModelResourceRenderer, useSuperModelRenderer } from 'supermodel-client';

function MyApp() {
  const { renderWidget, detectPattern } = useSuperModelRenderer();
  
  const userData = [
    { name: 'Alice', department: 'Engineering', salary: 95000 },
    { name: 'Bob', department: 'Marketing', salary: 72000 }
  ];

  return (
    <SuperModelResourceRenderer
      data={userData}
      config={{ title: 'Team Members', responsive: true }}
      templateServer={{ url: 'http://localhost:3001' }}
    />
  );
}

Web Components Usage

<!DOCTYPE html>
<html>
<head>
    <script type="module">
        import { superModelWebComponents } from 'supermodel-client';
        
        // Register all components
        await superModelWebComponents.registerAll();
        
        // Use components
        const tableWidget = document.querySelector('supermodel-table');
        tableWidget.data = [
            { name: 'Alice', role: 'Engineer' },
            { name: 'Bob', role: 'Designer' }
        ];
    </script>
</head>
<body>
    <supermodel-table></supermodel-table>
</body>
</html>

📚 Widget Types

| Widget | Best For | Auto-Detection | |--------|----------|---------------| | Table | Structured data, lists of objects | ✅ Homogeneous object arrays | | Card | Key-value data, profiles, summaries | ✅ Single objects | | List | Simple collections, arrays | ✅ Arrays of primitives | | Chart | Numerical data, analytics | ✅ Label-value pairs | | Timeline | Events, chronological data | ✅ Date/timestamp fields | | Form | Interactive forms, schemas | ✅ Form field definitions |

🔧 Configuration

Template Server Setup

  1. Start the Template Server:
cd supermodel-mcp-ui-template-server
npm start
  1. Configure Client:
const config = {
  templateServer: {
    url: 'http://localhost:3001',
    timeout: 5000,
    cache: true,
    cacheDuration: 300000 // 5 minutes
  }
};

Data Pattern Detection

import { DataPatternDetector } from 'supermodel-client';

const detector = new DataPatternDetector();
const pattern = detector.detectPattern(yourData);

console.log(`Suggested widget: ${pattern.suggestedWidgetType}`);
console.log(`Confidence: ${pattern.confidence * 100}%`);

🎯 MCP Integration

With MCP Data Servers

import { McpClientAdapter } from 'supermodel-client';

const adapter = new McpClientAdapter({
  templateServer: { url: 'http://localhost:3001' },
  autoDetect: true
});

// Process MCP resources
const superModelResource = await adapter.processResource(mcpResource);

// Render with SuperModel
<SuperModelResourceRenderer resource={superModelResource} />

Example MCP Server Integration

// Your MCP server returns raw data
server.registerTool("get_users", {}, async () => {
  return {
    content: [{
      type: "text", 
      text: JSON.stringify({ users: [...] }) // Raw data
    }]
  };
});

// SuperModel Client SDK handles the rest locally

🔒 Privacy Guarantees

What Gets Sent to Template Server

  • ✅ Template requests (widget type only)
  • ✅ Generic template code
  • ✅ Public metadata

What Stays Local

  • 🔒 Your actual data
  • 🔒 Business information
  • 🔒 User details
  • 🔒 All data processing
  • 🔒 Widget rendering

Privacy Verification

# Monitor network traffic to see only template requests
npm run test:privacy

📖 API Reference

Components

SuperModelResourceRenderer

interface SuperModelResourceRendererProps {
  data: any;                           // Your data (stays local)
  widgetType?: SuperModelWidgetType;   // Override auto-detection  
  config?: TemplateConfig;             // Widget configuration
  templateServer?: TemplateServerConfig; // Template server settings
  onAction?: (result: SuperModelActionResult) => Promise<void>;
  onError?: (error: Error) => void;
  onLoading?: (isLoading: boolean) => void;
}

SuperModelTemplateRenderer

interface SuperModelTemplateRendererProps {
  templateId: string;     // Specific template to use
  data: any;             // Data to render
  config?: TemplateConfig;
  // ... other props
}

Hooks

useSuperModelRenderer()

const {
  renderWidget,    // Function to render widgets
  detectPattern,   // Function to detect data patterns  
  loading,         // Loading state
  error           // Error state
} = useSuperModelRenderer(templateServerConfig);

useSuperModelTemplate()

const {
  template,       // Loaded template definition
  loading,        // Loading state
  error,          // Error state  
  refetch        // Refetch function
} = useSuperModelTemplate(templateId, templateServerConfig);

Utilities

DataPatternDetector

const detector = new DataPatternDetector();
const pattern = detector.detectPattern(data);

interface DataPattern {
  type: 'object' | 'array' | 'primitive';
  subtype?: string;
  confidence: number; // 0-1
  suggestedWidgetType: SuperModelWidgetType;
  metadata?: object;
}

McpClientAdapter

const adapter = new McpClientAdapter({
  templateServer: { url: 'http://localhost:3001' },
  autoDetect: true,
  defaultWidgetType: 'card'
});

// Process MCP resources
const processed = await adapter.processResource(mcpResource);

// Create resources from raw data
const resource = adapter.createResourceFromData(data, 'table');

RenderingEngine

const engine = new RenderingEngine({
  templateServer: { url: 'http://localhost:3001' },
  enableCaching: true,
  errorHandler: (error) => console.error(error)
});

const element = await engine.render(superModelResource, containerElement);

🛠️ Development

Setup

git clone https://github.com/your-org/supermodel-mcp-ui
cd supermodel-mcp-ui/supermodel-client
npm install
npm run build

Running Examples

  1. React Example:
cd examples/react-example
npm install
npm run dev
  1. Web Components Example:
cd examples/web-components-example
python -m http.server 8000
# Open http://localhost:8000
  1. Integration Test:
cd examples/integration-test
npm install
npm test

Project Structure

supermodel-client/
├── src/
│   ├── components/          # React components
│   ├── hooks/              # React hooks  
│   ├── utils/              # Core utilities
│   ├── web-components/     # Web component registration
│   ├── types.ts            # Type definitions
│   ├── constants.ts        # Configuration constants
│   └── index.ts            # Main exports
├── examples/               # Usage examples
├── dist/                   # Built package
└── README.md

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Workflow

# Install dependencies
npm install

# Build the package
npm run build

# Run tests
npm test

# Run linting
npm run lint

# Start development mode
npm run dev

📄 License

MIT License - see LICENSE file for details.

🙏 Acknowledgments

📞 Support


🚀 Ready to build privacy-first UI experiences?

Check out our examples to see SuperModel in action!