Agent Skills: MCP Mock Client

Create mock MCP client for server testing with request/response simulation.

UncategorizedID: a5c-ai/babysitter/mcp-mock-client

Install this agent skill to your local

pnpm dlx add-skill https://github.com/a5c-ai/babysitter/tree/HEAD/plugins/babysitter/skills/babysit/process/specializations/cli-mcp-development/skills/mcp-mock-client

Skill Files

Browse the full folder contents for mcp-mock-client.

Download Skill

Loading file tree…

plugins/babysitter/skills/babysit/process/specializations/cli-mcp-development/skills/mcp-mock-client/SKILL.md

Skill Metadata

Name
mcp-mock-client
Description
Create mock MCP client for server testing with request/response simulation.

MCP Mock Client

Create mock MCP client for server testing.

Generated Patterns

import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
import { spawn } from 'child_process';

export async function createTestClient(serverCmd: string, args: string[]) {
  const proc = spawn(serverCmd, args, { stdio: ['pipe', 'pipe', 'inherit'] });
  const transport = new StdioClientTransport({ reader: proc.stdout!, writer: proc.stdin! });
  const client = new Client({ name: 'test-client', version: '1.0.0' }, { capabilities: {} });
  await client.connect(transport);
  return { client, close: () => proc.kill() };
}

export async function testTool(client: Client, name: string, args: Record<string, unknown>) {
  const result = await client.callTool({ name, arguments: args });
  return result;
}

Target Processes

  • mcp-server-testing-suite
  • mcp-tool-implementation