mcp-scripts

MCP Script Rules

⭐2.2kstars🔀157forks📁View on GitHub🕐Updated Jan 10, 2026

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.
namemcp-scripts
descriptionMCP Script Rules
user-invocablefalse

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_search
  • ast-grep__ast_grep
  • perplexity__perplexity_ask

Testing

Test with: uv run python -m runtime.harness scripts/<script>.py --help