loaditout.ai
SkillsPacksTrendingLeaderboardAPI DocsBlogSubmitRequestsCompareAgentsXPrivacyDisclaimer
{}loaditout.ai
Skills & MCPPacksBlog

mcp-test

MCP Tool

0-co/mcp-test

pytest integration and CLI for testing MCP servers — the missing testing layer for MCP

Install

$ npx loaditout add 0-co/mcp-test

Platform-specific configuration:

.claude/settings.json
{
  "mcpServers": {
    "mcp-test": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-test"
      ]
    }
  }
}

Add the config above to .claude/settings.json under the mcpServers key.

About

mcp-pytest

pytest integration and CLI for testing MCP servers.

[](https://pypi.org/project/mcp-pytest/)

pip install mcp-pytest

> After installing, the CLI command is mcp-test. The Python import is from mcp_test import MCPClient.

No other MCP testing tools exist. If you're building a Python MCP server, you need this.

Quick Start

List tools your server exposes:

mcp-test list "python my_server.py"

Call a tool:

mcp-test call "python my_server.py" search '{"query": "hello"}'

Smoke test (verify server starts and tools respond):

mcp-test check "python my_server.py" --smoke
pytest Integration

Write real tests for your MCP server:

# conftest.py
# (no extra setup needed — the mcp_server fixture is auto-registered)

# test_my_server.py
def test_tools_exist(mcp_server):
    tools = mcp_server.list_tools()
    assert len(tools) > 0, "Server should expose at least one tool"

def test_search_returns_results(mcp_server):
    result = mcp_server.call("search", {"query": "python testing"})
    assert isinstance(result, str)
    assert len(result) > 100

def test_tool_handles_empty_input(mcp_server):
    # Should not crash
    result = mcp_server.call_raw("search", {"query": ""})
    assert result.get("isError") is False or "error" in str(result)

Run with:

pytest --mcp-server "python my_server.py"

Or set in pytest.ini:

[pytest]
mcp_server_command = python my_server.py
MCPClient API

Use directly in code (no pytest needed):

from mcp_test import MCPClient

with MCPClient(["python", "my_server.py"]) as server:
    # List all tools
    tools = server.list_tools()   # list of dicts with name/description/inputSchema
    names = server.tool_names()   # just the names

    # Call a tool
    result = server.call("search", {"query": "hello"})   # returns text or list
    raw = server.call_raw("search", {"quer

Tags

cliintegration-testingmcpmcp-servermcp-testingpytestpythontesting

Reviews

Loading reviews...

Quality Signals

0
Installs
Last updated24 days ago
Security: AREADME

Safety

Risk Levelmedium
Data Access
read
Network Accessnone

Details

Sourcegithub-crawl
Last commit3/22/2026
View on GitHub→

Embed Badge

[![Loaditout](https://loaditout.ai/api/badge/0-co/mcp-test)](https://loaditout.ai/skills/0-co/mcp-test)