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

@perfecxion/secure-mcp-client

v1.0.0

Published

Client SDK for Secure MCP Server

Readme

Secure MCP Client SDK

Official client SDK for the Secure MCP Server.

Installation

npm install @perfecxion/secure-mcp-client

Quick Start

import { SecureMCPClient } from '@perfecxion/secure-mcp-client';

// Initialize client
const client = new SecureMCPClient({
  serverUrl: 'https://mcp.example.com',
  apiKey: 'your-api-key',
  debug: true
});

// Connect via WebSocket
await client.connect();

// List available tools
const tools = await client.listTools();
console.log('Available tools:', tools);

// Execute a tool
const result = await client.executeTool('search', {
  query: 'machine learning papers'
});

// Subscribe to events
client.subscribe('notification', (data) => {
  console.log('Notification:', data);
});

// Disconnect when done
client.disconnect();

Features

  • ✅ WebSocket and HTTP transport
  • ✅ Automatic reconnection
  • ✅ JWT and API key authentication
  • ✅ Event subscription
  • ✅ TypeScript support
  • ✅ Promise-based API
  • ✅ Request queuing

API Reference

Constructor

new SecureMCPClient(config: MCPClientConfig)

Config Options:

  • serverUrl: MCP server URL (required)
  • apiKey: API key for authentication
  • jwt: JWT token for authentication
  • timeout: Request timeout in ms (default: 30000)
  • reconnectionAttempts: Max reconnection attempts (default: 5)
  • debug: Enable debug logging (default: false)

Methods

connect()

Connect to the MCP server via WebSocket.

await client.connect();

disconnect()

Disconnect from the MCP server.

client.disconnect();

request(method, params)

Send a generic request to the MCP server.

const response = await client.request('custom/method', { data: 'value' });

listTools()

Get list of available tools.

const tools = await client.listTools();

executeTool(name, params)

Execute a specific tool.

const result = await client.executeTool('search', { query: 'test' });

listResources()

Get list of available resources.

const resources = await client.listResources();

readResource(uri)

Read a specific resource.

const content = await client.readResource('file:///path/to/resource');

complete(prompt, options)

Send a completion request.

const response = await client.complete('Generate a summary of...', {
  temperature: 0.7,
  maxTokens: 1000
});

subscribe(event, handler)

Subscribe to server events.

client.subscribe('update', (data) => {
  console.log('Update received:', data);
});

Events

  • connected: Fired when connected to server
  • disconnected: Fired when disconnected from server
  • error: Fired on connection or request error
  • message: Fired for all incoming messages

Authentication

API Key

const client = new SecureMCPClient({
  serverUrl: 'https://mcp.example.com',
  apiKey: 'your-api-key'
});

JWT Token

const client = new SecureMCPClient({
  serverUrl: 'https://mcp.example.com',
  jwt: 'your-jwt-token'
});

Error Handling

try {
  await client.connect();
  const result = await client.executeTool('tool', {});
} catch (error) {
  console.error('MCP Error:', error.message);
}

License

Apache-2.0