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-bsky-jetstream-client

v1.0.0

Published

MCP client for consuming the Bluesky jetstream MCP server

Readme

MCP Bluesky Jetstream Client

A TypeScript MCP (Model Context Protocol) client for consuming the Bluesky Jetstream MCP server.

Features

  • Connects to MCP server via StreamableHTTP transport
  • Lists available tools on the server
  • Calls the getMessages tool to retrieve recent Bluesky posts
  • Command-line interface with configurable options
  • Library API for programmatic use in other projects
  • TypeScript support with full type definitions
  • Comprehensive error handling

Installation

  1. Navigate to the client directory:

    cd client
  2. Install dependencies:

    npm install
  3. Build the project:

    npm run build

Usage

Basic Usage

# Run the client (connects to localhost:3000 by default)
npm start

# Or run directly with Node.js
node dist/index.js

Testing with Server

To test the full client-server integration, use the provided test script:

# Make sure you're in the project root directory
./client/test-with-server.sh

This script will:

  1. Start the MCP server in the background
  2. Wait for it to initialize
  3. Run the client to connect and retrieve messages
  4. Clean up by stopping the server

Command Line Options

  • --server <url>: Server URL (default: http://localhost:3000)
  • --name <name>: Client name (default: mcp-client-bsky-jetstream)
  • --help, -h: Show help message

Examples

# Connect to a different server
npm start -- --server http://localhost:3001

# Use a custom client name
npm start -- --name my-custom-client

# Show help
npm start -- --help

Using as a Library

You can also import and use the McpBskyClient class in your own projects:

import { McpBskyClient, BskyMessage } from 'mcp-bsky-jetstream-client';

async function main() {
    // Create client instance
    const client = new McpBskyClient({
        serverUrl: 'http://localhost:3000',
        clientName: 'my-app-client'
    });

    try {
        // Connect to server
        await client.connect();

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

        // Get messages
        const messages: BskyMessage[] = await client.getMessages();

        // Process messages
        messages.forEach((msg, index) => {
            console.log(`${index + 1}. ${msg.did}: ${msg.text}`);
        });

    } catch (error) {
        console.error('Error:', error);
    } finally {
        // Always disconnect
        await client.disconnect();
    }
}

main();

API Reference:

interface McpBskyClientOptions {
  serverUrl?: string;    // Default: 'http://localhost:3000'
  clientName?: string;   // Default: 'mcp-client-bsky-jetstream'
}

interface BskyMessage {
  did: string;     // User DID
  text: string;    // Message text
  time: number;    // Timestamp
}

class McpBskyClient {
  constructor(options?: McpBskyClientOptions)

  // Connection management
  connect(): Promise<void>
  disconnect(): Promise<void>

  // Tool operations
  listTools(): Promise<string[]>
  getMessages(): Promise<BskyMessage[]>

  // Convenience methods
  getAndDisplayMessages(limit?: number): Promise<void>

  // Getters
  getServerUrl(): string
  getClientName(): string
}

Development

For development with hot reloading:

npm run dev

This uses tsx for TypeScript execution without building.

How It Works

  1. Connection: Establishes a StreamableHTTP connection to the MCP server
  2. Initialization: Performs MCP handshake and initialization
  3. Tool Discovery: Lists available tools on the server
  4. Tool Execution: Calls the getMessages tool to retrieve recent messages
  5. Display: Shows the retrieved messages in a formatted output

Requirements

  • Node.js 18+
  • Running MCP Bluesky Jetstream server (see parent directory)

Error Handling

The client includes comprehensive error handling for:

  • Connection failures
  • Server unavailability
  • Invalid responses
  • Tool execution errors

All errors are logged to the console with descriptive messages.