mcp-yaml-testing
Skill27 starsChanged 10 months agoMITView on GitHub
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).
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-instructions/AGENTS.mdAGENTS.md
- agent-authoringSkill
- mcp-developmentSkill
- mcp-log-debuggingSkill
- mcp-programmatic-testingSkill
- salesforce-developer-site-scraperSkill
- salesforce-help-site-scraperSkill
- skill-authoringSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill when writing or debugging *.test.mcp.yml files for Model Context Protocol servers.
- Distinctive: line 12
CRITICAL: Before writing ANY YAML test, discover actual response formats:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
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:
# Test successful execution
npx aegis query [tool_name] '[valid_params]' --config "./aegis.config.docs-only.json"
# Test failure scenarios
npx aegis query [tool_name] '[invalid_params]' --config "./aegis.config.docs-only.json"
npx aegis query [tool_name] '' --config "./aegis.config.docs-only.json" # Empty paramsParameter 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"
# Nested via dot notation
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" # or "tools/call"
params: {}
expect:
response:
jsonrpc: "2.0"
id: "unique-id"
result: {}
stderr: "toBeEmpty"Common Pattern Reference
# TYPE VALIDATION
result:
tools: "match:type:array"
count: "match:type:number"
# STRING PATTERNS
result:
text: "match:contains:substring"
name: "match:startsWith:prefix"
pattern: "match:regex:\\d{4}-\\d{2}-\\d{2}" # Double-escape backslashes!
# ARRAY PATTERNS
result:
tools: "match:arrayLength:3"
tools:
match:arrayElements:
match:partial: # Flexible - only validate specified fields
name: "match:regex:^[a-z_]+$"
description: "match:contains:tool"
# NEGATION
result:
tools: "match:not:arrayLength:0"
text: "match:not:contains:error"Common Mistakes to Avoid
# ❌ WRONG - Duplicate YAML keys
result:
tools: "match:arrayLength:1"
tools: ["read_file"] # OVERWRITES above!
# ❌ WRONG - Missing double backslash
result:
text: "match:regex:\d+" # Wrong
text: "match:regex:\\d+" # Correct
# ❌ WRONG - Assuming structure without discovery
result:
tools: "match:arrayLength:3" # Did you verify this exists?Test Execution Commands
# Run YAML tests (docs-only mode)
npm run test:mcp:yaml
# Run YAML tests (full mode with credentials)
npm run test:mcp:yaml:full
# Run specific test file
npx aegis "tests/mcp/yaml/specific.test.mcp.yml" --config "./aegis.config.docs-only.json"
# Debug mode
npx aegis "tests/**/*.test.mcp.yml" --config "./aegis.config.docs-only.json" --verbose --debugDiscovery Examples for This Project
# List available tools
npx aegis query --config ./aegis.config.docs-only.json
# Documentation tools
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
# Agent instructions / skills bootstrap
npx aegis query sync_agent_instructions 'destinationType:temp|dryRun:true' --config ./aegis.config.docs-only.json
# Full mode tools (requires credentials)
npx aegis query get_system_object_definitions --config ./aegis.config.with-dw.jsonDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

