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

avc-mcp-client

v0.1.1

Published

MCP client for AVC video enhancement service

Readme

AVC MCP Client (NPM)

NPM client for AVC video enhancement MCP service.

Installation

npm install avc-mcp-client

Or with yarn:

yarn add avc-mcp-client

Or with pnpm:

pnpm add avc-mcp-client

Quick Start

URL Video

import { AVCMCPClient } from 'avc-mcp-client';

// Initialize client
const client = new AVCMCPClient({
  baseUrl: 'http://192.168.0.7:8001',
  apiKey: 'your-api-key'
});

// Sync video enhancement (blocks until complete)
const result = await client.enhanceVideoSync({
  videoUrl: 'https://example.com/video.mp4',
  type: 'url',  // default
  resolution: '720p'
});

if (result.success) {
  console.log(`Enhanced video: ${result.videoUrl}`);
}

Local File (Node.js)

import { AVCMCPClient, validateFileSize } from 'avc-mcp-client';
import { readFileSync } from 'fs';
import { basename } from 'path';

const client = new AVCMCPClient({
  baseUrl: 'http://192.168.0.7:8001',
  apiKey: 'your-api-key'
});

// Read local file as base64
const filePath = '/path/to/video.mp4';
const fileData = readFileSync(filePath).toString('base64');

// Optional: validate file size (max 100MB)
validateFileSize(fileData, 100);

// Enhance local file
const result = await client.enhanceVideoSync({
  videoUrl: basename(filePath),  // filename
  type: 'local',
  fileData: fileData,
  resolution: '720p'
});

if (result.success) {
  console.log(`Enhanced video: ${result.videoUrl}`);
}

API Reference

AVCMCPClient

Main client class for MCP service.

Constructor

new AVCMCPClient(options?: AVCMCPClientOptions)

Options:

| Option | Type | Default | Description | |--------|------|---------|-------------| | baseUrl | string | http://192.168.0.7:8001 | MCP server URL | | apiKey | string | - | API key for authentication | | timeout | number | 600000 (10 min) | Default timeout in ms | | pollInterval | number | 5000 | Polling interval in ms |

Methods

enhanceVideoSync

Enhance video synchronously (blocks until complete).

await client.enhanceVideoSync({
  videoUrl: string,        // URL or filename
  type?: 'url' | 'local',  // default: 'url'
  fileData?: string,       // base64 data (required if type='local')
  resolution?: Resolution, // default: '720p'
  timeout?: number
}): Promise<EnhanceResult>
enhanceVideoAsync

Start video enhancement asynchronously.

await client.enhanceVideoAsync({
  videoUrl: string,        // URL or filename
  type?: 'url' | 'local',  // default: 'url'
  fileData?: string,       // base64 data (required if type='local')
  resolution?: Resolution
}): Promise<AsyncTaskResult>
getTaskStatus

Query task status.

await client.getTaskStatus(taskId: string): Promise<TaskStatusResult>
waitForTask

Wait for task completion.

await client.waitForTask(taskId: string, options?: {
  timeout?: number,      // default: 600000
  pollInterval?: number  // default: 5000
}): Promise<TaskStatusResult>

Helper Functions

validateFileSize

Validate base64 file size (throws FileSizeExceededError if exceeded).

validateFileSize(base64Data: string, maxSizeMb?: number): void

Types

Resolution

type Resolution = '480p' | '540p' | '720p' | '1080p' | '2k'

VideoType

type VideoType = 'url' | 'local'

TaskStatus

type TaskStatus = 'wait' | 'start' | 'processing' | 'completed' | 'failed' | 'timeout'

AsyncTaskResult

interface AsyncTaskResult {
  success: boolean;
  taskId?: string;        // 失败时可能为空
  status?: TaskStatus;
  message?: string;
  error?: string;
}

EnhanceResult

interface EnhanceResult {
  success: boolean;
  taskId?: string;
  status?: TaskStatus;
  videoUrl?: string;
  message?: string;
  error?: string;
}

TaskStatusResult

interface TaskStatusResult {
  success: boolean;
  taskId?: string;
  status?: TaskStatus;
  videoUrl?: string;
  message?: string;
  error?: string;
}

Exceptions

| Exception | Description | |-----------|-------------| | MCPClientError | Base exception | | MCPConnectionError | Connection failed | | MCPParseError | Response parsing failed | | MCPToolError | Tool execution failed | | MPCTimeoutError | Operation timed out | | MCPAuthenticationError | Authentication failed | | FileSizeExceededError | File size exceeds 100MB limit |

Example: Async Enhancement with Polling

import { AVCMCPClient, MPCTimeoutError } from 'avc-mcp-client';

const client = new AVCMCPClient({
  baseUrl: 'http://192.168.0.7:8001',
  apiKey: 'your-api-key'
});

// Start async enhancement
const task = await client.enhanceVideoAsync({
  videoUrl: 'https://example.com/long-video.mp4',
  resolution: '1080p'
});

if (!task.taskId) {
  console.error('任务创建失败:', task.error || task.message);
  process.exit(1);
}

console.log(`Task created: ${task.taskId}`);

// Wait for completion with custom timeout
try {
  const result = await client.waitForTask(task.taskId, {
    timeout: 1200000,  // 20 minutes
    pollInterval: 10000  // Check every 10 seconds
  });

  if (result.success) {
    console.log(`Enhanced video: ${result.videoUrl}`);
  } else {
    console.log(`Task failed: ${result.error}`);
  }
} catch (e) {
  if (e instanceof MPCTimeoutError) {
    console.log('Task did not complete in time');
  } else {
    throw e;
  }
}

Development

# Install dependencies
pnpm install

# Build
pnpm build

# Run tests
pnpm test

# Type check
pnpm typecheck

Requirements

  • Node.js >= 18.0.0

License

MIT