codex-plugin-doctor

中文文档
1.91.0发布于 2026/11/03MITTypeScriptES Module构建来源已验证

CLI-first validator for Codex plugins, skills, and MCP package surfaces with runtime MCP protocol validation.

原始使用文档
文档目录7 节
  1. What It Checks
  2. Install
  3. GitHub Action
  4. Documentation
  5. 1.0 Stability
  6. Contributing
  7. Support

Codex Plugin Doctor

CI npm version License: MIT GitHub release

A CLI that checks Codex plugins, skills, and MCP servers before you ship them: the package, its security, and, if you allow it, the running MCP server.

npx codex-plugin-doctor check path/to/plugin

Point it at a folder with .codex-plugin/plugin.json. A plugin with an API key in its .mcp.json exits with status 1 and this report (recommended commands trimmed):

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]

Add --runtime to also start the plugin's MCP servers and call them. That runs the package's own code, so it is opt-in, and --sandbox docker isolates local Node.js stdio servers. No plugin at hand? npx codex-plugin-doctor check --installed checks the ones in your Codex plugin cache.

What It Checks

  • Package: .codex-plugin/plugin.json, skill wiring and SKILL.md metadata, .mcp.json structure, description quality, hard-coded secrets, and paths that escape the package.
  • Security (security .): a scorecard for shell wrappers, encoded commands, remote content piped into a shell, and plain HTTP transports.
  • Running servers (--runtime): the MCP handshake, then tools, resources, prompts, and pagination, with a scorecard and a conformance report.
  • Breaking changes: MCP snapshots compare tools, prompts, and resource templates with a committed baseline, in a pull request comment and in release notes.
  • Other clients (compat . --all --scorecard): whether the MCP config is valid and can be added to Claude Desktop, Cursor, Cline, and Windsurf on this machine.
  • Remote servers and publishing: opt-in Remote MCP Readiness, MCP Registry Readiness, and an offline public directory preflight.

See the CLI Reference for more commands and examples, codex-plugin-doctor --help for all of them, and codex-plugin-doctor explain <finding-id> for what a rule means.

Install

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 Action

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" runs the package's code, so this job keeps a read-only token. codex-plugin-doctor init-ci . writes a workflow for you. See GitHub Action Usage for reports, pull request comments, and inputs.

Documentation

1.0 Stability

The 1.0 line is the stable compatibility baseline for plugin authors and CI consumers.

  • Public JSON schema surfaces and existing rule IDs/default severities are treated as stable through 1.0.
  • Runtime probing remains opt-in because it executes package-local MCP servers.
  • New features stay additive unless a major version says otherwise.

See the documentation index for architecture, usage, security, and contributor guides.

Contributing

Contributions are welcome. Start with Contributing, the Security Policy, the Code of Conduct, and the validation tuning issue template. npm run release-check runs the release preflight; see Versioning and Releases.

Support

If this tool saves you time, GitHub stars and sponsorship help signal that the project is worth continuing.

  • Star the repository on GitHub.
  • Use GitHub Sponsors through the repository funding link.
  • Open validation tuning issues for false positives or false negatives.

版本与发布记录

codex-plugin-doctor 共发布 131 个版本,首次发布于 2026/04/29;过去 12 个月发布了 131 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.91.0latest2026/11/03今天
1.90.12026/11/012 天前
1.90.02026/10/313 天前
1.89.02026/10/295 天前
1.88.02026/10/286 天前
1.87.02026/10/277 天前

其他发布通道:next → 1.0.0-rc.2。

关于 codex-plugin-doctor 的常见问题

codex-plugin-doctor 是什么?

用于Codex插件、技能和MCP包的CLI-first验证器具有运行时MCP协议验证。

如何安装 codex-plugin-doctor?

在项目目录运行 npm install codex-plugin-doctor,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 codex-plugin-doctor,可以用 npx codex-plugin-doctor 直接运行。

codex-plugin-doctor 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

codex-plugin-doctor 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

codex-plugin-doctor 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

codex-plugin-doctor 可以商用吗?

codex-plugin-doctor 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

codex-plugin-doctor 还在维护吗?

最新版本 1.91.0 发布于 2026/11/03(今天);至今共发布 131 个版本,其中过去 12 个月发布了 131 个;首次发布于 2026/04/29。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。