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

@xylent_ai/mcp-typescript

v0.1.4

Published

Production-ready MCP (Model Context Protocol) client and server implementation for Xylent services

Readme

@xylent_ai/mcp-typescript

Production-ready Model Context Protocol client and server toolkit for TypeScript/Node.js, covering Streamable HTTP transports, retries, auth, and Express integration.

Features

  • Streamable HTTP client with lazy connections, per-call timeouts, retry/backoff, and capability negotiation.
  • Registry-friendly server toolkit: drop-in StreamableMCPServer for Streamable HTTP, plus attachMcp for Express apps with auth and CORS.
  • Authentication: Client auth (Basic/Bearer) plus server-side BasicAuth/NoAuth.
  • Tools & resources: Register tools (Zod schemas) and, optionally, resources/templates on the server; list/call/read/subscribe from the client.
  • Type-safe: Full TypeScript definitions; dynamic package version is sent in the MCP handshake.
  • Examples included for both client and server usage.

Installation

# Client only
npm install @xylent_ai/mcp-typescript

# Server (Express) helpers
npm install @xylent_ai/mcp-typescript express
npm install -D @types/express

Quick Start

Streamable HTTP Client

import { StreamableMCPClient } from '@xylent_ai/mcp-typescript/mcp';

async function main() {
  const client = new StreamableMCPClient({
    baseUrl: 'http://localhost:3000', // will append /mcp if missing
    name: 'demo-client',
    timeout: 30_000,
  });

  try {
    const tools = await client.listTools();
    console.log(
      'Tools:',
      tools.tools?.map((t) => t.name)
    );

    const result = await client.callTool('echo', { text: 'hello world' });
    console.log('Result:', result);
  } finally {
    await client.close();
  }
}

main().catch((err) => {
  console.error(err);
  process.exit(1);
});

Streamable HTTP Server (Express)

import express from 'express';
import { z } from 'zod';
import { StreamableMCPServer } from '@xylent_ai/mcp-typescript/mcp';

const app = express();
app.use(express.json());

const capabilities = {
  tools: {
    echo: {
      name: 'echo',
      description: 'Echo back text',
      category: 'utility',
      schema: z.object({ text: z.string() }),
      handler: async ({ text }) => ({
        content: [{ type: 'text', text }],
      }),
    },
  },
};

const server = new StreamableMCPServer({
  serverInfo: { name: 'demo-mcp-server' },
  serverOptions: { capabilities },
});

// Streamable MCP endpoint
app.post('/mcp', server.handlePost);

app.listen(3000, () => console.log('MCP server on http://localhost:3000/mcp'));

Express Helper (attachMcp)

Prefer a one-liner integration with auth/CORS built-in:

import express from 'express';
import { z } from 'zod';
import { attachMcp, BasicAuth } from '@xylent_ai/mcp-typescript/serverkit';

const app = express();
app.use(express.json());

const capabilities = {
  tools: {
    calc: {
      name: 'calc',
      description: 'Add numbers',
      category: 'math',
      schema: z.object({ a: z.number(), b: z.number() }),
      handler: async ({ a, b }) => ({
        content: [{ type: 'text', text: String(a + b) }],
      }),
    },
  },
};

attachMcp(app, {
  name: 'calc-service',
  capabilities,
  path: '/mcp',
  cors: true,
  auth: new BasicAuth(process.env.BASIC_USERNAME!, process.env.BASIC_PASSWORD!),
});

app.listen(3000, () => console.log('MCP service ready'));

Authentication

  • Client: pass auth or transportOptions to StreamableMCPClient.
  • Server: attachMcp defaults to NoAuth with a warning; StreamableMCPServer can sit behind any Express auth middleware.
const client = new StreamableMCPClient({
  baseUrl: 'http://localhost:3000',
  name: 'demo-client',
  auth: { type: 'basic', username: 'service-eval', password: 'secret123' },
  // Or: auth: { type: 'bearer', token },
});

Examples

  • src/examples/attach-mcp-express.md
  • src/examples/streamable-client.md
  • src/examples/streamable-server.md

Development

npm install
npm run build
npm run lint
npm run format
npm run dev

License

Proprietary - Xylent Internal Use Only

Author

Santiago Blankleider [email protected]