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

@whmpro/helloworld-mcp

v1.0.1

Published

A simple Hello World MCP server

Downloads

4

Readme

Hello World MCP Server

A simple Model Context Protocol (MCP) server built with Node.js and TypeScript to demonstrate basic MCP concepts.

What is MCP?

Model Context Protocol (MCP) is a protocol that allows AI models to securely access external tools, resources, and prompts. This server demonstrates the three main MCP capabilities:

  • Tools: Functions that can be called by the AI model
  • Resources: Static content that can be read by the AI model
  • Prompts: Templates that can be used to generate responses

Setup

  1. Install dependencies:

    npm install
  2. Build the TypeScript code:

    npm run build
  3. Run the server:

    npm start

Features

Tools

This server provides three simple tools:

  1. hello - Returns a personalized greeting

    • Input: name (string)
    • Example: {"name": "Alice"}
  2. current_time - Returns the current date and time

    • Input: No parameters required
  3. calculate - Performs basic arithmetic operations

    • Input: operation (add/subtract/multiply/divide), a (number), b (number)
    • Example: {"operation": "add", "a": 5, "b": 3}

Resources

The server provides two static resources:

  1. info://server - Information about the server
  2. greeting://welcome - A welcome message for new users

Prompts

The server includes one prompt template:

  1. greeting - Generates personalized greetings
    • Arguments: name (required), style (optional: formal/casual/friendly)

How MCP Works

  1. Client Connection: An MCP client (like Claude Desktop) connects to the server via stdio
  2. Capability Discovery: The client asks what tools, resources, and prompts are available
  3. Tool Execution: The client can call tools with specific parameters
  4. Resource Reading: The client can read static resources
  5. Prompt Generation: The client can use prompts to generate responses

Testing with Claude Desktop

To test this server with Claude Desktop:

  1. Build and start the server
  2. Configure Claude Desktop to connect to your MCP server
  3. The server will be available as a tool provider in Claude Desktop

Project Structure

hello-world-mcp/
├── src/
│   └── index.ts          # Main server implementation
├── build/                # Compiled JavaScript (generated)
├── package.json          # Node.js dependencies and scripts
├── tsconfig.json         # TypeScript configuration
└── README.md            # This file

Key MCP Concepts Demonstrated

  • Server Setup: Creating an MCP server with capabilities
  • Request Handlers: Handling different types of MCP requests
  • Error Handling: Proper error responses
  • Type Safety: Using TypeScript for better development experience
  • Transport: Using stdio transport for communication

Next Steps

After understanding this basic example, you can:

  1. Add more complex tools that interact with external APIs
  2. Create resources that read from files or databases
  3. Build more sophisticated prompt templates
  4. Add authentication and security features
  5. Implement more advanced MCP features like progress reporting

Learn More