A lightweight Model Context Protocol (MCP) test server providing echo, debug, and greeting capabilities for testing MCP clients with predictable responses over STDIO or HTTP/SSE transports.
A minimal Model Context Protocol (MCP) server implementation designed specifically as a test double/mock server for testing MCP client code. This server provides predictable, simple responses that make it easy to write assertions in unit and integration tests.
This skill is **not for production use**. It serves as a lightweight, controllable MCP server for testing scenarios where you need to:
Use this skill when you need to:
1. **Test MCP client implementations** - Verify your client correctly handles MCP protocol messages
2. **Debug MCP integrations** - Manually inspect request/response flows
3. **Develop against MCP** - Work on MCP features without requiring a full AI service
4. **Validate protocol coverage** - Test client behavior across different transport modes
Install as a development dependency:
```bash
npm install --save-dev mcp-hello-world
pnpm add --save-dev mcp-hello-world
bun add --dev mcp-hello-world
```
Run directly via npx or equivalent:
```bash
npx mcp-hello-world
pnpm dlx mcp-hello-world
bunx mcp-hello-world
```
The server listens on stdin and writes MCP responses to stdout. Connect using MCP Inspector or your client code.
For HTTP-based clients:
```bash
pnpm build # or bun run build
pnpm start:http # or bun run start:http
```
Server runs on `http://localhost:3000` with:
The server provides these fixed MCP capabilities for testing:
**Static Resource: `hello://world`**
**Dynamic Resource: `greeting://{name}`**
**Tool: `echo`**
**Tool: `debug`**
**Prompt: `helpful-assistant`**
```typescript
import { spawn } from 'child_process';
import { MCPClient } from '../src/my-mcp-client';
describe('MCP Client Tests', () => {
let serverProcess;
let client: MCPClient;
beforeAll(() => {
// Spawn mcp-hello-world server
serverProcess = spawn('npx', ['mcp-hello-world']);
// Connect your client to the spawned process
client = new MCPClient(serverProcess.stdin, serverProcess.stdout);
});
afterAll(() => {
serverProcess.kill();
});
it('echoes messages with Hello prefix', async () => {
const response = await client.sendRequest({
jsonrpc: '2.0',
id: 1,
method: 'tools/invoke',
params: { name: 'echo', parameters: { message: 'test' } }
});
expect(response.result.content[0].text).toBe('Hello test');
});
it('retrieves greeting resource', async () => {
const response = await client.sendRequest({
jsonrpc: '2.0',
id: 2,
method: 'resources/get',
params: { uri: 'greeting://Bob' }
});
expect(response.result.data).toBe('Hello Bob!');
});
});
```
1. **Isolation** - Test client logic without external service dependencies
2. **Predictability** - Fixed responses simplify test assertions
3. **Speed** - Fast startup and response times for rapid test cycles
4. **Lightweight** - Minimal dependencies reduce test environment complexity
5. **Protocol Coverage** - Verify client behavior across transport mechanisms
Package: `mcp-hello-world` (npm)
Repository: https://github.com/lobehub/mcp-hello-world
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/mcp-hello-world-test-server/raw