Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计异常

using-mcpusing MCP 命令行

Agent Skill

using-mcp 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

279

周安装

12

GitHub Stars

4,767

下载量

98
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:using-mcp(using MCP 命令行)
来源仓库:https://github.com/dtyq/magic
仓库路径:skills/using-mcp
安装命令:
npx skills add https://github.com/dtyq/magic --skill using-mcp
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dtyq/magic --skill using-mcp

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合围绕仓库状态、代码变更或协作事项进行整理分析。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装使用。
  • 安装前建议确认权限范围和维护状态,注意可能触发联网或文件读写操作。
  • using-mcp 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

MCP Tools Calling Skill

Query MCP server information, tool lists, and schemas through scripts, and call MCP tools via SDK.

Core Capabilities

  • Query MCP server list and status
  • List all available MCP tools
  • Get JSON Schema definitions of tools
  • Call MCP tools and get results
  • Dynamically add new MCP servers (effective at runtime, optionally persisted)

Important Rules

1. DO NOT imagine tool names and parameters

Before calling mcp.call(), you MUST first query and confirm through scripts:

  1. Whether the tool exists on that server (via get_tools.py) - REQUIRED
  2. The tool's parameter definition (via get_tool_schema.py) - REQUIRED
  3. Server list (via get_servers.py) - Optional, usually provided in user prompts

STRICTLY FORBIDDEN to call MCP tools based on imagination or experience without querying first. Even if you think a tool "should" exist, you must query to confirm it first.

2. mcp.call() is NOT a tool name

STRICTLY FORBIDDEN to call the following as tool names:

  • from sdk.mcp import mcp
  • mcp.call
  • mcp.call()

mcp.call() is a Python SDK method that must be executed within Python code using the run_sdk_snippet tool.

Wrong Example:

# Wrong! Do NOT do this
tool_call(name="from sdk.mcp import mcp", arguments={})
tool_call(name="mcp.call", arguments={...})

Correct Example:

# Correct! Use run_sdk_snippet tool
run_sdk_snippet(
    python_code="""
from sdk.mcp import mcp
result = mcp.call(...)
"""
)

Key Principles

Script Execution

Scripts use standard command-line arguments, for example:

  • python scripts/get_servers.py
  • python scripts/get_tools.py --server-name <服务器名称>

In Agent environment, use shell_exec tool to execute scripts:

# 获取服务器列表
shell_exec(
    command="python scripts/get_servers.py"
)

# 获取指定服务器的工具列表
shell_exec(
    command="python scripts/get_tools.py --server-name <服务器名称>"
)

# 获取工具 Schema
shell_exec(
    command="python scripts/get_tool_schema.py --server-name <服务器名称> --tool-name <工具名称>"
)

MCP Tool Calling

Important Note: mcp.call() is NOT a standalone tool, but an SDK method called within Python code.

In Agent environment, use run_sdk_snippet tool to execute Python code containing mcp.call() (MUST first query and confirm server and tool existence via scripts):

# 使用 run_sdk_snippet 工具执行以下 Python 代码
run_sdk_snippet(
    python_code="""
from sdk.mcp import mcp

result = mcp.call(
    server_name="<服务器名称>",  # 必须是通过 get_servers.py 查询到的真实服务器名
    tool_name="<工具名称>",      # 必须是通过 get_tools.py 查询到的真实工具名
    tool_params={"参数": "值"}  # 必须符合 get_tool_schema.py 返回的 Schema
)

if result.ok:
    print(result.content)
else:
    print(f"调用失败: {result.content}")
"""
)

Quick Start

Step 0: Query Server List (Optional)

If unsure which MCP servers are available, run the script to query:

python scripts/get_servers.py

Step 1: Query Tool List (Required)

MUST query the available tool list for the specified server:

python scripts/get_tools.py --server-name <服务器名称>

Step 2: Get Tool Schema (Required)

MUST get the tool's parameter definition:

python scripts/get_tool_schema.py --server-name <服务器名称> --tool-name <工具名称>

Step 3: Call MCP Tool (Required)

After confirming tool and parameters, use run_sdk_snippet tool to execute code containing mcp.call():

# 使用 run_sdk_snippet 工具
run_sdk_snippet(
    python_code="""
from sdk.mcp import mcp

result = mcp.call(
    server_name="<服务器名称>",  # 从用户提示词或 Step 0 中获取
    tool_name="<工具名称>",      # 从 Step 1 查询结果中获取
    tool_params={"参数": "值"}  # 根据 Step 2 的 Schema 定义构造
)

if result.ok:
    print(result.content)
else:
    print(f"调用失败: {result.content}")
"""
)

Workflow

MUST follow this workflow:

[If you need to add a new server first]
A. Add MCP server (add_server.py) - Optional
   ↓ Server is immediately available after success; output includes tool list,
     so you can skip steps 0 and 1

[To call tools on an existing server]
0. [Optional] Get server list (get_servers.py)
   ↓ Query if unsure which servers are available
1. View tool list (get_tools.py) - REQUIRED
   ↓ Confirm tool exists on that server
2. Get tool schema (get_tool_schema.py) - REQUIRED
   ↓ Understand required parameters and types
3. Validate parameters - REQUIRED
   ↓ Ensure all required parameters are provided with correct types
4. Call tool (mcp.call) - REQUIRED

WARNING: Skipping tool list and schema query steps and calling tools directly will fail due to non-existent tools or incorrect parameters.

Available Scripts

add_server.py - Add MCP Server Dynamically

Dynamically add a new MCP server to the running system, effective immediately. Only valid for the current runtime session.

SYNOPSIS

python scripts/add_server.py --name <name> --type stdio|http [OPTIONS]

DESCRIPTION

Supports both stdio (command-line process) and http (URL) MCP server types. An existing server with the same name will be disconnected and replaced. Added servers only exist for the current runtime session and do not survive restarts.

OPTIONS

OptionTypeRequiredDescription
--name <name>stringYesServer name
--type <type>stringYesConnection type: stdio or http
--command <cmd>stringstdio onlyLaunch command (e.g. npx, uvx)
--args <json>stringNoCommand arguments as a JSON array string, e.g. '["-y","@pkg"]'; do NOT pass raw space-separated args like -y @pkg
--url <url>stringhttp onlyServer URL
--env KEY=VALUE [...]stringNoEnvironment variables, supports multiple
--label <name>stringNoServer display name

OUTPUT

Returns a JSON object containing:

FieldTypeDescription
okbooleanWhether succeeded
namestringServer name
tool_countnumberNumber of registered tools
toolsarrayTool name list
errorstringError message on failure

EXAMPLES

Add a stdio server (npx-based MCP). CRITICAL: --args MUST be a JSON array string. Use single quotes around the whole value. [correct] --args '["-y","@modelcontextprotocol/server-sequential-thinking"]' [wrong] --args -y @modelcontextprotocol/server-sequential-thinking [wrong] --args "-y @modelcontextprotocol/server-sequential-thinking"

python scripts/add_server.py \
    --name my-fs-server \
    --type stdio \
    --command npx \
    --args '["-y","@modelcontextprotocol/server-filesystem","/tmp"]' \
    --label "Filesystem"

Add an http server:

python scripts/add_server.py \
    --name my-api-server \
    --type http \
    --url http://localhost:3000/mcp \
    --label "Custom API"

Add with environment variables:

python scripts/add_server.py \
    --name my-server \
    --type stdio \
    --command npx \
    --args '["-y","some-mcp-server"]' \
    --env API_KEY=your_key BASE_URL=https://example.com

get_servers.py - Get MCP Server List

Get the list and status of all MCP servers.

SYNOPSIS

python scripts/get_servers.py

DESCRIPTION

Query all registered MCP servers and return server name, status, tool count, and other information.

OPTIONS

No parameters.

OUTPUT

Returns a JSON array, each element contains:

FieldTypeDescription
namestringServer internal name
label_namestringServer display name
statusstringStatus: success, failed, timeout
tool_countnumberTool count
toolsarrayTool name list

EXAMPLES

Run the script:

python scripts/get_servers.py

Returns a JSON array, each element contains fields like label_name, tool_count, etc.


get_tools.py - Get MCP Tool List

Get MCP tool list with optional server filtering.

SYNOPSIS

python scripts/get_tools.py [OPTIONS]

DESCRIPTION

Query all available MCP tools or tools from a specific server. Returns tool name, description, and other basic information.

OPTIONS

OptionTypeRequiredDescription
--server-name <name>stringNoServer name, returns all tools if omitted

OUTPUT

Returns a JSON array, each element contains:

FieldTypeDescription
namestringTool name
server_namestringServer name
descriptionstringTool function description

EXAMPLES

Get all tools:

python scripts/get_tools.py

Get tools from a specific server:

python scripts/get_tools.py --server-name 高德地图

Returns a JSON array, each element contains fields like name, server_name, description, etc.


get_tool_schema.py - Get Tool Schema

Get the JSON Schema definition of specific tool(s), supports batch retrieval.

SYNOPSIS

python scripts/get_tool_schema.py --server-name <server> --tool-name <tool1> [tool2] [tool3] ...

DESCRIPTION

Query the JSON Schema definition of specific MCP tool(s), including parameter descriptions, type definitions, and required fields. Supports retrieving multiple tools at once.

OPTIONS

OptionTypeRequiredDescription
--server-name <name>stringYesServer name
--tool-name <name> [name2...]stringYesTool name(s), supports multiple

OUTPUT

Returns a JSON array, each element contains:

FieldTypeDescription
tool_namestringTool name
server_namestringServer name
schemaobjectSchema object (with type, properties, required)
errorstringError message (only appears when tool not found)

EXAMPLES

Get schema for a single tool:

python scripts/get_tool_schema.py --server-name 高德地图 --tool-name maps_text_search

Get schemas for multiple tools:

python scripts/get_tool_schema.py --server-name 高德地图 --tool-name maps_text_search maps_weather maps_geo

Returns a JSON array regardless of single or multiple tools, each element containing tool_name, server_name, and schema fields.

mcp.call Method

Important: mcp.call() is an SDK method, NOT a standalone tool. It must be called within Python code executed by the run_sdk_snippet tool.

Call MCP tools via mcp.call() and get execution results.

Parameters

ParameterRequiredTypeDescription
server_nameYesstringMCP server name
tool_nameYesstringTool name
tool_paramsYesdictTool parameter dict, passed according to tool Schema definition

Return Value

Returns a Result object containing the following fields:

FieldTypeDescription
okbooleanWhether execution succeeded
contentstringResult content on success, error message on failure
execution_timefloatExecution time (seconds)
tool_call_idstringTool call ID
namestringFull tool name

Usage Examples

Basic Call:

# 注意:服务器名和工具名必须是通过脚本查询确认的真实值,不能臆想!
# 使用 run_sdk_snippet 工具执行以下代码
run_sdk_snippet(
    python_code="""
from sdk.mcp import mcp

# 调用 MCP 工具
result = mcp.call(
    server_name="<服务器名称>",  # 必须从 get_servers.py 查询结果中获取
    tool_name="<工具名称>",      # 必须从 get_tools.py 查询结果中获取
    tool_params={"参数名": "参数值"}  # 必须符合 get_tool_schema.py 返回的 Schema
)

# 检查执行结果
if result.ok:
    print(f"调用成功: {result.content}")
    print(f"执行时间: {result.execution_time}秒")
else:
    print(f"调用失败: {result.content}")
"""
)

Complete Workflow:

# Step 0: [可选] 获取服务器列表(通过 shell_exec)
# 如果不确定有哪些服务器,可执行:
shell_exec(
    command="python scripts/get_servers.py"
)
# 从输出中选择一个状态为 success 的服务器

# Step 1: [必须] 获取工具列表(通过 shell_exec)
shell_exec(
    command="python scripts/get_tools.py --server-name <服务器名称>"
)
# 从输出中选择要使用的工具

# Step 2: [必须] 获取工具 Schema(通过 shell_exec)
shell_exec(
    command="python scripts/get_tool_schema.py --server-name <服务器名称> --tool-name <工具名称>"
)
# 查看必填参数和参数类型

# Step 3: [必须] 调用工具(通过 run_sdk_snippet)
run_sdk_snippet(
    python_code="""
from sdk.mcp import mcp

# 根据 Schema 构造参数
tool_params = {
    "参数1": "值1",
    "参数2": "值2"
}

# 调用工具
result = mcp.call(
    server_name="<服务器名称>",  # 从用户提示词或 Step 0 中获取
    tool_name="<工具名称>",      # 从 Step 1 查询结果中获取
    tool_params=tool_params    # 根据 Step 2 的 Schema 构造
)

# 处理结果
if result.ok:
    print(f"调用成功: {result.content}")
else:
    print(f"调用失败: {result.content}")
"""
)

Notes

  1. Server Confirmation: If unsure whether server is available, run get_servers.py to check server status first
  2. Tool Confirmation: MUST run get_tools.py to confirm tool exists on that server before calling
  3. Schema Validation: MUST run get_tool_schema.py to get Schema and validate required parameters before calling tools
  4. Parameter Format: Ensure tool_params conforms to the tool's JSON Schema definition
  5. No Imagination: STRICTLY FORBIDDEN to imagine or guess tool names or parameter names; must follow query results

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.15%
按下载量换算35

Claude

28.29%
按下载量换算28

Cursor

18.99%
按下载量换算19

Gemini CLI

9.4%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills