multi-tool-pipeline
Template for chaining multiple MCP tools in a single script
When & Why to Use This Skill
This Claude skill provides a standardized template and reference implementation for chaining multiple Model Context Protocol (MCP) tools into a single, cohesive script. It simplifies the development of complex agentic workflows by demonstrating best practices for sequential tool execution, robust error handling, and efficient data passing between different MCP servers.
Use Cases
- Complex Workflow Automation: Create multi-step pipelines that fetch data from one source (e.g., Perplexity), process it, and output it to another (e.g., a local file or database).
- DevOps & CI/CD Tooling: Chain Git operations with testing and deployment tools to automate repetitive software engineering tasks within a single execution script.
- Custom Agent Development: Use as a boilerplate for building specialized AI agents that require coordinated access to multiple specialized APIs and local environment tools.
| name | multi-tool-pipeline |
|---|---|
| description | Template for chaining multiple MCP tools in a single script |
| allowed-tools | [Bash, Read] |
Multi-Tool Pipeline Template
Reference implementation showing how to chain multiple MCP tools in a script.
When to Use
- As a template when creating new MCP pipeline scripts
- To understand the pattern for tool chaining
- When skill-developer needs to create a new pipeline
The Pattern
async def main():
from runtime.mcp_client import call_mcp_tool
# Step 1: First tool
result1 = await call_mcp_tool("server1__tool1", {"param": "value"})
# Step 2: Use result in next tool
result2 = await call_mcp_tool("server2__tool2", {"input": result1})
# Step 3: Combine/process
return {"combined": result1, "processed": result2}
Example Implementation
See the reference script:
cat $CLAUDE_PROJECT_DIR/scripts/multi_tool_pipeline.py
Run it:
uv run python -m runtime.harness scripts/multi_tool_pipeline.py \
--repo-path "." \
--max-commits 5
Key Elements
- CLI Arguments - Use argparse for parameters
- Sequential Calls - await each tool before the next
- Error Handling - try/except around the pipeline
- Progress Output - print status for visibility
- Structured Return - return combined results
Creating Your Own Pipeline
- Copy
scripts/multi_tool_pipeline.pyas a starting point - Replace the tool calls with your MCP servers/tools
- Adjust CLI arguments for your use case
- Use
/skill-developerto wrap it in a skill
MCP Tool Naming
Tools are named serverName__toolName (double underscore):
await call_mcp_tool("git__git_status", {...})
await call_mcp_tool("firecrawl__firecrawl_scrape", {...})
await call_mcp_tool("perplexity__perplexity_ask", {...})