| name | mcp-yaml-testing |
| description | Guide for writing and debugging YAML-based declarative MCP server tests using Aegis. Use this when asked to create, fix, or debug MCP YAML tests (*.test.mcp.yml files). |
MCP YAML Testing Skill
Use this skill when writing or debugging *.test.mcp.yml files for Model Context Protocol servers.
Golden Rule: Discovery First
CRITICAL: Before writing ANY YAML test, discover actual response formats:
npx aegis query [tool_name] '[valid_params]' --config "./aegis.config.docs-only.json"
npx aegis query [tool_name] '[invalid_params]' --config "./aegis.config.docs-only.json"
npx aegis query [tool_name] '' --config "./aegis.config.docs-only.json"
Parameter Formats
Pipe Format (Recommended)
npx aegis query read_file 'path:test.txt' --config "./aegis.config.docs-only.json"
npx aegis query calculator 'operation:add|a:5|b:3' --config "./aegis.config.docs-only.json"
npx aegis query api_client 'config.host:localhost|config.port:8080' --config "./aegis.config.docs-only.json"
JSON Format (Complex Structures)
npx aegis query complex_tool '{"config": {"host": "localhost"}, "data": [1,2,3]}' --config "./aegis.config.docs-only.json"
Basic Test Structure
description: "Test suite description"
tests:
- it: "Test description"
request:
jsonrpc: "2.0"
id: "unique-id"
method: "tools/list"
params: {}
expect:
response:
jsonrpc: "2.0"
id: "unique-id"
result: {}
stderr: "toBeEmpty"
Common Pattern Reference
result:
tools: "match:type:array"
count: "match:type:number"
result:
text: "match:contains:substring"
name: "match:startsWith:prefix"
pattern: "match:regex:\\d{4}-\\d{2}-\\d{2}"
result:
tools: "match:arrayLength:3"
tools:
match:arrayElements:
match:partial:
name: "match:regex:^[a-z_]+$"
description: "match:contains:tool"
result:
tools: "match:not:arrayLength:0"
text: "match:not:contains:error"
Common Mistakes to Avoid
result:
tools: "match:arrayLength:1"
tools: ["read_file"]
result:
text: "match:regex:\d+"
text: "match:regex:\\d+"
result:
tools: "match:arrayLength:3"
Test Execution Commands
npm run test:mcp:yaml
npm run test:mcp:yaml:full
npx aegis "tests/mcp/yaml/specific.test.mcp.yml" --config "./aegis.config.docs-only.json"
npx aegis "tests/**/*.test.mcp.yml" --config "./aegis.config.docs-only.json" --verbose --debug
Discovery Examples for This Project
npx aegis query --config ./aegis.config.docs-only.json
npx aegis query search_sfcc_classes 'query:catalog' --config ./aegis.config.docs-only.json
npx aegis query get_sfcc_class_info 'className:dw.catalog.Product' --config ./aegis.config.docs-only.json
npx aegis query sync_agent_instructions 'destinationType:temp|dryRun:true' --config ./aegis.config.docs-only.json
npx aegis query get_system_object_definitions --config ./aegis.config.with-dw.json