MCP Server (Claude)
APITestka ships a Model Context Protocol server so Claude Code (or any other
MCP-compatible client) can drive the framework as a tool. The implementation
sits on top of the optional mcp Python SDK; tool dispatch is decoupled
from the network layer so unit tests can call the tools directly.
Installation
pip install 'je_api_testka[mcp]'
Running the server
Three equivalent invocations:
apitestka-mcp
apitestka mcp
python -m je_api_testka.mcp_server
The server uses the standard MCP stdio transport and stays running until the client disconnects.
Tools exposed
Tool |
Purpose |
|---|---|
|
Execute an executor action list |
|
One-shot HTTP request via the |
|
Convert a curl command into an action dict |
|
Convert a HAR file into a list of actions |
|
Markdown report of the current test record |
|
Reconstruct an OpenAPI 3.x document |
|
Wipe success / failure records |
|
Return current success / failure records |
Claude Code configuration
Add the server to ~/.claude/mcp.json:
{
"mcpServers": {
"apitestka": {
"command": "apitestka-mcp"
}
}
}
Tool dispatch in code
from je_api_testka.mcp_server import dispatch_tool
dispatch_tool("apitestka_run_action", {"actions": [["AT_fake_uuid"]]})
dispatch_tool("apitestka_render_markdown", {})