Skip to main content
Glama

mcp-test-mcp

Python Version License: MIT

An MCP server that helps AI assistants test other MCP servers. It provides tools to connect to target MCP servers, discover their capabilities, execute tools, read resources, and test prompts—all through proper MCP protocol communication.

Features

  • Connection Management: Connect to any MCP server (STDIO or HTTP transport), auto-detect protocols, track connection state

  • Tool Testing: List all tools with complete input schemas, call tools with arbitrary arguments, get detailed execution results

  • Resource Testing: List all resources with metadata, read text and binary content

  • Prompt Testing: List all prompts with argument schemas, get rendered prompts with custom arguments

  • LLM Integration: Execute prompts end-to-end with actual LLM inference, supports template variables and JSON extraction

Related MCP server: MCP Workbench MCP Server

Installation

Prerequisites: Node.js 16+ and Python 3.11+

Choose your AI coding tool:

Config file location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%/Claude/claude_desktop_config.json

Configuration:

{
  "mcpServers": {
    "mcp-test-mcp": {
      "command": "npx",
      "args": ["-y", "mcp-test-mcp"]
    }
  }
}

Or use Claude Code CLI:

claude mcp add mcp-test-mcp -- npx -y mcp-test-mcp

Config file location:

  • Global: ~/.cursor/mcp.json

  • Project: .cursor/mcp.json

Or access via: File → Preferences → Cursor Settings → MCP

Configuration:

{
  "mcpServers": {
    "mcp-test-mcp": {
      "command": "npx",
      "args": ["-y", "mcp-test-mcp"]
    }
  }
}

Config file location: ~/.codeium/windsurf/mcp_config.json

Or access via: Windsurf Settings → Cascade → Plugins

Configuration:

{
  "mcpServers": {
    "mcp-test-mcp": {
      "command": "npx",
      "args": ["-y", "mcp-test-mcp"]
    }
  }
}

Requires VS Code 1.99+ with chat.agent.enabled setting enabled.

Config file location:

  • Workspace: .vscode/mcp.json

  • Global: Run MCP: Open User Configuration from Command Palette

Configuration:

{
  "servers": {
    "mcpTestMcp": {
      "command": "npx",
      "args": ["-y", "mcp-test-mcp"]
    }
  }
}

Note: VS Code uses servers instead of mcpServers and recommends camelCase naming.

Config file location: ~/.codex/config.toml

Add via CLI:

codex mcp add mcp-test-mcp -- npx -y mcp-test-mcp

Or add manually to config.toml:

[mcp_servers.mcp-test-mcp]
command = "npx"
args = ["-y", "mcp-test-mcp"]

To use the execute_prompt_with_llm tool, add environment variables to your configuration:

JSON format (Claude, Cursor, Windsurf, VS Code):

{
  "mcpServers": {
    "mcp-test-mcp": {
      "command": "npx",
      "args": ["-y", "mcp-test-mcp"],
      "env": {
        "LLM_URL": "https://your-llm-endpoint.com/v1",
        "LLM_MODEL_NAME": "your-model-name",
        "LLM_API_KEY": "your-api-key"
      }
    }
  }
}

TOML format (Codex):

[mcp_servers.mcp-test-mcp]
command = "npx"
args = ["-y", "mcp-test-mcp"]

[mcp_servers.mcp-test-mcp.env]
LLM_URL = "https://your-llm-endpoint.com/v1"
LLM_MODEL_NAME = "your-model-name"
LLM_API_KEY = "your-api-key"
# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install from PyPI
pip install mcp-test-mcp

# Or install from source
git clone https://github.com/rdwj/mcp-test-mcp
cd mcp-test-mcp
pip install -e ".[dev]"

Command Line Options

The server supports multiple transports for different deployment scenarios:

# Default: stdio transport (for Claude Desktop/Code)
mcp-test-mcp

# Explicit stdio
mcp-test-mcp --transport stdio

# HTTP transport for web deployments
mcp-test-mcp --transport streamable-http
mcp-test-mcp --transport streamable-http --host 0.0.0.0 --port 8080

# Legacy SSE transport (for backward compatibility)
mcp-test-mcp --transport sse --port 9000

Options:

Flag

Short

Description

Default

--transport

-t

Transport type: stdio, streamable-http, sse

stdio

--host

-H

Host to bind (HTTP transports only)

127.0.0.1

--port

-p

Port to bind (HTTP transports only)

8000

Using with npx:

# HTTP server via npx
npx -y mcp-test-mcp --transport streamable-http --port 8080

Quick Start

Once configured, test MCP servers through natural conversation:

  • Connect: "Connect to my MCP server at /path/to/server"

  • Connect with auth: "Connect to https://api.example.com/mcp with auth token sk-..."

  • Connect via npx: "Connect to the server using command npx with args -y @modelcontextprotocol/server-everything"

  • Discover: "What tools does it have?"

  • Test: "Call the echo tool with message 'Hello'"

  • Status: "What's the connection status?"

  • Disconnect: "Disconnect from the server"

Available Tools

Connection Management

  • connect_to_server: Connect to a target MCP server. Supports multiple transport modes and authentication:

    • Auto-detect: Pass a URL for HTTP or a file path for stdio

    • Explicit stdio: Use command/args for npm/pip packages (e.g., command="npx", args=["-y", "some-package"])

    • Auth: Bearer tokens via auth="your-token" or OAuth via auth="oauth"

    • Headers: Custom HTTP headers via headers parameter

  • disconnect: Close active connection

  • get_connection_status: Check connection state and statistics

Tool Testing

  • list_tools: Get all tools with complete schemas

  • call_tool: Execute a tool with arguments

Resource Testing

  • list_resources: Get all resources with metadata

  • read_resource: Read resource content by URI

Prompt Testing

  • list_prompts: Get all prompts with argument schemas

  • get_prompt: Get rendered prompt with arguments

  • execute_prompt_with_llm: Execute prompts with actual LLM inference

Utility

  • health_check: Verify server is running

  • ping: Test connectivity (returns "pong")

  • echo: Echo a message back

  • add: Add two numbers

Environment Variables

Transport Configuration

These environment variables configure the server transport. CLI arguments take precedence.

Variable

Description

Default

MCP_TEST_TRANSPORT

Transport type: stdio, streamable-http, sse

stdio

MCP_TEST_HOST

Host to bind (HTTP transports only)

127.0.0.1

MCP_TEST_PORT

Port to bind (HTTP transports only)

8000

Priority: CLI argument > environment variable > default

Core

  • MCP_TEST_LOG_LEVEL: Logging level (DEBUG, INFO, WARNING, ERROR). Default: INFO

  • MCP_TEST_CONNECT_TIMEOUT: Connection timeout in seconds. Default: 30.0

LLM Integration (for execute_prompt_with_llm)

  • LLM_URL: LLM API endpoint URL

  • LLM_MODEL_NAME: Model name

  • LLM_API_KEY: API key

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run with coverage
pytest --cov=mcp_test_mcp --cov-report=html

# Format and lint
black src/ tests/
ruff check src/ tests/
mypy src/

Container Deployment

For deploying mcp-test-mcp in containers (e.g., OpenShift, Kubernetes):

FROM registry.redhat.io/ubi9/python-311:latest

WORKDIR /app

# Install mcp-test-mcp
RUN pip install --no-cache-dir mcp-test-mcp

# Expose HTTP port
EXPOSE 8000

# Run with streamable-http transport
CMD ["mcp-test-mcp", "--transport", "streamable-http", "--host", "0.0.0.0", "--port", "8000"]

Or use environment variables:

# kubernetes deployment snippet
env:
  - name: MCP_TEST_TRANSPORT
    value: "streamable-http"
  - name: MCP_TEST_HOST
    value: "0.0.0.0"
  - name: MCP_TEST_PORT
    value: "8000"

Documentation

License

MIT License - see LICENSE for details.

Resources

Available Tools

14 tools
addAddA

Add two numbers together.

Inputs: a (required), b (required). Returns: result

call_toolCall ToolA

Execute a tool on the connected MCP server.

Calls a tool by name with the provided arguments and returns the result along with execution timing and metadata.

Returns: Dictionary with tool execution results including: - success: True if tool executed successfully - tool_call: Object with tool_name, arguments, result, and execution metadata - metadata: Request timing and server information

Raises: Returns error dict for various failure scenarios: - not_connected: No active connection - tool_not_found: Tool doesn't exist on server - invalid_arguments: Arguments don't match tool schema - execution_error: Tool execution failed

Inputs: name (required), arguments (required). Returns: object

connect_to_serverConnect To ServerA

Connect to an MCP server for testing.

Establishes a connection to a target MCP server using the appropriate transport protocol (stdio for file paths, streamable-http for URLs, or explicit stdio via command parameter). Only one connection can be active at a time.

Inputs: url (required), cwd, env, args, +3 more. Returns: object

disconnectDisconnectA

Close the current MCP server connection.

Safely disconnects from the active MCP server and clears all connection state and statistics. This method is safe to call even if no connection exists.

Returns: Dictionary with disconnection details including: - success: Always True - message: Human-readable status message - was_connected: Whether a connection existed before disconnect - metadata: Request timing information and previous connection info

Inputs: no named parameters. Returns: object

echoEchoA

Echo back a message.

Inputs: message (required). Returns: result

execute_prompt_with_llmExecute Prompt With LlmA

Execute a prompt with an LLM and return the response.

This tool performs the complete workflow:

  1. Retrieves the prompt from the connected MCP server with prompt_arguments

  2. Optionally fills template variables in the prompt messages

  3. Sends the prompt messages to an LLM

  4. Returns the LLM's response along with metadata

Supports two prompt patterns:

  • Standard MCP prompts: Pass arguments via prompt_arguments, server handles substitution

  • Template variables: Use fill_variables to replace {variable} placeholders in messages

Inputs: prompt_name (required), llm_config, fill_variables, prompt_arguments. Returns: object

get_connection_statusGet Connection StatusA

Check the current MCP server connection state.

Returns detailed information about the active connection including server information, transport type, connection duration, and usage statistics.

Returns: Dictionary with connection status including: - success: Always True - connected: Boolean indicating if currently connected - connection: Full ConnectionState if connected, None otherwise - message: Human-readable status message - metadata: Request timing and connection duration info

Inputs: no named parameters. Returns: object

get_promptGet PromptA

Get a rendered prompt from the connected MCP server.

Retrieves a prompt by name with the provided arguments and returns the rendered prompt messages.

Returns: Dictionary with rendered prompt including: - success: True if prompt was retrieved successfully - prompt: Object with name, description, and rendered messages - metadata: Request timing and server information

Raises: Returns error dict for various failure scenarios: - not_connected: No active connection - prompt_not_found: Prompt doesn't exist on server - invalid_arguments: Arguments don't match prompt schema - execution_error: Prompt retrieval failed

Inputs: name (required), arguments (required). Returns: object

health_checkHealth CheckB

Health check endpoint that verifies the server is running.

Returns: Dictionary with status and server information

Inputs: no named parameters. Returns: object

list_promptsList PromptsA

List all prompts available on the connected MCP server.

Retrieves comprehensive information about all prompts exposed by the target server, including names, descriptions, and complete argument schemas to enable accurate prompt invocation.

Returns: Dictionary with prompt listing including: - success: True on successful retrieval - prompts: List of prompt objects with name, description, and arguments schema - metadata: Total count, server info, timing information

Raises: Returns error dict if not connected or retrieval fails

Inputs: no named parameters. Returns: object

list_resourcesList ResourcesA

List all resources available on the connected MCP server.

Retrieves comprehensive information about all resources exposed by the target server, including URIs, names, descriptions, and MIME types to enable accurate resource access.

Returns: Dictionary with resource listing including: - success: True on successful retrieval - resources: List of resource objects with uri, name, description, mimeType - metadata: Total count, server info, timing information

Raises: Returns error dict if not connected or retrieval fails

Inputs: no named parameters. Returns: object

list_toolsList ToolsA

List all tools available on the connected MCP server.

Retrieves comprehensive information about all tools exposed by the target server, including full input schemas to enable accurate tool invocation.

Returns: Dictionary with tool listing including: - success: True on successful retrieval - tools: List of tool objects with name, description, and full input_schema - metadata: Total count, server info, timing information

Raises: Returns error dict if not connected or retrieval fails

Inputs: no named parameters. Returns: object

pingPingA

Simple ping tool that responds with 'pong'.

Useful for testing basic connectivity and server responsiveness.

Returns: The string 'pong'

Inputs: no named parameters. Returns: result

read_resourceRead ResourceA

Read a specific resource from the connected MCP server.

Reads a resource by URI and returns its content along with metadata.

Returns: Dictionary with resource content including: - success: True if resource was read successfully - resource: Object with uri, mimeType, and content - metadata: Content size and request timing

Raises: Returns error dict for various failure scenarios: - not_connected: No active connection - resource_not_found: Resource doesn't exist on server - execution_error: Resource read failed

Inputs: uri (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool has a clear, distinct purpose: connection lifecycle (connect, disconnect, status), introspection (list tools/resources/prompts), execution (call_tool, read_resource, get_prompt), and a few trivial test utilities (ping, echo, add). No two tools appear to do the same thing, and the descriptions reinforce their uniqueness.

    Naming Consistency3/5

    The majority of tools follow a verb_noun pattern (e.g., list_tools, read_resource, connect_to_server), but there are exceptions like 'disconnect', 'ping', 'echo', and 'add' which are bare verbs or single nouns. This mix is noticeable, though the exceptions are trivial and arguably acceptable for test utilities.

    Tool Count4/5

    At 14 tools, the server provides a comprehensive but focused surface for testing MCP interactions. The count includes both essential operations (connect, list, call, read) and a few trivial tools (ping, echo, add) that serve diagnostic purposes. It is not excessive for the stated goal of an MCP test server.

    Completeness4/5

    The tool set covers the full lifecycle of interacting with an MCP server: connection management, introspection of all primitives (tools, resources, prompts), execution of each type, and a high-level workflow (execute_prompt_with_llm). Missing operations like resource update/delete are not typically required for a test harness, so the surface is sufficiently complete.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to programmatically inspect, test, and validate other MCP servers by exposing MCP Workbench capabilities as structured tools. It supports automated test spec generation, execution, and detailed failure analysis to ensure server reliability.
      4
      7 npm
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      A universal AI-powered testing server built on the Model Context Protocol (MCP). Allows AI agents to inspect, execute, test, monitor, debug, and report on software projects.
      3
      GNU Lesser General Public v2.1 only
    • A
      license
      A
      quality
      D
      maintenance
      Provides testing and quality assurance tools for AI agents via MCP, enabling generation of test cases, mock data, API mocks, coverage analysis, and assertions.
      5
      MIT