mcp-cli

Use MCP servers on-demand via the mcp CLI tool - discover tools, resources, and prompts without polluting context with pre-loaded MCP integrations

By obra · 449 installs

npx skills add obra/superpowers-lab --skill mcp-cli

Source repository · Upstream listing

MCP CLI: On Demand MCP Server Usage Use the mcp CLI tool to dynamically discover and invoke MCP server capabilities without pre configuring them as permanent integrations. When to Use This Skill Use this skill when you need to: Explore an MCP server's capabilities before deciding to use it Make one off calls to an MCP server without permanent integration Access MCP functionality without polluting the context window Test or debug MCP servers Use MCP servers that aren't pre configured Prerequisites The mcp CLI must be installed at ~/.local/bin/mcp . If not present: Always ensure PATH includes the binary: Discovery Workflow Step 1: Discover Available Tools Examples: Step 2: Discover Resources (if supported) Resources are data sources the server exposes (files, database entries, etc.). Step 3: Discover Prompts (if supported) Prompts are pre defined prompt templates the server provides. Step 4: Get Detailed Info (JSON format) Making Tool Calls Basic Syntax Examples Read a file: Write a file: List directory: Create entities (memory server): Search (memory server): Complex Parameters For nested objects and arrays, ensure valid JSON: Output Formats Reading Resources Using Prompts Server Aliases (for repeated use) If using a server frequently during a session: Aliases are stored in ~/.mcpt/aliases.json . Authentication HTTP Basic Auth Bearer Token Environment Variables (for Docker based servers) Transport Types Stdio (default for npx/node commands) HTTP (auto detected for http/https URLs) SSE (Server Sent Events) Common MCP Servers Filesystem Memory (Knowledge Graph) GitHub Brave Search Puppeteer (Browser Automation) Best Practices 1. Always Discover First Before calling tools, run mcp tools to understand what's available and the exact parameter schema. 2. Use JSON Format for Parsing When you need to process results programmatically: 3. Validate Parameters The table output shows parameter signatures. Match them exactly: param:str = string param:num = number param:bool = boolean param:str[] = array of strings [param:str] = optional parameter 4. Handle Errors Gracefully Tool calls may fail. Check exit codes and stderr: 5. Use Aliases for Multi Step Operations If making several calls to the same server: 6. Restrict Capabilities with Guard For safety, limit what tools are accessible: Debugging View Server Logs Check Alias Configuration Verbose Output Use format pretty for detailed JSON output to debug parameter issues. Quick Reference Action Command List tools mcp tools <server List resources mcp resources <server List prompts mcp prompts <server Call tool mcp call <tool params '<json ' <server Read resource mcp read resource <uri <server Get prompt mcp get prompt <name <server Add alias mcp alias add <name <server command Remove alias mcp alias remove <name JSON output Add f json or f pretty Example: Complete Workflow Troubleshooting "command not found: mcp" Ensure PATH is set: export PATH="$HOME/.local/bin:$PATH" JSON parse errors Escape special characters properly Avoid shell expansion issues by using single quotes around JSON For complex JSON, write to a temp file and use params "$(cat params.json)" Server timeout Some servers take time to start. The mcp CLI waits for initialization automatically. Permission denied For filesystem server, ensure the allowed directory path is correct and accessible.