Codex插件医生
在您发布Codex插件、技能和MCP服务器之前检查它们的CLI 包、它的安全性,以及(如果允许的话)正在运行的MCP服务器。
npx codex-plugin-doctor check path/to/plugin
指向一个文件夹 .codex-plugin/plugin.json. 在其
.mcp.json 退出时状态为1,报告如下(建议修改命令):
Codex Plugin Doctor
===================
Status: FAIL
Target: /path/to/plugin
Summary: 1 fail, 0 warn, 1 total
Failures
--------
✖ plugin.security.hard_coded_secret
Message: The MCP server `dangerServer` contains a hard-coded secret-like env value for `OPENAI_API_KEY`.
Impact: Hard-coded credentials inside plugin bundles increase leakage risk and make secure rotation difficult.
Suggested fix: Replace the literal value for `OPENAI_API_KEY` with an environment reference or injected secret outside the package.
Fingerprint: 21da7c75027f0811929d49253412a0f20694d974f141d0421410c89ee29c8b72
Evidence: serverName=dangerServer, configPath=.mcp.json, envKey=OPENAI_API_KEY, envValue=[REDACTED]
添加 --runtime 也可以启动插件的MCP服务器并调用它们。它运行
包的自己的代码,所以它是可选的,和 --sandbox docker 隔离本地Node.js工作室
服务器。没有插件在手? npx codex-plugin-doctor check --installed 检查那些
在Codex插件缓存中。
检查什么
- 包:
.codex-plugin/plugin.json、技能布线及SKILL.md元数据,.mcp.json结构、描述质量、硬编码的秘密和逃离包的路径。 - 安全 (
security .): shell包装器、编码命令、远程内容的记分卡 管道连接到shell中,以及普通HTTP传输。 - 运行服务器 (
--runtime): MCP握手,然后是工具、资源、提示和 分页,带有记分卡和一致性报告。 - 突发的变化: MCP快照 比较工具、提示、 和资源模板与一个提交的基线,在拉请求评论和发布 笔记。
- 其他客户 (
compat . --all --scorecard): MCP配置是否有效,是否可以 添加到克劳德桌面,光标,克莱恩,和这台机器上的风帆。 - 远程服务器和发布: 可选 远程MCP准备就绪, MCP注册表准备情况,以及离线 公共目录预飞行。
看到 CLI参考 有关更多命令和示例,请参见
codex-plugin-doctor --help 对他们所有人来说 codex-plugin-doctor explain <finding-id> 为
规则是什么意思。
安装
npm install -g codex-plugin-doctor
codex-plugin-doctor self-test
codex-plugin-doctor check .
codex-plugin-doctor check . --runtime
codex-plugin-doctor mcp path/to/mcp-package
GitHub行动
name: Validate Codex plugin
on:
pull_request:
permissions:
contents: read
jobs:
doctor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: Esquetta/[email protected]
with:
version: "1.91.0"
path: .
runtime: "true"
policy: codex-publish
runtime: "true" 运行包的代码,因此该作业保留一个只读令牌。
codex-plugin-doctor init-ci . 为您编写工作流。看到
GitHub动作用法 对于报告,拉取请求注释,和
输入。
文档
1.0稳定
1.0行是插件作者和CI消费者的稳定兼容性基准。
- 公共JSON模式表面和现有规则id /默认严重性在1.0之前都被视为稳定的。
- 运行时探测仍然是可选的,因为它执行包本地MCP服务器。
- 除非主版本另有说明,否则新功能将保持添加状态。
看到 文档索引 有关架构、使用、安全性和贡献者指南。
贡献
欢迎投稿。开始 贡献,
安全策略, 行为准则,和
验证调优问题模板。
npm run release-check 运行释放预飞行;看到
版本控制和发布。
支持
如果这个工具节省了你的时间,GitHub的明星和赞助有助于表明项目值得继续下去。
- 在GitHub上标记存储库。
- 通过资源库资助链接使用GitHub赞助商。
- 为假阳性或假阴性打开验证调优问题。