MCP Hello World - MCP Server Mock for Testing

by lobehub

22 stars
246 downloads
Not rated
GitHub

About

A minimal MCP server mock in TypeScript for testing MCP clients, supporting both STDIO and HTTP/SSE protocols.

Details

Author
lobehub
GitHub stars
22
Downloads
246
Categories
Developer Tools, Other

- Minimal MCP server mock for testing
- Supports both STDIO and HTTP/SSE transport protocols
- Provides echo and debug tools with fixed behaviors
- Offers static and dynamic greeting resources
- Fast startup and lightweight dependencies

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP Hello World - MCP Server Mock for Testing
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install as a dev dependency (pnpm add --save-dev mcp-hello-world or bun add --dev mcp-hello-world). Run manually in STDIO mode (npx mcp-hello-world) or HTTP/SSE mode (build then pnpm start:http). Programmatically start and stop the server within test frameworks like Jest or Vitest.

echo

Echoes back a message with 'Hello' prefix

debug

Lists all available tools and methods

add

Adds two numbers

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp hello world - mcp server mock for testing": {
            "mcp-hello-world": {
                "command": "npx",
                "args": [
                    "mcp-hello-world"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-hello-world": {
        "command": "npx",
        "args": [
            "mcp-hello-world"
        ]
    }
}

MCP Hello World - MCP Server Mock for Testing

[![][npm-release-shield]][npm-release-link]
[![][npm-downloads-shield]][npm-downloads-link]
[![][github-action-test-shield]][github-action-test-link]
[![][github-action-release-shield]][github-action-release-link]

[github-action-release-link]: https://github.com/lobehub/mcp-hello-world/actions/workflows/release.yml
[github-action-release-shield]: https://img.shields.io/github/actions/workflow/status/lobehub/mcp-hello-world/release.yml?label=Release&logo=githubactions&logoColor=white&style=flat-square
[github-action-test-link]: https://github.com/lobehub/mcp-hello-world/actions/workflows/test.yml
[github-action-test-shield]: https://img.shields.io/github/actions/workflow/status/lobehub/mcp-hello-world/test.yml?label=Test&logo=githubactions&logoColor=white&style=flat-square
[npm-downloads-link]: https://www.npmjs.com/package/mcp-hello-world
[npm-downloads-shield]: https://img.shields.io/npm/dt/mcp-hello-world?label=Downloads&logo=npm&style=flat-square
[npm-release-link]: https://www.npmjs.com/package/mcp-hello-world
[npm-release-shield]: https://img.shields.io/npm/v/mcp-hello-world?logo=npm&style=flat-square

This is a minimal Model Context Protocol (MCP) server implemented in TypeScript, primarily intended to serve as a Test Double / Mock Server.

Core Purpose: To provide a lightweight, controllable, and predictable MCP server environment for unit testing or integration testing client code that needs to interact with an MCP server.

Note: This project is not suitable for production environments or deployment as a general-purpose MCP server.

MCP Badge

Why Use mcp-hello-world in Tests?

When testing code related to MCP clients, you usually don't want to depend on a real, potentially complex, and unpredictably responsive AI backend service. Using mcp-hello-world as a test double offers several advantages:

1. Isolation: Focus your tests on client logic without worrying about network issues or the availability of the real server.
2. Predictability: The provided echo and debug tools have simple, fixed behaviors, making it easy to write assertions.
3. Speed: Fast startup and response times, suitable for frequent use in unit tests.
4. Lightweight: Few dependencies, easy to integrate into test environments.
5. Protocol Coverage: Supports both STDIO and HTTP/SSE MCP transport protocols, allowing you to test client behavior under different connection methods.

Installation

Add this package as a dev dependency to your project:

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.