craftbag

io.github.craftbagv0.2.1更新于 Oct 4, 2026

MCP server to list, load, explain, and validate Agent Skills.

已验证STDIO仅桌面Developer ToolsKnowledge & Memory

概览

AI 生成的概览

让助手发现、列出、加载、解释并校验本地 Agent Skills(SKILL.md)。

功能
craftbag 会遍历项目与主目录下的技能树(如 .agents),并可选遍历 Claude、Cursor、Grok、Bline 的厂商目录。通过 MCP stdio 提供 skills_list、skills_load、skills_why、skills_validate 四个工具。skills_load 可返回完整技能正文、标题大纲或单个标题。skills_why 解释技能为何会被激活,skills_validate 校验技能包。
适用场景
当宿主或助手需要在不依赖某一代理产品的情况下编目、查看或校验本地 Agent Skills 时适用。适合技能存放在 .agents 或厂商目录中、助手需要判断哪个技能适用于当前任务的场景。
运行要求
在 macOS、Linux 或 Windows 上运行的本地进程,可通过 Homebrew、Scoop 或 Rust 工具链安装(MSRV 1.85)。MCP 宿主通过 stdio 启动 craftbag-mcp;macOS 图形应用在 PATH 为空时可能需要完整路径。未声明账户、API 密钥或环境变量。
安装前请注意
它会读取本地技能目录,默认包括 cwd 到 git 的 .agents 与 $HOME/.agents,厂商目录仅在显式选择时读取。启动参数 --path、--vendor、--user-dir、--no-implicit-roots 会在工具调用未提供该字段时决定遍历范围,请检查以避免扫描非预期目录。

安装

在 SourceWeft 中

  1. 打开 控制台中的 craftbag,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

craftbag

Discover, list, load, and explain Agent Skills (SKILL.md) for CLI and MCP hosts.

[CI] [Security] [crates.io] [docs.rs] [License]

[OpenSSF Best Practices] [OpenSSF Scorecard] [FOSSA Status] [Release]

What it does

craftbag walks project and home skill trees (.agents, plus optional vendor trees for Claude, Cursor, Grok, and Bline). It then:

  • catalogs skills (list)
  • prints one skill body (load), or heading keys / one heading (load --outline, load --section KEY)
  • explains why a skill would activate (why)
  • checks a package (validate)

The same operations exist over MCP stdio (skills_list, skills_load, skills_why, skills_validate). Hosts can filter, rank, and load skills without taking a dependency on any one agent product.

Install

macOS and Linux (Homebrew):

bash
brew install craftbag/tap/craftbag

Windows (Scoop):

powershell
scoop bucket add craftbag https://github.com/craftbag/scoop-bucketscoop install craftbag/craftbag

Both commands install craftbag and craftbag-mcp. The MCP host then runs craftbag-mcp (on macOS GUI apps, use the full path if PATH is empty: /opt/homebrew/bin/craftbag-mcp).

From a Rust toolchain (crates.io):

bash
cargo install --locked craftbag-clicargo install --locked craftbag-mcp

Library dependency:

toml
craftbag = "0.2"

From git (unreleased tip):

bash
cargo install --locked --git https://github.com/craftbag/craftbag craftbag-clicargo install --locked --git https://github.com/craftbag/craftbag craftbag-mcp

MSRV is 1.85.

Getting started

Default list walks cwd-to-git .agents / vendor trees and $HOME/.agents / vendor trees. This clone has no project .agents. When those directories are absent, craftbag list exits 0 and says no skills were found. Point --path at the demo tree (same catalog as the demo GIF):

bash
git clone https://github.com/craftbag/craftbagcd craftbagcraftbag list --no-implicit-roots --path demo/workspace/.agents/skills --catalogcraftbag load review-pr --no-implicit-roots --path demo/workspace/.agents/skillscraftbag load review-pr --no-implicit-roots --path demo/workspace/.agents/skills --outlinecraftbag load review-pr --no-implicit-roots --path demo/workspace/.agents/skills --section review-a-pull-requestcraftbag why review-pr --no-implicit-roots --path demo/workspace/.agents/skills --context reviewcraftbag validate demo/workspace/.agents/skills/review-pr

If craftbag is not on PATH yet, cargo build -p craftbag-cli --locked and use ./target/debug/craftbag in those commands.

In a project that already has skills under .agents/skills:

bash
craftbag list --catalogcraftbag load NAMEcraftbag why NAME --context reviewcraftbag validate ./path/to/my-skill

Claude, Cursor, Grok, or Bline trees are opt-in:

bash
craftbag list --vendor claude --catalog

Demo

[craftbag catalog and load]

MCP

craftbag-mcp speaks JSON-RPC on stdio. Tools: skills_list, skills_load, skills_why, skills_validate. After brew install or scoop install, craftbag-mcp --help names them.

Claude Desktop (claude_desktop_config.json) and other hosts that take a stdio command:

json
{  "mcpServers": {    "craftbag": {      "command": "craftbag-mcp",      "args": ["--vendor", "claude"]    }  }}

Launch --path, --vendor, --user-dir, and --no-implicit-roots are the walk when a tool call omits that field. The host cwd is still the implicit walk root unless you pass --no-implicit-roots. skills_load accepts outline and section (same as load --outline / --section KEY).

Library

rust
use craftbag::{discover, DiscoveryOptions};
fn main() -> std::io::Result<()> {    let cwd = std::env::current_dir()?;    let report = discover(&cwd, &DiscoveryOptions::default());    for skill in &report.skills {        println!("{} {}", skill.name, skill.description);    }    Ok(())}

implicit_roots is on by default (cwd-to-git .agents and $HOME/.agents). Set it to false and put collection roots in paths for leftover-only hosts. format_load_view can print an outline or one heading instead of the whole body.

Contributing

See CONTRIBUTING.md. Security reports go to SECURITY.md. Roadmap and governance are in ROADMAP.md and GOVERNANCE.md.

License

Apache-2.0 or MIT. You may choose either. See LICENSE and LICENSE-APACHE.

来源:README.md,提交 ea02fc9

工具

0
工具元数据尚未被收录。

版本历史

1
  1. v0.2.1最新Oct 4, 2026