Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
obra avatar

Mcp Cli

  • 411 installs
  • 401 repo stars
  • Updated June 1, 2026
  • obra/superpowers-lab

mcp-cli is an agent skill that teaches on-demand MCP server discovery and invocation via the `mcp` CLI for developers who need one-off tool calls without permanent integrations.

About

mcp-cli is a superpowers-lab skill that documents the `mcp` CLI (mcptools) for dynamic Model Context Protocol server usage without pre-loading integrations into agent context. Developers install the binary to `~/.local/bin/mcp` by building mcptools from github.com/f/mcptools, then run discovery commands—`mcp tools`, `mcp resources`, and `mcp prompts`—before invoking capabilities with `mcp call`. The skill covers JSON and pretty output formats, server aliases stored in `~/.mcpt/aliases.json`, HTTP/SSE transports, Bearer auth, and a `mcp guard` allow/deny filter for safer exploration. Use mcp-cli to explore unfamiliar MCP servers, debug integrations, or execute one-off filesystem, memory, GitHub, or search server calls without polluting the context window.

  • CLI patterns for MCP tool listing and calls.
  • Debug agent ↔ MCP connectivity issues.
  • Superpowers lab MCP workflow reference.

Mcp Cli by the numbers

  • 411 all-time installs (skills.sh)
  • +14 installs in the week ending Jul 26, 2026 (Skillselion tracking)
  • Ranked #1,911 of 16,659 AI & Agent Building skills by installs in the Skillselion catalog
  • Security screen: HIGH risk (skills.sh audit)
  • Data as of Jul 26, 2026 (Skillselion catalog sync)
npx skills add https://github.com/obra/superpowers-lab --skill mcp-cli

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs411
repo stars401
Security audit0 / 3 scanners passed
Last updatedJune 1, 2026
Repositoryobra/superpowers-lab

How do you call MCP tools from the CLI?

Operate MCP servers from the CLI—list tools, call resources, debug agent integrations.

Who is it for?

Agent developers who want to explore, test, or debug MCP servers on demand without registering permanent MCP integrations.

Skip if: Teams that already committed to a fixed MCP config and only need production wiring docs, not exploratory CLI debugging.

When should I use this skill?

User wants to list MCP tools, make a one-off MCP call, debug an MCP server, or avoid loading MCP integrations into context.

What you get

Discovered MCP tool schemas, executed tool calls, and optional session aliases in `~/.mcpt/aliases.json`.

  • MCP tool discovery output
  • Executed MCP tool call results
  • Optional server alias config

Files

SKILL.mdMarkdownGitHub ↗

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:

# Clone and build
cd /tmp && git clone --depth 1 https://github.com/f/mcptools.git
cd mcptools && CGO_ENABLED=0 go build -o ~/.local/bin/mcp ./cmd/mcptools

Always ensure PATH includes the binary:

export PATH="$HOME/.local/bin:$PATH"

Discovery Workflow

Step 1: Discover Available Tools

mcp tools <server-command>

Examples:

# Filesystem server
mcp tools npx -y @modelcontextprotocol/server-filesystem /path/to/allow

# Memory/knowledge graph server
mcp tools npx -y @modelcontextprotocol/server-memory

# GitHub server (requires token)
mcp tools docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server

# HTTP-based server
mcp tools https://example.com/mcp

Step 2: Discover Resources (if supported)

mcp resources <server-command>

Resources are data sources the server exposes (files, database entries, etc.).

Step 3: Discover Prompts (if supported)

mcp prompts <server-command>

Prompts are pre-defined prompt templates the server provides.

Step 4: Get Detailed Info (JSON format)

# For full schema details including parameter types
mcp tools --format json <server-command>
mcp tools --format pretty <server-command>

Making Tool Calls

Basic Syntax

mcp call <tool_name> --params '<json>' <server-command>

Examples

Read a file:

mcp call read_file --params '{"path": "/tmp/example.txt"}' \
  npx -y @modelcontextprotocol/server-filesystem /tmp

Write a file:

mcp call write_file --params '{"path": "/tmp/test.txt", "content": "Hello world"}' \
  npx -y @modelcontextprotocol/server-filesystem /tmp

List directory:

mcp call list_directory --params '{"path": "/tmp"}' \
  npx -y @modelcontextprotocol/server-filesystem /tmp

Create entities (memory server):

mcp call create_entities --params '{"entities": [{"name": "Project", "entityType": "Software", "observations": ["Uses TypeScript"]}]}' \
  npx -y @modelcontextprotocol/server-memory

Search (memory server):

mcp call search_nodes --params '{"query": "TypeScript"}' \
  npx -y @modelcontextprotocol/server-memory

Complex Parameters

For nested objects and arrays, ensure valid JSON:

mcp call edit_file --params '{
  "path": "/tmp/file.txt",
  "edits": [
    {"oldText": "foo", "newText": "bar"},
    {"oldText": "baz", "newText": "qux"}
  ]
}' npx -y @modelcontextprotocol/server-filesystem /tmp

Output Formats

# Table (default, human-readable)
mcp call <tool> --params '{}' <server>

# JSON (for parsing)
mcp call <tool> --params '{}' -f json <server>

# Pretty JSON (readable JSON)
mcp call <tool> --params '{}' -f pretty <server>

Reading Resources

# List available resources
mcp resources <server-command>

# Read a specific resource
mcp read-resource <resource-uri> <server-command>

# Alternative syntax
mcp call resource:<resource-uri> <server-command>

Using Prompts

# List available prompts
mcp prompts <server-command>

# Get a prompt (may require arguments)
mcp get-prompt <prompt-name> <server-command>

# With parameters
mcp get-prompt <prompt-name> --params '{"arg": "value"}' <server-command>

Server Aliases (for repeated use)

If using a server frequently during a session:

# Create alias
mcp alias add fs npx -y @modelcontextprotocol/server-filesystem /home/user

# Use alias
mcp tools fs
mcp call read_file --params '{"path": "README.md"}' fs

# List aliases
mcp alias list

# Remove when done
mcp alias remove fs

Aliases are stored in ~/.mcpt/aliases.json.

Authentication

HTTP Basic Auth

mcp tools --auth-user "username:password" https://api.example.com/mcp

Bearer Token

mcp tools --auth-header "Bearer your-token-here" https://api.example.com/mcp

Environment Variables (for Docker-based servers)

mcp tools docker run -i --rm \
  -e GITHUB_PERSONAL_ACCESS_TOKEN="$GITHUB_TOKEN" \
  ghcr.io/github/github-mcp-server

Transport Types

Stdio (default for npx/node commands)

mcp tools npx -y @modelcontextprotocol/server-filesystem /tmp

HTTP (auto-detected for http/https URLs)

mcp tools https://example.com/mcp

SSE (Server-Sent Events)

mcp tools http://localhost:3001/sse
# Or explicitly:
mcp tools --transport sse http://localhost:3001

Common MCP Servers

Filesystem

# Allow access to specific directory
mcp tools npx -y @modelcontextprotocol/server-filesystem /path/to/allow

Memory (Knowledge Graph)

mcp tools npx -y @modelcontextprotocol/server-memory

GitHub

export GITHUB_PERSONAL_ACCESS_TOKEN="your-token"
mcp tools docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server

Brave Search

export BRAVE_API_KEY="your-key"
mcp tools npx -y @anthropic/mcp-server-brave-search

Puppeteer (Browser Automation)

mcp tools npx -y @anthropic/mcp-server-puppeteer

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:

mcp call <tool> --params '{}' -f json <server> | jq '.field'

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:

if ! result=$(mcp call tool --params '{}' server 2>&1); then
  echo "Error: $result"
fi

5. Use Aliases for Multi-Step Operations

If making several calls to the same server:

mcp alias add tmp-server npx -y @modelcontextprotocol/server-filesystem /tmp
mcp call list_directory --params '{"path": "/tmp"}' tmp-server
mcp call read_file --params '{"path": "/tmp/file.txt"}' tmp-server
mcp alias remove tmp-server

6. Restrict Capabilities with Guard

For safety, limit what tools are accessible:

# Only allow read operations
mcp guard --allow 'tools:read_*,list_*' --deny 'tools:write_*,delete_*' \
  npx -y @modelcontextprotocol/server-filesystem /home

Debugging

View Server Logs

mcp tools --server-logs <server-command>

Check Alias Configuration

cat ~/.mcpt/aliases.json

Verbose Output

Use --format pretty for detailed JSON output to debug parameter issues.

Quick Reference

ActionCommand
List toolsmcp tools <server>
List resourcesmcp resources <server>
List promptsmcp prompts <server>
Call toolmcp call <tool> --params '<json>' <server>
Read resourcemcp read-resource <uri> <server>
Get promptmcp get-prompt <name> <server>
Add aliasmcp alias add <name> <server-command>
Remove aliasmcp alias remove <name>
JSON outputAdd -f json or -f pretty

Example: Complete Workflow

# 1. Discover what's available
mcp tools npx -y @modelcontextprotocol/server-filesystem /home/user/project

# 2. Check for resources
mcp resources npx -y @modelcontextprotocol/server-filesystem /home/user/project

# 3. Create alias for convenience
mcp alias add proj npx -y @modelcontextprotocol/server-filesystem /home/user/project

# 4. Explore directory structure
mcp call directory_tree --params '{"path": "/home/user/project"}' proj

# 5. Read specific files
mcp call read_file --params '{"path": "/home/user/project/README.md"}' proj

# 6. Search for patterns
mcp call search_files --params '{"path": "/home/user/project", "pattern": "**/*.ts"}' proj

# 7. Clean up alias
mcp alias remove proj

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.

Related skills

How it compares

Use mcp-cli for exploratory or one-off MCP calls; prefer permanent MCP server config when the same tools must load every agent session.

FAQ

What is the mcp-cli skill for?

The mcp-cli skill teaches on-demand MCP usage via the `mcp` CLI: discover tools, resources, and prompts, then invoke them with `mcp call` without permanently loading MCP integrations into agent context.

How do you install the mcp CLI?

The mcp-cli skill builds mcptools from github.com/f/mcptools into `~/.local/bin/mcp` and requires PATH to include that directory before running discovery or call commands.

Is Mcp Cli safe to install?

skills.sh reports 0 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.