mcpField
K
Keep Mac Awake

Keep Mac Awake

Local
keepmacawake.comProductivity2Updated 2d ago

About Keep Mac Awake

Keep Mac Awake is an MCP server for AI agents running long tasks on a closed MacBook. It controls sessions through the local app, with user approval required for unlimited sessions and the first trial session.

Key features

  1. 01Check session status and time remaining
  2. 02Start timed or unlimited sessions
  3. 03Stop sessions and restore sleep settings
  4. 04Report when the app needs user action

Use cases

  1. 01Run long test suites with the lid closed
  2. 02Keep a Mac awake during a migration
  3. 03Check an active session's remaining time

MCP support

It gives MCP clients tools to check, start, and stop Keep Mac Awake sessions. The server communicates with the app through a local command and makes no network connection.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"com-keepmacawake": {
"command": "npx",
"args": [
"-y",
"keepmacawake-mcp"
]
}
}
}
Run commandnpx -y keepmacawake-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmkeepmacawake-mcp1.0.1

Tools

3

Saved tool list · updated 3d ago

This tool takes no parameters.

Details

From the project README

Keep Mac Awake MCP server

This MCP server lets an AI agent use Keep Mac Awake, a macOS app that keeps a MacBook with Apple silicon awake with the lid closed during a session. It needs the app, which is installed separately and is a paid app with a free trial (keepmacawake.com). With it, the agent starts a timed session before long work, stops it when the work is done, and tells you when the app needs something from you, such as AC power or a purchase after the trial. Why an agent needs it: a MacBook sleeps when you close the lid, and the agent's work stops with it (keep AI agents running with the lid closed).

It works in any app that runs local MCP servers (Claude Desktop, Claude Code, Codex, Cursor, VS Code, Windsurf and others). If your agent takes plugins, the Keep Mac Awake plugin does the same with a skill and adds a session-start hook.

Tools

ToolWhat it does
keep_awake_statusWhether a session runs and its time left, the free trial, and a newer version of the app. Read only.
keep_awake_startStarts a session of 1 to 168 whole hours, or without a time limit.
keep_awake_stopEnds the session and restores the normal sleep setting.

The agent starts timed sessions on its own and tells you in one line. It asks you first before a session without a time limit and before the first session on a Mac, which starts the free trial: keep_awake_start refuses both until the agent passes user_agreed. It never starts a second session over a running one. Battery use, buying and installing stay with you, in the menu bar panel or in Terminal.

Install

You need Node.js 20 or later and the Keep Mac Awake app (any Mac with Apple silicon and macOS 26 or later).

Claude Code:

claude mcp add keepmacawake -- npx -y keepmacawake-mcp

Codex:

codex mcp add keepmacawake -- npx -y keepmacawake-mcp

Claude Desktop, Cursor and other apps with a JSON configuration (claude_desktop_config.json, .cursor/mcp.json):

{
  "mcpServers": {
    "keepmacawake": {
      "command": "npx",
      "args": ["-y", "keepmacawake-mcp"]
    }
  }
}

The server is the npm package keepmacawake-mcp and is listed in the official MCP Registry as com.keepmacawake/mcp.

If the app reports that npx is not found, give its full path, for example /opt/homebrew/bin/npx.

From a clone of this repository instead of npm:

git clone https://github.com/bartdudzic/keepmacawake
cd keepmacawake/mcp && npm ci --omit=dev
claude mcp add keepmacawake -- node "$PWD/bin/keepmacawake-mcp.mjs"

Examples

  • "Run the full test suite and fix what fails. I'm closing the lid and will check back from my phone."
  • "Keep the Mac awake for the next 2 hours while this migration runs."
  • "Is Keep Mac Awake on, and how much time is left?"

What it runs

  • Each tool runs the app's keepmacawake command once on this Mac (status, start or stop, with --json), from /usr/local/bin, where the installer puts it, or from PATH. Set KEEPMACAWAKE_CLI to use another path.
  • It never runs anything else: no installer, no script, no sudo, no settings changes, no payments.
  • The command talks only to the app's background service on this Mac. The server opens no network connection and has no telemetry.
  • It works only where the server runs on your Mac itself. Elsewhere, such as a cloud container, every tool answers that Keep Mac Awake is out of reach from there.

Privacy

The server sends nothing anywhere. Its results become part of the agent's conversation, so the agent's provider receives them: whether a session runs, its time left, the trial's time left, the battery settings and a newer version. From the app's reply the server passes on only those fields: never this Mac's ID, the purchase details or the app's own messages, apart from the short reason the app gives when it refuses a session. The app's own data use is in its privacy description.

Troubleshooting

  • "Keep Mac Awake is not installed": install the app from keepmacawake.com, or set KEEPMACAWAKE_CLI if the command is somewhere else.
  • "Its background service did not answer": open Keep Mac Awake from Applications. An MCP host that runs servers in a sandbox may block the connection to the service.
  • A session refused on battery: plug in AC power, or allow battery use in the menu bar panel.

Development

npm ci
npm test

The tests run against a fake keepmacawake command and never touch a real session.

Support

Write to [email protected]. Security issues: see SECURITY.md. Keep Mac Awake is not affiliated with Apple.

License

The server is under the MIT License. The Keep Mac Awake app it controls is not: buying it after the free trial is covered by its own terms.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.