mcp-chaining
Links development tools such as codebase search and AST analysis to execute multi-step tasks with error handling.
Install
mkdir -p .claude/skills/mcp-chaining && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5268" && unzip -o skill.zip -d .claude/skills/mcp-chaining && rm skill.zipInstalls to .claude/skills/mcp-chaining
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Research-to-implement pipeline chaining 5 MCP tools with graceful degradationKey capabilities
- →Chain MCP tools
- →Automate research-to-implement workflows
- →Handle tool errors gracefully
- →Validate pipeline execution
How it works
The skill chains multiple MCP tools into a pipeline, using a shared context and graceful degradation if tools are unavailable.
Inputs & outputs
When to use mcp-chaining
- →Automating multi-step code refactoring
- →Running complex research-to-implementation tasks
- →Validating code changes across multiple services
About this skill
MCP Chaining Pipeline
A research-to-implement pipeline that chains 5 MCP tools for end-to-end workflows.
When to Use
- Building multi-tool MCP pipelines
- Understanding how to chain MCP calls with graceful degradation
- Debugging MCP environment variable issues
- Learning the tool naming conventions for different MCP servers
What We Built
A pipeline that chains these tools:
| Step | Server | Tool ID | Purpose |
|---|---|---|---|
| 1 | nia | nia__search | Search library documentation |
| 2 | ast-grep | ast-grep__find_code | Find AST code patterns |
| 3 | morph | morph__warpgrep_codebase_search | Fast codebase search |
| 4 | qlty | qlty__qlty_check | Code quality validation |
| 5 | git | git__git_status | Git operations |
Key Files
scripts/research_implement_pipeline.py- Main pipeline implementationscripts/test_research_pipeline.py- Test harness with isolated sandboxworkspace/pipeline-test/sample_code.py- Test sample code
Usage Examples
# Dry-run pipeline (preview plan without changes)
uv run python -m runtime.harness scripts/research_implement_pipeline.py \
--topic "async error handling python" \
--target-dir "./workspace/pipeline-test" \
--dry-run --verbose
# Run tests
uv run python -m runtime.harness scripts/test_research_pipeline.py --test all
# View the pipeline script
cat scripts/research_implement_pipeline.py
Critical Fix: Environment Variables
The MCP SDK's get_default_environment() only includes basic vars (PATH, HOME, etc.), NOT os.environ. We fixed src/runtime/mcp_client.py to pass full environment:
# In _connect_stdio method:
full_env = {**os.environ, **(resolved_env or {})}
This ensures API keys from ~/.claude/.env reach subprocesses.
Graceful Degradation Pattern
Each tool is optional. If unavailable (disabled, no API key, etc.), the pipeline continues:
async def check_tool_available(tool_id: str) -> bool:
"""Check if an MCP tool is available."""
server_name = tool_id.split("__")[0]
server_config = manager._config.get_server(server_name)
if not server_config or server_config.disabled:
return False
return True
# In step function:
if not await check_tool_available("nia__search"):
return StepResult(status=StepStatus.SKIPPED, message="Nia not available")
Tool Name Reference
nia (Documentation Search)
nia__search - Universal documentation search
nia__nia_research - Research with sources
nia__nia_grep - Grep-style doc search
nia__nia_explore - Explore package structure
ast-grep (Structural Code Search)
ast-grep__find_code - Find code by AST pattern
ast-grep__find_code_by_rule - Find by YAML rule
ast-grep__scan_code - Scan with multiple patterns
morph (Fast Text Search + Edit)
morph__warpgrep_codebase_search - 20x faster grep
morph__edit_file - Smart file editing
qlty (Code Quality)
qlty__qlty_check - Run quality checks
qlty__qlty_fmt - Auto-format code
qlty__qlty_metrics - Get code metrics
qlty__smells - Detect code smells
git (Version Control)
git__git_status - Get repo status
git__git_diff - Show differences
git__git_log - View commit history
git__git_add - Stage files
Pipeline Architecture
+----------------+
| CLI Args |
| (topic, dir) |
+-------+--------+
|
+-------v--------+
| PipelineContext|
| (shared state) |
+-------+--------+
|
+-------+-------+-------+-------+-------+
| | | | | |
+---v---+---v---+---v---+---v---+---v---+
| nia |ast-grp| morph | qlty | git |
|search |pattern|search |check |status |
+---+---+---+---+---+---+---+---+---+---+
| | | | |
+-------v-------v-------v-------+
|
+-------v--------+
| StepResult[] |
| (aggregated) |
+----------------+
Error Handling
The pipeline captures errors without failing the entire run:
try:
result = await call_mcp_tool("nia__search", {"query": topic})
return StepResult(status=StepStatus.SUCCESS, data=result)
except Exception as e:
ctx.errors.append(f"nia: {e}")
return StepResult(status=StepStatus.FAILED, error=str(e))
Creating Your Own Pipeline
- Copy the pattern from
scripts/research_implement_pipeline.py - Define your steps as async functions
- Use
check_tool_available()for graceful degradation - Chain results through
PipelineContext - Aggregate with
print_summary()
When not to use it
- →Tasks unrelated to multi-tool MCP chaining
Prerequisites
Limitations
- →Requires MCP tool availability
- →Dependent on environment variables
How it compares
It automates multi-step development workflows by linking specialized tools rather than manual execution.
Compared to similar skills
mcp-chaining side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| mcp-chaining (this skill) | 1 | 7mo | Review | Advanced |
| validate-openapi-specs | 5 | 9mo | Review | Intermediate |
| python-patterns | 6 | 2mo | Review | Beginner |
| massgen-develops-massgen | 1 | 5mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by parcadei
View all by parcadei →You might also like
validate-openapi-specs
epieczko
Validates and registers hook manifest files (YAML) in the Hook Registry for versioned hook management.
python-patterns
affaan-m
Pythonic 惯用法、PEP 8 标准、类型提示以及构建健壮、高效、可维护的 Python 应用程序的最佳实践。
massgen-develops-massgen
massgen
Guide for using MassGen to develop and improve itself. This skill should be used when agents need to run MassGen experiments programmatically (using automation mode) OR analyze terminal UI/UX quality (using visual evaluation tools). These are mutually exclusive workflows for different improvement goals.
wox-plugin-creator
Wox-launcher
Create and scaffold Wox plugins (nodejs, python, script-nodejs, script-python). Use when cloning official SDK templates, generating script plugin templates, or preparing plugins for publish.
klingai-text-to-video
jeremylongshore
Generate videos from text prompts with Kling AI. Use when creating videos from descriptions or learning prompt techniques. Trigger with phrases like 'kling ai text to video', 'klingai prompt', 'generate video from text', 'text2video kling'.
code-changelog
bear2u
AI가 만든 모든 코드 변경사항을 reviews 폴더에 기록하고 간단한 HTML 뷰어로 웹 브라우저에서 실시간 확인할 수 있습니다. 매 수정마다 문서가 생성되고 Python 서버로 즉시 확인 가능합니다.