npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mhdd_24/caffeine-mcp

v1.1.0

Published

MCP server that controls Zhorn Caffeine to prevent Windows sleep/screensaver from Cursor

Readme

@mhdd_24/caffeine-mcp

MCP server that controls Zhorn Caffeine on Windows so your PC stays awake (no sleep / screensaver). Use it from Cursor, Claude Desktop, VS Code Copilot, or any MCP-compatible client.

You type natural language — the assistant calls caffeine_on / caffeine_off for you.

Full documentation: docs/WIKI.md


How it works (30 seconds)

You (chat) → MCP client → caffeine-mcp → caffeine64.exe (CLI switches)
  1. status — resolve CAFFEINE_EXE, check if the process is running
  2. on — start Caffeine or send -appon (optional -activefor:xx)
  3. off — deactivate with -appoff (process may stay in tray)
  4. stop — exit with -appexit

Caffeine itself is a separate utility from Zhorn Software. This MCP does not redistribute the .exe — point CAFFEINE_EXE at your local install.


Prerequisites

| Requirement | Notes | |-------------|--------| | Node.js 18+ | Required for MCP server | | Caffeine | caffeine64.exe (or 32-bit) from Zhorn | | Windows | Uses process spawn + tasklist |


Install

Option A — npm (recommended after publish)

npm install -g @mhdd_24/caffeine-mcp

Option B — npx (no global install)

npx @mhdd_24/caffeine-mcp

Option C — clone and build (contributors)

git clone https://github.com/Mhdd-24/Caffeine-MCP.git
cd Caffeine-MCP
npm install
npm run build
node dist/index.js

Configure your MCP client

Cursor

Edit Cursor Settings → MCP or ~/.cursor/mcp.json:

{
  "mcpServers": {
    "caffeine": {
      "command": "npx",
      "args": ["-y", "@mhdd_24/caffeine-mcp"],
      "env": {
        "CAFFEINE_EXE": "C:/Users/You/Downloads/caffeine/caffeine64.exe",
        "CAFFEINE_DEFAULT_ARGS": "-stes"
      }
    }
  }
}

After global install, you can use:

"command": "caffeine-mcp"

Local development:

"command": "node",
"args": ["C:/path/to/caffeine-mcp/dist/index.js"]

Restart Cursor (or toggle the MCP server off/on) after saving.


Environment variables

| Variable | Required | Default | Purpose | |----------|----------|---------|---------| | CAFFEINE_EXE | Yes | — | Full path to caffeine64.exe | | CAFFEINE_DEFAULT_ARGS | No | empty | Space-separated flags on every launch (e.g. -stes) |

Recommended: -stes (SetThreadExecutionState) or leave empty for classic F15 simulation.

Never commit machine-specific absolute paths. Put them only in MCP env or a local .env (gitignored).


Tools

| Tool | Purpose | |------|---------| | caffeine_status | Exe path + running processes | | caffeine_on | Start / activate keep-awake | | caffeine_off | Deactivate (-appoff) | | caffeine_toggle | Toggle active/inactive | | caffeine_stop | Exit process (-appexit) | | caffeine_run | Custom CLI args escape hatch |

Chat examples

  • "Keep my PC awake"
  • "Turn caffeine on for 60 minutes"
  • "Is caffeine running?"
  • "Stop caffeine"

What happens after npm install?

  1. Package files land in node_modules/@mhdd_24/caffeine-mcp/.
  2. prepack / publish includes compiled dist/.
  3. The caffeine-mcp bin points to dist/index.js.
  4. Your MCP client runs that entry over stdio.

After publishing to npm (maintainers)

  1. Bump version in package.json and CF.SERVER.VERSION.
  2. npm run build and smoke-test.
  3. npm publish --access public.

Current package version: 1.0.0.


Troubleshooting

| Problem | Fix | |---------|-----| | Exe not found | Set CAFFEINE_EXE to your caffeine64.exe | | Still sleeps | Try CAFFEINE_DEFAULT_ARGS=-stes or leave empty (F15 mode) | | Stuck process | caffeine_stop or taskkill caffeine64.exe |


License

ISC (this MCP wrapper). Caffeine belongs to Zhorn Software — download separately.