{"library":"mcp-hello-world","title":"MCP Hello World Server Simulator","description":"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.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install mcp-hello-world"],"cli":null},"imports":["import * as MCPHelloWorld from 'mcp-hello-world'","import { spawn } from 'child_process'","import type { ChildProcess } from 'child_process'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { spawn } from 'child_process';\n// Assume './my-mcp-client' is your custom client implementation\n// that connects to stdin/stdout streams.\nimport { MCPClient } from './my-mcp-client'; \n\ndescribe('My MCP Client (STDIO mode)', () => {\n  let mcpServerProcess: ReturnType<typeof spawn>;\n  let client: MCPClient; // Assume MCPClient accepts Readable/Writable streams\n\n  beforeAll(() => {\n    // Start mcp-hello-world as a child process in STDIO mode\n    mcpServerProcess = spawn('npx', ['mcp-hello-world']);\n\n    // Instantiate your client and connect it to the spawned process's stdio streams\n    client = new MCPClient(mcpServerProcess.stdin, mcpServerProcess.stdout);\n\n    // Optional: Log server output for debugging purposes\n    mcpServerProcess.stdout.on('data', (data) => console.log(`MCP Server STDOUT: ${data}`));\n    mcpServerProcess.stderr.on('data', (data) => console.error(`MCP Server STDERR: ${data}`));\n  });\n\n  afterAll(() => {\n    // Ensure the server process is terminated after all tests are done\n    if (mcpServerProcess) {\n      mcpServerProcess.kill();\n    }\n  });\n\n  it('should receive an echo response from the mock server', async () => {\n    const request = {\n      jsonrpc: '2.0',\n      id: 1,\n      method: 'tools/invoke',\n      params: { name: 'echo', parameters: { message: 'hello test' } }\n    };\n\n    // Assuming client.sendRequest handles JSON-RPC messaging over streams\n    const response = await client.sendRequest(request);\n\n    expect(response).toEqual({\n      jsonrpc: '2.0',\n      id: 1,\n      result: { content: [{ type: 'text', text: 'Hello hello test' }] }\n    });\n  });\n});","lang":"typescript","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}