mcp-chaining
Research-to-implement pipeline chaining 5 MCP tools with graceful degradation
By parcadei · 477 installs
npx skills add parcadei/continuous-claude-v3 --skill mcp-chaining
Source repository · Upstream listing
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 implementation
scripts/test research pipeline.py Test harness with isolated sandbox
workspace/pipeline test/sample code.py Test sample code
Usage Examples
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:
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:
Tool Name Reference
nia (Documentation Search)
ast grep (Structural Code Search)
morph (Fast Text Search + Edit)
qlty (Code Quality)
git (Version Control)
Pipeline Architecture
Error Handling
The pipeline captures errors without failing the entire run:
Creating Your Own Pipeline
1. Copy the pattern from scripts/research implement pipeline.py
2. Define your steps as async functions
3. Use check tool available() for graceful degradation
4. Chain results through PipelineContext
5. Aggregate with print summary()