Skip to main content
Glama
199-mcp

MCP Autostarter

by 199-mcp

restart_claude

Restarts the Claude Desktop application specifically when the MCP Autostarter fails, ensuring uninterrupted workflow and plugin reloading without closing the app.

Instructions

Fully restarts Claude Desktop application (use only if MCP restart fails)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'restart_claude' that delegates to ProcessManager.restartClaudeDesktop() and returns the result as JSON.
    case 'restart_claude': {
      try {
        console.error('Restarting Claude Desktop...');
        const result = await processManager.restartClaudeDesktop();
        
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      } catch (error) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to restart Claude Desktop: ${error}`
        );
      }
    }
  • Tool schema definition including name, description, and empty input schema for 'restart_claude'.
    name: 'restart_claude',
    description: 'Fully restarts Claude Desktop application (use only if MCP restart fails)',
    inputSchema: {
      type: 'object',
      properties: {},
      required: [],
    },
  • src/index.ts:30-62 (registration)
    Registration of the 'restart_claude' tool in the ListToolsRequestHandler response.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: 'restart_mcp',
            description: 'Intelligently restarts only the MCP handler process without disrupting Claude Desktop UI',
            inputSchema: {
              type: 'object',
              properties: {},
              required: [],
            },
          },
          {
            name: 'restart_claude',
            description: 'Fully restarts Claude Desktop application (use only if MCP restart fails)',
            inputSchema: {
              type: 'object',
              properties: {},
              required: [],
            },
          },
          {
            name: 'get_mcp_status',
            description: 'Check if MCP handler and Claude Desktop processes are running',
            inputSchema: {
              type: 'object',
              properties: {},
              required: [],
            },
          },
        ],
      };
    });
  • Core implementation of restarting Claude Desktop: finds process, kills it, launches new instance based on platform, and verifies restart.
    async restartClaudeDesktop(): Promise<RestartResult> {
      try {
        const claudeProcess = await this.detector.findClaudeDesktopProcess();
        
        if (!claudeProcess) {
          return {
            success: false,
            message: 'Claude Desktop is not running',
            error: 'CLAUDE_NOT_RUNNING'
          };
        }
    
        const oldPid = claudeProcess.pid;
        
        // Kill Claude Desktop
        await this.gracefulKill(claudeProcess.pid);
        await this.delay(2000);
    
        // Restart Claude Desktop based on platform
        await this.launchClaudeDesktop();
        
        // Wait for it to start
        const newProcess = await this.waitForClaudeDesktop(10000);
        
        if (newProcess) {
          return {
            success: true,
            message: 'Claude Desktop restarted successfully',
            oldPid,
            newPid: newProcess.pid
          };
        } else {
          return {
            success: false,
            message: 'Failed to restart Claude Desktop',
            error: 'CLAUDE_RESTART_FAILED'
          };
        }
      } catch (error) {
        return {
          success: false,
          message: 'Error restarting Claude Desktop',
          error: error instanceof Error ? error.message : 'UNKNOWN_ERROR'
        };
      }
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It indicates this is a restart operation (implying application termination and relaunch) but doesn't specify whether user data is preserved, if there are confirmation prompts, or what happens to ongoing processes. The description adds some context about being a fallback option but lacks detailed behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly concise with two clear clauses: the primary action and the usage condition. Every word earns its place, and the most important information (what it does) is front-loaded. No wasted words or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a restart tool with no annotations and no output schema, the description provides adequate context about purpose and usage guidelines. However, it lacks information about what 'fully restarts' entails behaviorally (graceful shutdown, force quit, data persistence) and what to expect after invocation, which would be helpful for a mutation operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, which is correct for a parameterless tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Fully restarts') and target resource ('Claude Desktop application'), distinguishing it from the sibling 'restart_mcp' tool. It provides a precise verb+resource combination that leaves no ambiguity about what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use this tool ('use only if MCP restart fails'), providing clear guidance on its specific use case versus the alternative 'restart_mcp' tool. This creates a clear decision hierarchy for the agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/199-mcp/mcp-autostarter'

If you have feedback or need assistance with the MCP directory API, please join our Discord server