API Reference

CLI

mcph run [OPTIONS] FILE
FlagDescription
--transport stdio|httpTransport type (default: stdio)
--command TEXTServer command for stdio
--url TEXTServer URL for HTTP
--reporter console|junit|jsonReport format (repeatable)
--timeout SECONDSRequest timeout (default: 30)
--continue-on-failureRun all steps even if some fail
--verboseShow transport trace
--env KEY=VALUEPass variable (repeatable)
--versionShow version
--helpShow help

DSL Syntax

Connection

CONNECT stdio "python -m my_server"
CONNECT http "https://api.internal/mcp"

Initialization

INITIALIZE protocolVersion="2025-03-26"
CLIENT name="Mcph" version="1.0.0"
  CAPABILITIES roots=true sampling=true

Discovery

LIST tools
LIST prompts
LIST resources

Tool Execution

CALL "tool_name" { "arg": "value", "num": 42 }

Resource Access

READ "file:///path/to/resource"
SUBSCRIBE "file:///path/to/resource"

Prompts

GET prompt "prompt_name" { "language": "rust" }

Notifications

LISTEN "notifications/tools/list_changed" TIMEOUT 5000

Assertions

ASSERT STATUS == 200
ASSERT STATUS == -32602
ASSERT serverInfo.name == "Expected"
ASSERT serverInfo.version MATCHES /^[0-9]+\.[0-9]+\.[0-9]+$/
ASSERT tools COUNT >= 1
ASSERT tools[*] EXISTS name == "run_sql"
ASSERT result.content.text CONTAINS "expected"
ASSERT isError == false

# Fuzzy types
ASSERT result.x == #string
ASSERT result.y == ##number

# Structural equality
ASSERT schema == {
  "type": "object",
  "properties": {
    "name": { "type": "string" }
  }
}

Predicates

PredicateDescription
==Equality
!=Inequality
>, >=, <, <=Numeric comparison
CONTAINSSubstring check
MATCHES /pattern/Regex match
EXISTSJSONPath element existence
COUNTJSONPath match count

Fuzzy Types

TypeDescription
#stringMust be a string
#numberMust be int or float
#booleanMust be bool
#arrayMust be list
#objectMust be dict
##stringOptional: if present, must be string

Variable Capture

CAPTURE var_name: result.field
CAPTURE var_name: result.text regex /pattern/ 1

CALL "tool" { "ref": "{{var_name}}" }

Capability Gating

REQUIRE_CAPABILITY prompts
LIST prompts

REQUIRE_CAPABILITY resources
LIST resources

Variable Injection

SET _meta.protocolVersion = "DRAFT-2026-v1"
HEADER "Authorization" = "Bearer {{TOKEN}}"

Teardown

SHUTDOWN