mcp-hello-world is a minimalist Model Context Protocol (MCP) server simulation, primarily designed as a test double or mock server for client-side unit and integration testing. Implemented in TypeScript, it offers a lightweight, predictable, and isolated environment for verifying MCP client logic without relying on real, complex, or potentially slow AI backend services. It currently stands at version 1.1.2 (released April 2025) with a recent cadence of small patches. Key differentiators include its support for both STDIO and HTTP/SSE MCP transport protocols, enabling comprehensive client testing across different connection methods. It provides simple `echo` and `debug` tools for predictable behavior, ensuring fast and reliable test execution. This package is explicitly *not* intended for production deployments or as a general-purpose MCP server.
npm install mcp-hello-worldVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to programmatically start `mcp-hello-world` as a child process in STDIO mode within a test suite (e.g., Jest) and interact with it to verify a custom MCP client implementation.
Always use a robust, production-ready MCP server for live applications. Limit `mcp-hello-world` to development and testing environments only.
Follow the documentation's examples for using `child_process.spawn` to manage the server's lifecycle within your test setup. Be mindful of process management (killing the child process) in `afterAll` hooks to prevent resource leaks.
Ensure your project satisfies the `react` and `react-dom` peer dependency range, or be prepared to address npm/yarn warnings. For test environments where these are not strictly needed by `mcp-hello-world` itself, you might choose to ignore these warnings or install compatible versions.
Ensure Node.js and npm/pnpm/bun are correctly installed and their executables are available in your system's PATH. For CI/CD environments, verify the Node.js environment setup steps.
Before sending data to the server, ensure the `mcp-hello-world` child process is still alive and its `stdin` stream is writable. Review your test lifecycle hooks to confirm processes are started before and terminated correctly after interaction.
Verify that `mcp-hello-world` is started in HTTP/SSE mode (e.g., using `pnpm start:http`) and that your client is configured to connect to the correct `localhost:3000` endpoint. Check for potential port conflicts with other applications.