Mcp Scripts

by parcadeid07ff4b06b62No license3.9K starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated 8 months ago

MCP Script Rules

Instructions onlyAI & Agents
AI-generated overview

Conventions for writing scripts that call MCP tools, covering CLI arguments, naming, error handling and testing.

What it does
This skill provides a set of rules for authoring scripts that invoke MCP tools. It specifies using CLI arguments via argparse, adding a USAGE docstring, calling tools with the call_mcp_tool("server__tool", params) pattern, handling errors with informative messages, and printing results to stdout. It also defines the double-underscore tool ID convention and gives a test command.
When to use it
Use it when creating or revising scripts that call MCP tools, so parameters stay configurable and tool invocation follows the expected pattern. It is also relevant when checking tool naming or how such scripts should be tested.
Requirements
No scripts are shipped; it is instructions only. Following it assumes an environment with Python, the uv runner, and the runtime harness and MCP client modules referenced in the document.

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

Source and attribution

Source:parcadei/continuous-claude-v3in.claude/skills/mcp-scriptsat commitd07ff4b

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal

Mcp Scripts Agent Skill | SourceWeft