MCP HubMCP Hub
willccbb

mcp-client-server

by: willccbb

An MCP Server that's also an MCP Client. Useful for letting Claude develop and test MCPs without needing to reset the application.

115created 10/03/2025
Visit
Claude
testing

📌Overview

Purpose: The MCP Test Client is designed to facilitate the testing of MCP servers during their development by acting both as a testing server and client.

Overview: The MCP Test Client functions as a middleware component, registered with Claude to provide essential testing tools for MCP servers. This dual role enables developers to test their servers in development environments without needing to register them with Claude upfront.

Key Features:

  • Deploy MCP Servers: Allows users to deploy server instances to test environments easily.

  • Custom Tool Invocation: Enables calling specific tools on deployed servers with customizable arguments for tailored testing.

  • Automated Test Suites: Facilitates running predefined test suites to ensure server functionality and reliability.

  • Server Log Access: Provides access to server logs for debugging and monitoring purposes and insights.

  • Pre-Registration Testing: Supports testing servers before they are formally registered with Claude, streamlining the development process.


MCP Test Client

An MCP middleware acting as a server to Claude and a client to servers under test for testing MCP servers during development.

Architecture

The MCP Test Client has a dual role:

  • Server: Registered with Claude to expose testing tools.
  • Client: Connects to and tests other MCP servers.

This architecture allows testing MCP servers without needing to register them directly with Claude.

Features

  • Deploy MCP servers to test environments
  • Call tools with custom arguments
  • Run automated test suites
  • View server logs
  • Test servers before formal registration with Claude

Implementation

Implemented with:

  • Process Management: Manages MCP server processes
  • MCP SDK Client: Communicates with servers using the official MCP SDK
  • Custom Transport: Handles stdio communication
  • Test Execution: Runs tests and validates responses
  • CLI Interface: Interactive testing interface

Current implementation is Phase 1, with future enhancements planned for Phases 2 and 3.

Installation

npm install
npm run build

Usage

As an MCP Server

Registered with Claude via the claude-mcp-local script. Use the following tools:

  1. Deploy a server:

    mcp__mcp-test__mcp_test_deploy_server({
      name: "my-server",
      source_path: "/path/to/server",
      env_vars: {
        "API_KEY": "${API_KEY}"
      }
    })
    
  2. Call a tool on a deployed server:

    mcp__mcp-test__mcp_test_call_tool({
      server_name: "my-server",
      tool_name: "tool_name",
      arguments: {
        // Tool-specific arguments
      }
    })
    
  3. Run tests against a server:

    mcp__mcp-test__mcp_test_run_tests({
      server_name: "my-server"
    })
    
  4. View server logs:

    mcp__mcp-test__mcp_test_get_logs({
      server_name: "my-server",
      lines: 100
    })
    
  5. List deployed servers:

    mcp__mcp-test__mcp_test_list_servers({})
    
  6. Stop a server:

    mcp__mcp-test__mcp_test_stop_server({
      server_name: "my-server"
    })
    

As a CLI Tool

Run the CLI interface for testing:

npm run test
# Or run directly
node dist/test-runner.js

Development Workflow

  1. Develop an MCP server in the playground directory.
  2. Deploy it to the test environment using MCP Test Client.
  3. Test functionality and debug issues.
  4. Fix and iterate until the server functions correctly.
  5. Migrate the server to mcp-servers/ when ready.
  6. Register with Claude through claude-mcp-local.

Future Enhancements

Planned enhancements include:

  • Phase 2: Docker-based container management, comprehensive test suites.
  • Phase 3: Migration tools and advanced test validation.