pkgtruth

v0.2.2
io.github.hxckya/pkgtruth Checked 12 hours ago Published 2 months ago

Catches hallucinated and slopsquatted npm and PyPI packages before an agent installs them.

Values you need

VariableWhat it is
PKGTRUTH_REGISTRYoptional Alternate npm registry to verify against. Defaults to https://registry.npmjs.org.
PKGTRUTH_DOWNLOADS_APIoptional Alternate downloads API used for adoption figures. Defaults to https://api.npmjs.org.
PKGTRUTH_CACHE_DIRoptional Where adoption figures are cached between runs. Defaults to ~/.cache/pkgtruth.
PKGTRUTH_TIMEOUT_MSoptional Per-request timeout in milliseconds. Defaults to 8000.

npm (npx) discovery passed

Requires Node.js 18+

Run in a terminal
claude mcp add pkgtruth -- npx -y pkgtruth@0.2.2
Add to claude_desktop_config.json
{
  "mcpServers": {
    "pkgtruth": {
      "args": [
        "-y",
        "pkgtruth@0.2.2"
      ],
      "command": "npx"
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "pkgtruth": {
      "args": [
        "-y",
        "pkgtruth@0.2.2"
      ],
      "command": "npx"
    }
  }
}
Add to .vscode/mcp.json
{
  "servers": {
    "pkgtruth": {
      "args": [
        "-y",
        "pkgtruth@0.2.2"
      ],
      "command": "npx",
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.pkgtruth]
command = "npx"
args = ["-y", "pkgtruth@0.2.2"]

For AI agents

  1. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  2. Restart or reload the client so it starts the server.
  3. Verify: the server should expose these tools: check_package, check_dependencies, check_install_command.
  4. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json