mcp-cli-scripts▌
jezweb/claude-skills · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
Companion CLI scripts for MCP servers with file I/O, batch processing, and local caching.
- ›Provides one script per MCP tool with extended capabilities: batch input/output files, result caching, multiple output formats (JSON, CSV, table), and parallel processing
- ›Uses consistent argument patterns across all scripts ( --input , --output , --format , --profile , --verbose ) for predictable developer experience
- ›Scripts output structured JSON by default for easy parsing by Claude Code, with
MCP CLI Scripts Pattern
Status: Production Ready Last Updated: 2026-01-09 Dependencies: tsx (dev dependency) Current Versions: [email protected]
Why CLI Scripts Alongside MCP Servers?
When building MCP servers, also create companion CLI scripts that provide the same (and often extended) functionality for use with Claude Code in terminal environments.
| Aspect | Remote MCP (Claude.ai) | CLI Scripts (Claude Code) |
|---|---|---|
| Context | Results flow through model context window | Results stay local, only relevant parts shared |
| File System | No access | Full read/write access |
| Batch Operations | One call at a time | Can process files of inputs |
| Caching | Stateless | Can cache results locally |
| Output | JSON to model | JSON, CSV, table, file, or stdout |
| Chaining | Model orchestrates | Scripts can pipe/chain directly |
Directory Structure
mcp-{name}/
├── src/
│ └── index.ts # MCP server (for Claude.ai, remote clients)
├── scripts/
│ ├── {tool-name}.ts # One script per tool
│ ├── {another-tool}.ts
│ └── _shared.ts # Shared auth/config helpers (optional)
├── SCRIPTS.md # Documents available scripts for Claude Code
├── package.json
└── README.md
The 5 Design Principles
1. One Script Per Tool
Each script does one thing well, matching an MCP tool but with extended capabilities.
2. JSON Output by Default
Scripts output JSON to stdout for easy parsing. Claude Code can read and use the results.
// Good - structured output
console.log(JSON.stringify({ success: true, data: result }, null, 2));
// Avoid - unstructured text (unless --format text requested)
console.log("Found 5 results:");
3. Extended Capabilities for Local Use
CLI scripts can offer features that don't make sense for remote MCP:
// Input/Output files
--input data.csv // Batch process from file
--output results.json // Save results to file
--append // Append to existing file
// Caching
--cache // Use local cache
--cache-ttl 3600 // Cache for 1 hour
--no-cache // Force fresh request
// Output formats
--format json|csv|table // Different output formats
--quiet // Suppress non-essential output
--verbose // Extra debugging info
// Batch operations
--batch // Process multiple items
--concurrency 5 // Parallel processing limit
4. Consistent Argument Patterns
Use consistent patterns across all scripts:
# Standard patterns
--input <file> # Read input from file
--output <file> # Write output to file
--format <type> # Output format
--profile <name> # Auth profile (for multi-account)
--verbose # Debug output
--help # Show usage
5. Shebang and Direct Execution
Scripts should be directly executable:
#!/usr/bin/env npx tsx
/**
* Brief description of what this script does
*
* Usage:
* npx tsx scripts/tool-name.ts <required-arg>
* npx tsx scripts/tool-name.ts --option value
*
* Examples:
* npx tsx scripts/tool-name.ts 12345
* npx tsx scripts/tool-name.ts --input batch.csv --output results.json
*/
Critical Rules
Always Do
✅ Use #!/usr/bin/env npx tsx shebang (not node or ts-node)
✅ Output JSON to stdout by default
✅ Use consistent argument patterns across all scripts
✅ Document scripts in SCRIPTS.md
✅ Handle errors with structured JSON: { success: false, error: "..." }
Never Do
❌ Use console.log() for prose output (use structured JSON)
❌ Use different argument patterns per script
❌ Forget to document the script in SCRIPTS.md
❌ Use node or ts-node in shebang (tsx handles ESM+TypeScript)
When to Use Scripts vs MCP
Use CLI scripts when:
- Working in terminal/Claude Code environment
- Need to save results to files
- Processing batch inputs from files
- Chaining multiple operations
- Need caching for repeated lookups
- Want richer output formats
Use MCP tools when:
- In Claude.ai web interface
- Simple one-off lookups
- No file I/O needed
- Building conversational flows
Shared Code Between MCP and Scripts
If you want to share logic between MCP and scripts, extract to a core module:
src/
├── core/
│ ├── lookup.ts # Pure function, no I/O assumptions
│ └── index.ts # Export all core functions
├── mcp/
│ └── index.ts # MCP handlers, import from core
└── cli/
└── lookup.ts # CLI wrapper, import from core
However, keeping them separate is also fine - the scripts may evolve to have capabilities the MCP can't support, and that's okay.
Using Bundled Resources
Templates (templates/)
script-template.ts: Complete TypeScript script template with argument parsing, JSON output, and file I/O patterns.
# Copy to your project
cp ~/.claude/skills/mcp-cli-scripts/templates/script-template.ts scripts/new-tool.ts
SCRIPTS-TEMPLATE.md: Template for documenting available scripts in an MCP server repo.
# Copy to your project
cp ~/.claude/skills/mcp-cli-scripts/templates/SCRIPTS-TEMPLATE.md SCRIPTS.md
Rules (rules/)
mcp-cli-scripts.md: Correction rules for script files. Copy to .claude/rules/ in projects:
cp ~/.claude/skills/mcp-cli-scripts/rules/mcp-cli-scripts.md .claude/rules/
Dependencies
Required:
- [email protected] - TypeScript execution without compilation
Add to package.json:
{
"devDependencies": {
"tsx": "^4.21.0"
}
}
Official Documentation
- tsx: https://github.com/privatenumber/tsx
- Node.js CLI: https://nodejs.org/api/cli.html
Package Versions (Verified 2026-01-09)
{
"devDependencies": {
"tsx": "^4.21.0"
}
}
Complete Setup Checklist
- Create
scripts/directory in MCP server project - Add tsx to devDependencies
- Create first script from template
- Create SCRIPTS.md from template
- Test script:
npx tsx scripts/tool-name.ts --help - Verify JSON output format
- Document all scripts in SCRIPTS.md
How to use mcp-cli-scripts on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add mcp-cli-scripts
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches mcp-cli-scripts from GitHub repository jezweb/claude-skills and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate mcp-cli-scripts. Access the skill through slash commands (e.g., /mcp-cli-scripts) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
User Story & Requirements Generation
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Competitive Analysis
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Roadmap Prioritization
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
Make data-driven prioritization decisions faster
Stakeholder Communication
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client
- ›Access to product documentation and roadmap tools (Jira, Notion, etc.)
- ›Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
- ›Stakeholder contact information and communication channels
Time Estimate
30-60 minutes to see productivity improvements
Installation Steps
- 1.Install product management skill
- 2.Start with user story generation for known feature
- 3.Progress to competitive analysis: research 2-3 competitors
- 4.Use for roadmap prioritization: apply RICE/ICE scoring
- 5.Draft stakeholder communications and refine based on feedback
- 6.Build template library for recurring PM tasks
- 7.Share effective prompts with product team
Common Pitfalls
- ⚠Not validating competitive research—verify facts before sharing
- ⚠Accepting user stories without involving engineering team
- ⚠Over-relying on frameworks without qualitative judgment
- ⚠Not customizing outputs to company culture and communication style
- ⚠Skipping stakeholder validation of generated requirements
Best Practices▌
✓ Do
- +Validate research and competitive analysis with real data
- +Collaborate with engineering when generating technical requirements
- +Customize frameworks and templates to your company context
- +Use skill for first drafts, refine with stakeholder input
- +Document successful prompt patterns for PM tasks
- +Combine AI efficiency with human judgment and intuition
✗ Don't
- −Don't publish competitive analysis without fact-checking
- −Don't finalize user stories without engineering review
- −Don't make prioritization decisions solely on AI scoring
- −Don't skip customer validation of generated requirements
- −Don't ignore company-specific context and culture
💡 Pro Tips
- ★Provide context: company goals, constraints, customer feedback
- ★Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
- ★Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
- ★Use skill for 70% generation + 30% customization to company needs
When to Use This▌
✓ Use When
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid When
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
Learning Path▌
- 1Basic: user stories, feature specs, status updates
- 2Intermediate: competitive analysis, prioritization frameworks, PRDs
- 3Advanced: product strategy, go-to-market planning, OKR setting
- 4Expert: product vision, market positioning, business model innovation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.5★★★★★43 reviews- ★★★★★Shikha Mishra· Dec 28, 2024
Keeps context tight: mcp-cli-scripts is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Michael Ramirez· Dec 24, 2024
Keeps context tight: mcp-cli-scripts is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Ganesh Mohane· Dec 20, 2024
mcp-cli-scripts reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Mateo Iyer· Dec 16, 2024
mcp-cli-scripts reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Diego Ramirez· Dec 4, 2024
mcp-cli-scripts is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Naina Shah· Dec 4, 2024
We added mcp-cli-scripts from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Valentina Zhang· Nov 23, 2024
Solid pick for teams standardizing on skills: mcp-cli-scripts is focused, and the summary matches what you get after install.
- ★★★★★Sakshi Patil· Nov 11, 2024
I recommend mcp-cli-scripts for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Hassan Tandon· Nov 7, 2024
I recommend mcp-cli-scripts for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Michael Kim· Oct 26, 2024
Useful defaults in mcp-cli-scripts — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
showing 1-10 of 43