56 results available
Sign in
Skills directory

mcp-cli

github

·

Last changed
Not yet hardened

This version isn't hardened by Chainguard

No hardening report available.


SKILL.md

MCP-CLI

Access MCP servers through the command line. MCP enables interaction with external systems like GitHub, filesystems, databases, and APIs.

Commands

CommandOutput

mcp-cli

List all servers and tool names

mcp-cli <server>

Show tools with parameters

mcp-cli <server>/<tool>

Get tool JSON schema

mcp-cli <server>/<tool> '<json>'

Call tool with arguments

mcp-cli grep "<glob>"

Search tools by name

Add -d to include descriptions (e.g., mcp-cli filesystem -d)

Workflow

  1. Discover: mcp-cli → see available servers and tools
  2. Explore: mcp-cli <server> → see tools with parameters
  3. Inspect: mcp-cli <server>/<tool> → get full JSON input schema
  4. Execute: mcp-cli <server>/<tool> '<json>' → run with arguments

Security

Examples

# List all servers and tool names
mcp-cli

# See all tools with parameters
mcp-cli filesystem

# With descriptions (more verbose)
mcp-cli filesystem -d

# Get JSON schema for specific tool
mcp-cli filesystem/read_file

# Call the tool
mcp-cli filesystem/read_file '{"path": "./README.md"}'

# Search for tools
mcp-cli grep "*file*"

# JSON output for parsing
mcp-cli filesystem/read_file '{"path": "./README.md"}' --json

# Complex JSON with quotes (use heredoc or stdin)
mcp-cli server/tool <<EOF
{"content": "Text with 'quotes' inside"}
EOF

# Or pipe from a file/command (ensure args.json contains trusted, validated content)
mcp-cli server/tool < args.json

# Find all TypeScript files and safely read the first one (safe two-step pattern)
# jq's 'first(...)' extracts the first non-null text value; '// empty' ensures
# no output (rather than a null literal) when the result is missing.
FIRST_FILE=$(mcp-cli filesystem/search_files '{"path": "src/", "pattern": "*.ts"}' --json \
  | jq -r 'first(.content[]?.text // empty) // empty')

# Only proceed if a file path was actually returned
if [[ -n "$FIRST_FILE" ]]; then
  # jq --arg passes $FIRST_FILE as a typed JSON string, preventing injection
  mcp-cli filesystem/read_file "$(jq -nc --arg p "$FIRST_FILE" '{"path":$p}')"
fi

Options

FlagPurpose

-j, --json

JSON output for scripting

-r, --raw

Raw text content

-d

Include descriptions

Exit Codes

  • 0: Success
  • 1: Client error (bad args, missing config)
  • 2: Server error (tool failed)
  • 3: Network error

Install

Need this version hardened?

Harden your own skills

Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.

Provenance

Upstream source

—

Upstream commitc7825d3ac1f7477a0520b01f95058aaae5220753
OCI reference

—

License

MIT

Files

HARDENING.md

LICENSE

SKILL.md


The trusted source for open source

Talk to an expert
PrivacyTerms

Product

Chainguard ContainersChainguard LibrariesChainguard VMsChainguard OS PackagesChainguard ActionsChainguard Agent SkillsIntegrationsPricing
© 2026 Chainguard, Inc. All Rights Reserved.
Chainguard® and the Chainguard logo are registered trademarks of Chainguard, Inc. in the United States and/or other countries.
The other respective trademarks mentioned on this page are owned by the respective companies and use of them does not imply any affiliation or endorsement.