
Research
/Security News
11 Malicious NuGet Tools Pose as Game Cheats to Drop a Windows Host-Surveillance Payload
11 malicious NuGet tools pose as game cheats to deploy Windows payloads, track hosts, and use Google Sheets for telemetry and control.
将 Claude Code Skills 转换为 MCP (Model Context Protocol) 服务,让任何支持 MCP 的 AI 客户端都能发现和使用本地 Skill。
.claude/skills 和 .claude/commands 目录下的 Skill 文件```!bash 和内联 !`cmd`)# 使用 npx 直接运行(无需安装)
npx skill2mcp
# 或全局安装
pnpm add -g skill2mcp
skill2mcp
以 Claude Code 为例,在 .claude/settings.json 中添加:
{
"mcpServers": {
"skill2mcp": {
"command": "npx",
"args": ["skill2mcp"],
"env": {
"SKILL2MCP_WORKDIR": "/path/to/your/project"
}
}
}
}
配置完成后,MCP 客户端将自动发现指定目录下的所有 Skill 并将其暴露为可调用的 Tool。
通过环境变量进行配置:
| 环境变量 | 说明 | 默认值 |
|---|---|---|
SKILL2MCP_SKILL_DIRS | Skill 搜索目录,多个目录用 : 分隔 | .claude/skills:.claude/commands |
SKILL2MCP_TIMEOUT | 命令执行超时时间(毫秒) | 30000(30 秒) |
SKILL2MCP_WORKDIR | 工作目录,相对路径的基准目录 | 当前工作目录 |
SKILL2MCP_ENABLE_RUN_COMMAND | 是否启用通用 run_command Tool | true(启用) |
flowchart LR
A[Skill 文件] -->|扫描 & 解析| B[Skill Registry]
B -->|注册为 Tool| C[MCP Server]
C -->|stdio 传输| D[MCP 客户端]
D -->|调用 Tool| C
C -->|变量替换 & 命令提取| E[命令执行器]
E -->|安全检查 + 超时控制| F[shell 执行]
$ARGUMENTS、${CLAUDE_SKILL_DIR}),提取 shell 命令并执行,将结果替换回正文返回支持两种目录布局:
.claude/
├── skills/ # Skill 目录格式
│ └── my-skill/ # 每个 Skill 一个子目录
│ └── SKILL.md # Skill 定义文件
└── commands/ # Command 目录格式(兼容)
└── my-command.md # 每个 Command 一个 Markdown 文件
Skill 文件使用 YAML frontmatter 定义元数据:
---
description: "执行项目构建"
argument-hint: "<target>"
when_to_use: "需要构建项目时使用"
allowed-tools: ["Bash", "Read"]
shell: bash
---
## 构建说明
执行以下命令构建项目:
\`\`\`!bash
pnpm run build
\`\`\`
| 字段 | 类型 | 说明 |
|---|---|---|
description | string | Skill 描述,用作 MCP Tool 的描述 |
argument-hint | string | 参数提示,如 <file-path> |
when_to_use | string | 使用场景说明 |
allowed-tools | string[] | 允许使用的工具列表 |
shell | string | Shell 类型 |
Skill 正文中支持以下变量:
| 变量 | 说明 |
|---|---|
$ARGUMENTS | 用户传入的完整参数字符串 |
$0, $1, $2 ... | 参数按空格分割后的各部分 |
${CLAUDE_SKILL_DIR} | Skill 所在目录的绝对路径 |
在正文中使用以下格式定义要执行的 shell 命令:
代码块格式:
```!bash
pnpm run build
```
内联格式:
当前版本: !`cat package.json | grep version`
rm -rf /、mkfs、dd、shutdown、reboot 等破坏性命令child_process.spawn 传入数组参数,避免 shell 注入SKILL2MCP_ENABLE_RUN_COMMAND=false 禁用src/
├── bin.ts # CLI 入口
├── index.ts # 公共 API 导出
├── config.ts # 配置解析(环境变量 + 默认值)
├── scanner.ts # Skill 文件扫描与 frontmatter 解析
├── registry.ts # MCP Tool 注册(Skill → Tool 映射)
├── executor.ts # 命令提取、变量替换、安全执行
├── server.ts # MCP Server 创建与启动
├── types.ts # 类型定义
└── __tests__/ # 测试文件
# 安装依赖
pnpm install
# 开发模式(watch)
pnpm run dev
# 构建
pnpm run build
# 测试
pnpm run test
# 测试覆盖率
pnpm run test:coverage
# 代码检查
pnpm run lint
# 类型检查
pnpm run typecheck
# 完整检查(typecheck + lint)
pnpm run check
MIT © 2026 shenjingnan
FAQs
将 Claude Code Skills 转换为 MCP 服务,让远程 Agent 能发现和使用本地 Skill
The npm package skill2mcp receives a total of 1 weekly downloads. As such, skill2mcp popularity was classified as not popular.
We found that skill2mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
11 malicious NuGet tools pose as game cheats to deploy Windows payloads, track hosts, and use Google Sheets for telemetry and control.

Research
/Security News
4 compromised asyncapi packages deliver miasma botnet loader on macOS, Linux and Windows.

Research
/Security News
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.