按需通过 mcp CLI 调用 MCP 服务,发现工具与资源而不预加载上下文
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "mcp-cli" 技能: 1. 下载 https://raw.githubusercontent.com/obra/superpowers-lab/main/skills/mcp-cli/SKILL.md 2. 保存为 ~/.claude/skills/mcp-cli/SKILL.md 3. 装好后重载技能,告诉我可以用了
使用 mcp-cli 帮我列出当前可访问的 MCP 服务器中的工具、资源和提示词,并按用途分组说明。
一份按类别整理的可用能力清单,帮助快速了解能调用什么。
我想自动整理项目文档并检索版本信息,请用 mcp-cli 找出最适合的 MCP 工具或资源,并说明推荐理由。
推荐的 MCP 工具或资源列表,以及每项适用场景与选择依据。
请通过 mcp-cli 临时调用所需 MCP 服务完成一次任务查询,并只返回结果摘要,不要加载无关集成信息。
一次轻量、聚焦的调用结果摘要,避免引入多余上下文。
Use the mcp CLI tool to dynamically discover and invoke MCP server capabilities without pre-configuring them as permanent integrations.
Use this skill when you need to:
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"
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
mcp resources <server-command>
Resources are data sources the server exposes (files, database entries, etc.).
mcp prompts <server-command>
Prompts are pre-defined prompt templates the server provides.
# For full schema details including parameter types
mcp tools --format json <server-command>
mcp tools --format pretty <server-command>
mcp call <tool_name> --params '<json>' <server-command>
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
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
# 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>
# 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>
# 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>
If using a server frequently during a session:
# Create alias
…
帮助用户在 Docker 中创建、管理并通过 SSH 连接无头 Windows 11 虚拟机。
帮助用户在 Claude App 中管理 MCP 服务器并进行包发现与安装