
Toolfactory
io.github.GoatInAHat由 GitHub 账号 GoatInAHat 发布v0.4.12更新于 Nov 21, 2026
Build an agent tool once; ship it as Agent Skills, MCP servers, Agent Plugins / Claude / Codex
概览
一个脚手架工具:用一份操作模块和配置生成 Agent Skill、MCP 服务器、插件、CLI、软件包和网页,并让它们保持同步。
- 可以做什么
- 创建新工具项目:身份文件、配置、内核脚手架、首次构建、git init 与 setup
- 快照 MCP 服务器的工具列表,重新生成所有选定形态并清理孤立文件
- 检查漂移、运行各形态的上游校验器,并输出操作与形态的覆盖矩阵
- 在本地运行完整 CI 门禁,并把发布产物构建到 dist 目录
- 盘点所需凭据、把环境配置推送到 GitHub、撤回已下架的注册表发布
- 接管或交还单个文件与整个形态,并列出本机可用的上游 CLI
- 适用场景
- 当你希望只编写一次 agent 工具,就发布到多种宿主(技能、MCP 服务器、Claude、Codex、Cursor、Gemini、npm/PyPI、网页)而不必手工维护每种形态时使用。也适合在 CI 中防止生成内容漂移。
- 运行要求
- 以本地 stdio 进程运行,通常通过 npx 或已发布的容器镜像启动;npm 方式需要 Node.js。可选集成依赖上游 CLI,例如 gh、git 以及各宿主自己的校验器或插件工具,但基本构建并不需要它们。
安装
在 SourceWeft 中
- 打开 控制台中的 Toolfactory,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
toolfactory
Build an agent tool once; ship it as an Agent Skill, an Agent Plugins bundle, a Claude Code, Codex or Cursor plugin, an MCP server, a CLI, an npm or PyPI package, an MCP Registry entry, an OpenClaw or Hermes native plugin, and a web page, from one operation module and one config file.
toolfactory is a scaffolder and a keeper-in-sync, not a runtime. It writes each surface in the shape that surface's own tooling would have written, proves it with that surface's own validator, and records every generated file in a lock so drift fails CI. Delete toolfactory from a repo it generated and every surface still installs, builds and publishes.
Install
- Agent Skill —
npx skills add GoatInAHat/toolfactory - MCP server —
npx -y toolfactory mcp[Install in VS Code] [Install in Cursor] - Claude Desktop extension — download
toolfactory.mcpbfrom the GitHub Release and double-click to install - Claude Code plugin —
claude plugin marketplace add GoatInAHat/toolfactory, thenclaude plugin install toolfactory@toolfactory - Codex plugin —
codex plugin marketplace add GoatInAHat/toolfactory, thencodex plugin add toolfactory@toolfactory - Gemini CLI extension —
gemini extensions install https://github.com/GoatInAHat/toolfactory - OpenClaw plugin —
openclaw plugins install --link hosts/openclawfrom a checkout - Hermes plugin —
hermes plugins install https://github.com/GoatInAHat/toolfactory#hosts/hermes/toolfactory_hermes - DSH plugin (experimental) —
dsh plugin --profile <profile> add ./hosts/dshfrom a checkout, or the release tarballtoolfactory-dsh-0.4.12.tgz - Web app —
npx -y toolfactory mcp --http --openserves the operations page beside the MCP endpoint on one port and opens it; over MCP or a skill, theweboperation does the same and returns the URL. - npm package —
npm install toolfactory
Quickstart
init writes plugin.json (identity), dev.toolfactory/tool.json (surfaces, binding, config),
the kernel scaffold, the .agents/ agent-config canon (skills, MCP servers, sync.py, setup
and the per-harness hook carriers, so the tool is developable in any harness), and the first
build. It also does what a human would do next: git init and a first commit, then
bash .agents/setup, which renders the harness adapters, installs the git hooks that keep them
in sync, and installs the dependencies. Its nextSteps end with the one reload line of the
harness it is running inside, because reload is the one part a repository cannot automate.
Add --repo <owner>/<name> and it creates that GitHub repository through gh and pushes to it —
private unless you pass --public — with one topic per selected surface, and prepares the
live-tests environment when a .env is there. --dryRun prints the gh invocations instead.
None of it is required: with no GitHub, plain git or no git at all, everything below still works.
Instruction-only Codex plugin
Use --runtime none --surfaces skill,codex when a plugin is only SKILL.md instructions for
Codex. ToolFactory then emits no MCP server, operation snapshot, language scaffold, or consumer
runtime dependency. binding remains required for config compatibility but is unused in this
mode. This is available in the published npm package starting with ToolFactory 0.1.1.
- Write operations in
src/ops.ts(TypeScript) orsrc/<pkg>/ops.py(Python). Each one is a name, a description, an input schema, an optional output schema, an optionalrequireslist, and a handler. npx toolfactory introspectspawns the kernel MCP server and snapshotstools/listintodev.toolfactory/ops.json.npx toolfactory buildregenerates every selected surface in-tree.npx toolfactory gateruns what CI runs, here: build, the drift check, every surface's upstream validator, your own checks and tests, and the credential-free host end-to-end.- Commit everything.
npx toolfactory packagebuilds the release assets intodist/release/; CI runs the same gate and, on av*tag, the same package job before publishing.
A TypeScript operation:
Commands
Every command exists as a CLI subcommand and as an MCP tool (toolfactory mcp), because
toolfactory is built with toolfactory.
Surfaces
Skills first. init selects the minimum that already serves every harness — skill,
agent-plugins, mcp, cli and the binding's package registry — because everywhere that
takes a plugin also takes a skill plus an MCP server, and a skill is one file with no upstream to
track. Every host-specific plugin below is opt-in: add it only when that host needs what a skill
and an MCP server cannot give it (a gateway tab, browser capability, a store listing).
Select vscode-extension together with mcp, cli, and the runtime registry (npm for
TypeScript, pypi for Python). Set vscode.publisher in dev.toolfactory/tool.json, then build.
Open hosts/vscode and press F5 to use the checkout's runtime, or run npm run vsix in that
directory to package it. Native commands, views, webviews, language services, chat participants,
and language-model tools use the full VS Code API in your own src/extension.ts. Add contribution
points directly to its package.json; rebuilds preserve author entries and additional fields
on generated entries. Marketplace and Open VSX release jobs use VSCE_PAT and OVSX_PAT after
you register the publisher. Both can be disabled individually in tool.json.
The same native customization rule applies to the other surfaces: JSON, TOML and YAML manifests
merge only projected fields, and host entry points retain your code outside the marked regions.
OpenClaw, Hermes, DSH and browser shims can use their host's complete native API. adopt and
eject remain available when replacing a generated integration entirely.
Package distribution is opt-in. PyPI supports both pip install and uv add; pip uses the same
published wheel/sdist. Other ecosystems consume real native packages and metadata supplied by the
author. See native package releases and
system package releases for configuration and registry setup.
Toolfactory itself continues to use npm as its package registry.
Driving toolfactory from an agent
Selecting both skill and openclaw-native ships the tool's own skill with the native plugin
by default. openclaw.skills is an exact override: [] opts out; ["my-tool", "custom"]
ships the generated own skill and .agents/skills/custom/. An explicit custom-only list
continues to ship only those skills. The own skill's generated regions are refreshed in the
same build; authored prose and UTF-8 text resources are retained. The native manifest declares
skills: ["./skills"], and npm packaging includes that directory. No native plugin skill is
inferred when the standalone skill surface is absent.
Every command is an MCP tool, so a host can drive the whole loop without a shell — and nothing is
registered by hand. Every generated project carries the .agents/ canon, so toolfactory and the
tool's own kernel are already entries in .agents/mcp/servers.json, which bash .agents/setup
renders into whichever harnesses are on the machine (.mcp.json, .cursor/mcp.json,
.codex/config.toml, …) and keeps in sync from every one of them. root is an argument of every
tool, so one registration serves every repository on the machine; from inside a host worktree,
pass it explicitly.
Reload is the one part a repository cannot automate, so init prints the line that matches the
harness it is running inside, and the generated AGENTS.md carries the table it comes from.
Inside OpenClaw, install the tool you are building with
openclaw plugins install --link <repo>/hosts/openclaw --force; inside Hermes, commit and run
hermes plugins install file://<repo>#hosts/hermes/<pkg> — every hermes run is a fresh process,
and hermes gateway restart is only for the messaging gateway.
GSD uses the same skills, CLI and MCP server; no GSD-specific surface is needed. From a generated
project, run bash .agents/setup --all so .mcp.json is rendered even on a GSD-only machine,
then discover its server in an interactive GSD session before unattended use. GSD launched by
OpenClaw or Hermes loads the child project's configuration separately from the outer agent.
See GSD compatibility for setup, runtime boundaries and the repeatable smoke test.
The boundary
Core logic is a pure function of JSON arguments, environment/config and the filesystem. An
operation declares what it needs from a closed vocabulary: net, fs, shell, secret are
portable; browser, model, user-input, channel are not. Every surface gets a per-operation
verdict (native, bridged, degraded, excluded, with a reason) in COVERAGE.md, and an
excluded operation is left off that surface's tool list rather than stubbed. A tool that needs a
browser is written as two operations: one that takes the page content as an argument and runs
everywhere, and one that declares browser and runs only where a browser exists.
See docs/spec.md for the normative design.
Repository
toolfactory's own repo is generated by toolfactory build from its dev.toolfactory/tool.json.
pnpm check, pnpm test, pnpm toolfactory check and pnpm toolfactory validate are the gates.
来源:README.md,提交 7a94b5d
工具
0版本历史
7- v0.4.12最新Nov 21, 2026
- v0.4.11Nov 19, 2026
- v0.4.8Nov 11, 2026
- v0.4.6Oct 11, 2026
- v0.4.3Oct 3, 2026
- v0.3.1Sep 17, 2026
- v0.2.1Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。