mcp-scripts
MCP Script Rules
When & Why to Use This Skill
This Claude skill establishes a standardized framework for developing and maintaining robust MCP (Model Context Protocol) scripts. By enforcing best practices such as CLI-based parameterization, consistent tool naming conventions, and structured error handling, it ensures that scripts are highly reusable, testable, and optimized for seamless integration with AI agents.
Use Cases
- Standardizing Script Development: Use these rules to ensure all automation scripts follow a consistent pattern, making them easier for AI agents to discover and execute correctly.
- Enhancing Tool Reliability: Implement the recommended error handling and stdout logging patterns to provide clear feedback to the agent, reducing execution failures.
- Optimizing Agent-Tool Interaction: Apply the specific 'server__tool' naming convention and CLI argument requirements to help Claude accurately parameterize and invoke complex backend tools.
- Streamlining Testing and QA: Utilize the standardized testing harness and USAGE docstring requirements to verify script functionality before deployment in agentic workflows.
| name | mcp-scripts |
|---|---|
| description | MCP Script Rules |
| user-invocable | false |
MCP 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