mcp-scripts
npx machina-cli add skill parcadei/Continuous-Claude-v3/mcp-scripts --openclawMCP Script Rules
When working with files in scripts/:
DO
- Use CLI arguments for all parameters (argparse)
- Include USAGE docstring at top of file
- Use
call_mcp_tool("server__tool", params)pattern - Handle errors gracefully with informative messages
- Print results to stdout for Claude to process
DON'T
- Hardcode parameters in the script
- Edit scripts to change parameters (use CLI args instead)
- Import from servers/ directly (use runtime.mcp_client)
Tool Naming
Tool IDs use double underscore: serverName__toolName
Examples:
morph__warpgrep_codebase_searchast-grep__ast_grepperplexity__perplexity_ask
Testing
Test with: uv run python -m runtime.harness scripts/<script>.py --help
Source
git clone https://github.com/parcadei/Continuous-Claude-v3/blob/main/.claude/skills/mcp-scripts/SKILL.mdView on GitHub Overview
Defines how to build MCP scripts under the scripts/ folder with strict CLI parameterization, docstring usage, and a standardized tool invocation pattern. It codifies the DOs and DON'Ts (use argparse, include a usage docstring, use call_mcp_tool, avoid hardcoding), and ensures outputs are printed to stdout for Claude to process.
How This Skill Works
Scripts must parse all parameters with argparse, include a top-of-file usage docstring, and invoke MCP tools using call_mcp_tool("server__tool", params). Errors are handled gracefully with informative messages, and results are printed to stdout so Claude can process them.
When to Use It
- You need to run server tools from a script in scripts/ with CLI arguments
- You want to avoid hardcoding parameters and rely on CLI inputs
- You must include a top-of-file usage docstring for clarity
- You want to invoke tools via the call_mcp_tool("server__tool", params) pattern
- You require clean stdout output and graceful error messages for Claude
Quick Start
- Step 1: Create scripts/<script>.py with a CLI via argparse
- Step 2: Add a top-of-file usage docstring and use call_mcp_tool("server__tool", params)
- Step 3: Run uv run python -m runtime.harness scripts/<script>.py --help
Best Practices
- Use argparse for all parameters (no hard-coded values)
- Include a top-of-file usage docstring in every script
- Invoke MCP tools with call_mcp_tool("server__tool", params)
- Avoid editing parameters in the script; rely on CLI args
- Print results to stdout and handle errors with informative messages
Example Use Cases
- morph__warpgrep_codebase_search: scripted tool call with CLI args
- ast-grep__ast_grep: parameterized script invocation
- perplexity__perplexity_ask: CLI-driven questions
- script using runtime.mcp_client instead of importing servers/ directly
- script that includes a top-of-file usage docstring and prints stdout