mcp-cli
它能做什么
这个工具让你通过简单的命令,使用电脑上的其他程序和数据。它就像一个遥控器,可以用来访问文件、数据库和其他工具。
适用场景
- ✓当你想查看有哪些可用工具时。
- ✓当你需要了解某个特定工具的详细信息时。
- ✓当你想用特定数据运行某个工具时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/mcp-cli/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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
- Discover:
mcp-cli→ see available servers and tools - Explore:
mcp-cli <server>→ see tools with parameters - Inspect:
mcp-cli <server>/<tool>→ get full JSON input schema - 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: Success1: 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
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。