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

@mcp-z/client

v1.0.7

Published

Programmatic MCP client library for Node.js - connect, discover, and call tools on Model Context Protocol servers.

Readme

@mcp-z/client

Docs: https://mcp-z.github.io/client Programmatic MCP client for spawning, connecting to, and calling MCP servers.

Common uses

  • Run MCP tools from scripts
  • Connect to multiple servers in one process
  • Integration tests for MCP servers

Install

npm install --save-dev @mcp-z/client

Requires Node.js >= 22.

Quick start

import { createServerRegistry } from '@mcp-z/client';

const registry = createServerRegistry({
  todoist: { type: 'http', url: 'https://ai.todoist.net/mcp' }
});

const client = await registry.connect('todoist');
await client.callTool('add-tasks', {
  tasks: [{ content: 'Learn MCP', priority: 4 }]
});

await registry.close();

Configuration

MCP supports stdio and HTTP.

Stdio

{
  echo: {
    command: 'node',
    args: ['server.js'],
    env: { LOG_LEVEL: 'info' }
  }
}

HTTP

{
  todoist: {
    type: 'http',
    url: 'https://ai.todoist.net/mcp',
    headers: { Authorization: 'Bearer token' }
  }
}

HTTP with start block (extension)

Use dialects: ['start'] to spawn HTTP servers with start blocks.

const registry = createServerRegistry(
  {
    api: {
      type: 'http',
      url: 'http://localhost:3000/mcp',
      start: { command: 'node', args: ['server.js'] }
    }
  },
  { dialects: ['start'] }
);

API overview

Registry

  • createServerRegistry(config, options?)
  • registry.connect(name, options?)
  • registry.searchCapabilities(query, options?)
  • registry.close()

Managed client

  • client.callTool(name, args)
  • client.getPrompt(name, args)
  • client.readResource(uri)
  • client.listTools() / client.listResources() / client.listPrompts()
  • client.callToolRaw() / client.getPromptRaw() / client.readResourceRaw() (raw SDK responses)

Response helpers

Tool, prompt, and resource calls return wrappers with:

  • json() - Parse structured content
  • text() - First text result
  • raw() - Raw MCP response

Examples

Call a tool

const response = await client.callTool('drive-search', { query: 'Q4 Reports' });
const data = response.json();

Get a prompt

const prompt = await client.getPrompt('query-syntax', { service: 'gmail' });
console.log(prompt.text());

Read a resource

const resource = await client.readResource('mcp-pdf://abc123');
console.log(resource.text());

Search capabilities

const results = await registry.searchCapabilities('message send', {
  types: ['tool'],
  servers: ['gmail', 'outlook']
});

createServerRegistry options

  • cwd - Working directory for spawned processes (default: process.cwd())
  • env - Base env for all servers (if set, process.env is not merged)
  • dialects - Which servers to spawn: ['servers'] (stdio), ['start'] (HTTP start blocks), or both

OAuth (DCR)

If an HTTP server supports DCR, pass a token store via dcrAuthenticator:

import Keyv from 'keyv';
import { createServerRegistry } from '@mcp-z/client';

const registry = createServerRegistry({
  todoist: { type: 'http', url: 'https://ai.todoist.net/mcp' }
});

const client = await registry.connect('todoist', {
  dcrAuthenticator: { tokenStore: new Keyv() }
});

Requirements

  • Node.js >= 22