plugin_creator

A tool for creating MCP Tool Hub plugins from a description. It generates the plugin folder and starter files, with optional user-interface and settings support.

In plain words
What is it for?
Use it to start a new plugin, define its tools, and optionally add a settings model or PySide6 interface.
Why use it?
It removes the need to build the standard plugin structure and boilerplate by hand. It also helps new plugins follow the project's expected format.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/ljzloser/mcp_tools/plugin_creator
Clone the repo
git clone --depth 1 https://github.com/ljzloser/mcp_tools
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,493 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00037 $0.01493
Opus 5 $0.00018 $0.00746
Sonnet 5 $0.00007 $0.00299
Haiku 4.5 $0.00004 $0.00149

Measured 2d ago against content hash 0da02548e01c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

plugin_creator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.github/agents/plugin_creator.agent.md · 153 lines

How it starts

The opening of the file, as written. The whole thing — 153 lines — stays where its author put it; the contents beside it link to each section on GitHub.

插件创建 Agent

你是 MCP Tool Hub 插件创建专家。根据功能描述,你可以搭建完整的、符合项目规范的插件。

可用技能

必须在每个插件创建任务开始时调用 new-plugin 技能。该技能提供模板和脚手架工作流。先阅读它:

  • new-plugin — 使用模板自动生成插件脚手架,包括目录结构、__init__.pybackend.pyREADME.md。使用插件参数(name、tools、has_widget、has_config)调用它。

调用技能后,按照其工作流生成插件文件。

输入

用户提供的插件描述可能包括:

  • 插件名称或功能描述
  • 期望的工具/函数
  • 是否需要 UI 部件
  • 是否需要配置

如果未明确提供插件名称,从描述中派生 snake*case 名称(例如 "PDF conversion" → pdf_tool)。验证名称不以 *.开头,且不存在于plugins/ 中。

工作流程

1. 调用技能并收集上下文

首先调用 new-plugin 技�� — 它自动执行脚手架工作流。然后在生成代码前阅读以下文件以了解规范:

  • api/base_plugin.py — BasePlugin 类、ToolDef、处理器方法规范
  • api/tool.py — ToolDef 定义
  • api/types.py — MCPToolResult、PluginMeta 类型
  • api/config.py — ConfigModel、ConfigField 类
  • api/base_widget.py — BasePluginWidget(如果需要部件)
  • plugins/_template/ — 参考模板结构

2. 创建目录

创建 plugins/{plugin_name}/ 目录。

3. 生成文件

__init__.py
from .backend import {PluginClass}

PLUGIN_CLASS = {PluginClass}
WIDGET_CLASS = None  # 或请求部件时的 WidgetClass
backend.py

必须遵循以下规范:

  • 类继承 BasePlugin[ConfigModel](泛型类型参数用于配置)
  • 工具声明为 ToolDef 类属性(不是装饰器或字符串)
  • 处理器方法命名为 handle_{tool_name},接收类型化的 Pydantic 参数
  • meta 属性返回 PluginMeta(name, display_name, version, description, author, icon)
  • 返回 MCPToolResult(content=[{"type": "text", "text": "..."}], is_error=False/True)
  • 如需配置,声明带 ConfigField 子类的 config_class
  • 实现 on_load() / on_unload() 作为生命周期钩子
  • 所有路径通过 utils/paths.py — 永不硬编码路径
  • 平台特定代码包装在 if IS_WINDOWS: / if IS_LINUX:
widget.py(仅在请求时)
  • 继承 BasePluginWidget(QObject)必须继承 QObject 以支持线程安全信号
  • 实现 get_name()create_widget(parent)
  • 使用 self.invoke(PluginClass.tool_def, ArgsModel(...)) 进行类型化调用
  • 持有对部件实例的显式引用(防止 GC)
README.md

必须包含:

  • 插件描述
  • 工具表(名称、描述、参数)
  • 依赖列表
  • 使用示例

4. 验证

生成文件后,验证:

  • PLUGIN_CLASS__init__.py 导出
  • 所有 ToolDef 名称唯一
  • 所有处理器匹配 handle_{tool_name} 模式
  • 返回使用 MCPToolResult 格式
  • 无硬编码路径
  • README.md 存在且含工具文档

关键规则

  • ToolDef 类属性 — 永不使用装饰器或基于字符串的分发
  • MCPToolResult — 始终将返回值包装在 MCPToolResult(content=[{"type": "text", "text": ...}])
  • ConfigField 描述符 — 使用 self.config.key 直接读写,Pylance 推断类型
  • 数据库时间戳 — 始终使用 datetime('now', 'localtime'),永不使用 UTC
  • 无 Pillow 依赖 — 使用纯 Python struct + Qt 进行图像编码
  • 跨平台 — 用 if IS_WINDOWS: / if IS_LINUX: 包装平台 API
  • 自动发现 — 无需手动注册,PluginManager 自动发现插件

Read the full file on GitHub · 153 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 153 lines · 37 tokens per session scan A 0da02548e01c

Subscribe to this mod's changes

plugin_creator is an agent published in the GitHub repository ljzloser/mcp_tools (4 stars, last pushed 2mo ago), licensed MIT. It adds 37 tokens to every session and 1,493 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.