JSPM

mcp-chocolatey

0.1.11
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q75028F
  • License MIT

MCP server exposing Chocolatey (choco) commands as tools

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mcp-chocolatey) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    MCP Chocolatey logo

    MCP Chocolatey

    Chocolatey on the Model Context Protocol โ€” searchable, installable, upgradable via tools.

    npm version downloads/week license node >=18


    ๐Ÿš€ Quick start (Claude Desktop)

    Add this entry to claude_desktop_config.json (Windows path: C:\Users\<you>\AppData\Roaming\Claude\claude_desktop_config.json).

    {
      "mcpServers": {
        "chocolatey": {
          "command": "npx",
          "args": ["-y", "mcp-chocolatey"],
          "env": {
            "NPX_SILENT": "1",
            "npm_config_loglevel": "silent"
          }
        }
      }
    }

    Restart Claude Desktop. Then try:

    • "List installed Chocolatey packages" (uses choco_list)
    • "Search for 7zip on Chocolatey" (uses choco_search)
    • "Check outdated Chocolatey packages" (uses choco_outdated)

    ๐Ÿ’ก Tip: If your environment chatters on npx, you can run Node directly:
    command: "node", args: ["C:\Users\<you>\AppData\Roaming\npm\node_modules\mcp-chocolatey\src\server.js"].

    ๐ŸŒ HTTP bridge

    • Start locally: npm run start:http (listens on http://127.0.0.1:11435/mcp)
    • Required headers: Accept: application/json, text/event-stream and Content-Type: application/json
    • Example request (PowerShell):
    $uri = 'http://127.0.0.1:11435/mcp'
    $headers = @{ Accept = 'application/json, text/event-stream' }
    $body = '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
    Invoke-RestMethod -Uri $uri -Method Post -ContentType 'application/json' -Headers $headers -Body $body

    If you expose via ngrok, be aware youโ€™re exposing package management endpointsโ€”use only if you understand the risk.


    โœจ What you get

    • โšก Fully typed MCP tools backed by Chocolatey CLI
    • ๐Ÿ”ง Zero configuration โ€” uses your existing choco install
    • ๐Ÿ–ฅ๏ธ Works in standard Windows terminals and Claude Desktop

    ๐Ÿ› ๏ธ Tools implemented (key flags)

    • choco_list โ€” list local packages (localOnly, exact, id)
    • choco_search โ€” search remote (query, exact, prerelease)
    • choco_install โ€” install (id, version?, prerelease?, force?, source?, yes, failOnStdErr?, timeoutSec?, extraArgs?[])
    • choco_upgrade โ€” upgrade (id | 'all', prerelease?, force?, source?, yes, failOnStdErr?, timeoutSec?, extraArgs?[])
    • choco_uninstall โ€” uninstall (id, version?, force?, yes, timeoutSec?, extraArgs?[])
    • choco_info โ€” package info (id, exact?, verbose?)
    • choco_outdated โ€” list outdated (ignorePinned?, includePrerelease?)
    • choco_pin โ€” add/remove/list pins
    • choco_feature โ€” list/enable/disable features
    • choco_source โ€” list/add/remove/enable/disable/update sources (name, source, user, password supported where relevant)
    • choco_config โ€” list/get/set/unset config values
    • choco_help โ€” passthrough help

    โš ๏ธ Admin vs non-admin

    • Many installs/upgrades/uninstalls require elevation. When not elevated, operations may fail or be scoped perโ€‘user. The server adds a warning prefix in nonโ€‘admin sessions.
    • Destructive operations require yes=true. If omitted or false, the server returns an error and does not execute.

    โฑ๏ธ Timeouts and concurrency

    • Default timeout: 15 minutes (env: MCP_CHOCOLATEY_TIMEOUT_MS)
    • Max concurrency: 1 (env: MCP_CHOCOLATEY_MAX_CONCURRENCY)
    • Override CHOCO_BIN if choco isnโ€™t on PATH.

    ๐Ÿ”ง Troubleshooting

    "Unexpected token โ€ฆ not valid JSON" in Claude logs

    Any nonโ€‘JSON text on stdout can break MCP. This package avoids stdout noise; however, some environments make npx chatty. Fix: add the env shown above (NPX_SILENT, npm_config_loglevel) or run node directly to the server script.

    choco not found

    Ensure Chocolatey is on PATH. Typical locations:

    • System install: C:\\ProgramData\\chocolatey\\bin
    • Per-user install: C:\\Users\\<you>\\AppData\\Local\\Programs\\Chocolatey\\bin

    If itโ€™s elsewhere, set CHOCO_BIN env var to the full path to choco.exe.


    ๐Ÿ—๏ธ Local development

    # Start in stdio mode (stdout must be clean for MCP)
    npm run start:stdio

    ๐Ÿ“„ License

    MIT