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

@codai/glass-mcp-sdk

v5.0.0

Published

TypeScript SDK for GlassMCP - Machine Control Protocol client library

Readme

@codai/glass-sdk

TypeScript SDK for GlassMCP - Machine Control Protocol client library for Windows automation.

Installation

npm install @codai/glass-sdk

Quick Start

import { GlassMCPClient } from '@codai/glass-sdk';

// Initialize client
const client = new GlassMCPClient({
  baseUrl: 'http://localhost:7700',
  token: 'your-auth-token',
});

// Focus a window
await client.window.focus({ title: 'Visual Studio Code' });

// Type some text
await client.keyboard.type({ text: 'Hello from GlassMCP!' });

// Move mouse
await client.mouse.move({ x: 100, y: 200 });

// Click mouse
await client.mouse.click({ x: 100, y: 200 });

// Get clipboard content
const clipboardText = await client.clipboard.getText();

// Set clipboard content
await client.clipboard.setText({ text: 'Hello World' });

// Execute system command
const result = await client.system.exec({ command: 'dir' });

// Read file
const content = await client.filesystem.readFile({
  path: 'C:\\temp\\file.txt',
});

// Write file
await client.filesystem.writeFile({
  path: 'C:\\temp\\output.txt',
  content: 'Hello World',
});

API Reference

Window Control

  • window.focus(options) - Focus window by title
  • window.list() - Get list of open windows
  • window.close(options) - Close window by title or process ID
  • window.minimize(options) - Minimize window
  • window.maximize(options) - Maximize window

Keyboard Control

  • keyboard.type(options) - Type text
  • keyboard.press(options) - Press key combination
  • keyboard.hotkey(options) - Send hotkey sequence

Mouse Control

  • mouse.move(options) - Move mouse to coordinates
  • mouse.click(options) - Click at coordinates
  • mouse.scroll(options) - Scroll mouse wheel

Clipboard Control

  • clipboard.getText() - Get clipboard text
  • clipboard.setText(options) - Set clipboard text
  • clipboard.getFiles() - Get clipboard file list
  • clipboard.clear() - Clear clipboard

System Control

  • system.exec(options) - Execute system command
  • system.getProcesses() - List running processes
  • system.killProcess(options) - Kill process by ID
  • system.getSystemInfo() - Get system information

Filesystem Control

  • filesystem.readFile(options) - Read file content
  • filesystem.writeFile(options) - Write file content
  • filesystem.exists(options) - Check if file exists
  • filesystem.delete(options) - Delete file
  • filesystem.copy(options) - Copy file
  • filesystem.move(options) - Move file
  • filesystem.createDirectory(options) - Create directory
  • filesystem.listDirectory(options) - List directory contents

Configuration

The client accepts the following configuration options:

interface ClientConfig {
  baseUrl: string; // GlassMCP server URL (default: http://localhost:7700)
  token: string; // Authentication token
  timeout?: number; // Request timeout in ms (default: 30000)
  retries?: number; // Number of retries (default: 3)
}

Error Handling

The SDK throws specific error types for different scenarios:

import { GlassMCPError } from '@codai/glass-sdk';

try {
  await client.window.focus({ title: 'NonExistent' });
} catch (error) {
  if (error instanceof GlassMCPError) {
    console.log('Error code:', error.code);
    console.log('Error message:', error.message);
  }
}

WebSocket Support

For real-time events and notifications:

import { GlassMCPWebSocketClient } from '@codai/glass-sdk';

const wsClient = new GlassMCPWebSocketClient({
  url: 'ws://localhost:7700/ws',
  token: 'your-auth-token',
});

wsClient.on('window.focus', event => {
  console.log('Window focused:', event.windowTitle);
});

await wsClient.connect();

License

MIT - see LICENSE file for details.