Get the FREE Ultimate OpenClaw Setup Guide →

mcp -restart

Restarts Claude Desktop after mcp-server installation

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio non-dirty-mcp-server-restart uvx mcp-server-restart

How to use

This MCP server provides a small utility to restart Claude Desktop for Mac. Once installed, Claude can invoke the restart process via a dedicated tool named restart_claude, which safely terminates any running Claude Desktop process and launches a fresh instance. The server also exposes a status resource that reports whether Claude Desktop is currently running, the process ID (PID) if applicable, and a timestamp for when the status was retrieved. Use the MCP interface to request a restart or to query the status before performing actions.

To restart Claude Desktop, invoke the restart_claude tool through the MCP interface. The tool will handle a safe shutdown of any existing Claude Desktop process and start a new one, providing progress notifications during the operation. If you want to verify the state before or after the operation, query the status resource at claude://status to confirm whether Claude Desktop is running and to inspect its PID and timestamp.

How to install

Prerequisites:

  • MacOS with Claude Desktop installed
  • Access to the Claude Desktop configuration file at ~/Library/Application Support/Claude/claude_desktop_config.json
  • MCP-enabled environment where you can install and reference MCP servers
  • uvx (Python-based MCP runner) installed and accessible in PATH (as used in the example configuration)

Installation steps (choose one of the options):

Option A: Install both mcp-installer and mcp-server-restart

  1. Ensure Claude Desktop is configured to load MCP servers from your claude_desktop_config.json.

  2. Add the following to your claude_desktop_config.json under mcpServers:

    { "mcpServers": { "mcp-installer": { "command": "npx", "args": [ "@anaisbetts/mcp-installer" ] }, "mcp-server-restart": { "command": "uvx", "args": [ "mcp-server-restart" ] } } }

  3. Save the config and restart Claude Desktop to apply changes. The mcp-installer will help install MCP tooling and dependencies, and mcp-server-restart will expose the restart capability.

Option B: Install only the mcp-server-restart package

  1. Ensure Claude Desktop is configured to load MCP servers from your claude_desktop_config.json.

  2. Add the following to your claude_desktop_config.json under mcpServers:

    { "mcpServers": { "mcp-server-restart": { "command": "uvx", "args": [ "mcp-server-restart" ] } } }

  3. Save the config and restart Claude Desktop to apply changes.

Testing:

  • Run the test suite if provided by the project: pytest

Notes:

  • The installation references a configuration-based approach typical for Claude Desktop MCP integrations. Ensure you have write access to the claude_desktop_config.json file and that Claude Desktop is not running during edits to avoid race conditions.

Additional notes

Tips and troubleshooting:

  • If the status resource returns that Claude Desktop is not running, a restart may still be attempted; the tool will start the app and report the new PID.
  • Ensure the uvx command is available in your PATH; if uvx is installed in a virtual environment, activate it or provide the full path to the uvx executable.
  • The Claude Desktop config file should remain valid JSON; malformed JSON will prevent MCP integration from loading.
  • If you encounter permission issues on macOS when launching Claude Desktop, verify that the app has necessary accessibility and automation permissions in System Settings.
  • The status resource is exposed at claude://status and returns JSON with running status, PID, and a timestamp; use it to confirm restarts completed successfully.

Related MCP Servers

Sponsor this space

Reach thousands of developers