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 🙏

© 2025 – Pkg Stats / Ryan Hefner

blah-mcp-test

v1.700.4

Published

CLI tool for running MCP test client with integrated server

Downloads

80

Readme

blah-mcp-test

npm version License: ISC

A command-line tool for testing MCP (Model Context Protocol) tools with any OpenAI model. This tool integrates a client and server in a single process, making it easy to test and interact with MCP tools.

Features

  • Integrated MCP client and server in a single CLI tool
  • Support for any OpenAI model
  • Configurable via CLI arguments or configuration file
  • Beautiful console output with detailed logging
  • Easy tool discovery and execution

Installation

npm install -g blah-mcp-test

Environment Setup

Create a .env file in your project directory by copying the example:

cp .env.example .env

Then edit .env and add your configuration:

# MCP Server Configuration
BLAH_HOST=https://ajax-blah.web.val.run

# OpenAI API Configuration
OPENAI_API_KEY=your_api_key_here

Quick Start

# Set required environment variables
export BLAH_HOST=https://ajax-blah.web.val.run
export OPENAI_API_KEY=your_api_key

# Run with default options
blah-mcp-test --prompt "What is the capital of France?"

# Run with custom model and system prompt
blah-mcp-test \
  --model gpt-4o-mini \
  --systemPrompt "You are a helpful assistant" \
  --prompt "What is the capital of France?"

# Use a configuration file
blah-mcp-test -c ./my-config.json --prompt "Create a tool that generates random numbers"

Configuration

You can configure the tool in three ways (in order of precedence):

  1. Command-line arguments
  2. Configuration file (blah-mcp-test.json)
  3. Environment variables

Command-line Options

Options:
  -V, --version              output version number
  -m, --model <model>        OpenAI model to use (default: "gpt-4o-mini")
  -s, --systemPrompt <text>  System prompt for the AI (default: "You are a helpful assistant")
  -p, --prompt <text>        User prompt to send
  -c, --config <path>        Path to config file (default: "./blah-mcp-test.json")
  --host <url>              BLAH_HOST value
  --openai-key <key>        OpenAI API key
  -h, --help                display help for command

Configuration File

Create a blah-mcp-test.json in your project directory:

{
  "model": "gpt-4o-mini",
  "systemPrompt": "You are a helpful assistant",
  "host": "https://ajax-blah.web.val.run",
  "openaiKey": "your_api_key"
}

Environment Variables

  • BLAH_HOST: The host URL for the MCP server (required)
  • OPENAI_API_KEY: Your OpenAI API key (required)

Example Use Cases

Creating a New Tool

# Create a tool that generates random numbers
blah-mcp-test --prompt "Create a tool that generates random numbers between a min and max value"

# Create a tool that fetches weather data
blah-mcp-test --prompt "Create a tool that fetches weather data for a given city"

Using Existing Tools

# Use the LOTR horoscope tool
blah-mcp-test --prompt "What's my Lord of the Rings horoscope for birthdate 03-14?"

# Generate a random letter
blah-mcp-test --prompt "Generate a random letter between A and Z"

Development

# Clone the repository
git clone https://github.com/yourusername/blah-mcp-test.git
cd blah-mcp-test

# Install dependencies
npm install

# Run in development mode
npm run dev -- --prompt "Your test prompt"

# Build for production
npm run build

# Run the built version
npm start -- --prompt "Your test prompt"

Architecture

The tool consists of three main components:

  1. CLI Interface: Handles command-line arguments and configuration loading
  2. MCP Server: Manages tool discovery and execution
  3. MCP Client: Handles communication with the AI model and tool selection

Flow Diagram

┌─────────────┐    ┌──────────────┐    ┌───────────────┐
│  CLI Input  │───▶│  MCP Server  │◀───▶│  BLAH_HOST    │
└─────────────┘    └──────────────┘    └───────────────┘
                          ▲
                          │
                   ┌──────┴──────┐
                   │  MCP Client  │
                   └──────┬──────┘
                          │
                   ┌──────┴──────┐
                   │ OpenAI API   │
                   └─────────────┘

Troubleshooting

Common Issues

  1. Missing Environment Variables

    Error: BLAH_HOST must be provided

    Solution: Set the BLAH_HOST environment variable or provide it in the config file

  2. OpenAI API Key Issues

    Error: OpenAI API key is required

    Solution: Set the OPENAI_API_KEY environment variable or provide it in the config file

  3. Tool Not Found

    Error: Tool 'xyz' was not found

    Solution: Check the available tools list and ensure you're using the correct tool name

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and ensure everything works
  5. Submit a pull request

License

ISC