跳到正文
Skillpedia
智能体40k · #7277

mcp-cli

它能做什么

这个工具让你通过简单的命令,使用电脑上的其他程序和数据。它就像一个遥控器,可以用来访问文件、数据库和其他工具。

适用场景

  • ✓当你想查看有哪些可用工具时。
  • ✓当你需要了解某个特定工具的详细信息时。
  • ✓当你想用特定数据运行某个工具时。

技能链接

https://github.com/github/awesome-copilot/blob/main/skills/mcp-cli/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/github/awesome-copilot/blob/main/skills/mcp-cli/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“有哪些可用的工具?”

每周 5 个新技能,1 分钟读完。

工作原理

你输入一条命令,指定要使用的服务器或工具;如果需要,还要按照特定格式(JSON)提供它所需的信息。工具随后会执行操作,并把结果展示给你。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

MCP-CLI

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

Commands

Command Output
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

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
cat args.json | mcp-cli server/tool

# Find all TypeScript files and read the first one
mcp-cli filesystem/search_files '{"path": "src/", "pattern": "*.ts"}' --json | jq -r '.content[0].text' | head -1 | xargs -I {} sh -c 'mcp-cli filesystem/read_file "{\"path\": \"{}\"}"'

Options

Flag Purpose
-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
常见问题

什么是 MCP?

MCP 是一种协议,让不同的程序之间能够相互通信,并访问其他系统中的数据或功能。

什么是 JSON?

JSON 是一种简单的文本格式,用于在程序之间组织和交换信息。它就像一个带有名称和值的有序列表。

我怎么知道该给工具提供什么信息?

你可以查看某个特定工具的详情(例如运行 `mcp-cli tool_name`),了解它需要哪些信息。

详情

作者的原始描述

Interface for MCP (Model Context Protocol) servers via CLI. Use when you need to interact with external tools, APIs, or data sources through MCP servers, list available MCP servers/tools, or call MCP tools from command line.

repo: github/awesome-copilot

热度

GitHub 星标
40k
排名
#7277
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能