Skip to main content
Glama
andreahaku

Expo iOS Development MCP Server

by andreahaku

expo.stop

Stop the Expo/Metro development server to end debugging sessions and free system resources for iOS React Native applications.

Instructions

Stop the Expo/Metro development server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registers the 'expo.stop' MCP tool with an empty input schema. The handler calls stopExpo() from expo.ts and returns a standardized MCP response or error.
    server.tool(
      "expo.stop",
      "Stop the Expo/Metro development server",
      {},
      async () => {
        try {
          await stopExpo();
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({ success: true, message: "Expo stopped" }),
              },
            ],
          };
        } catch (error) {
          return handleToolError(error);
        }
      }
    );
  • Core implementation of stopping Expo: checks if process exists, sends SIGTERM, waits 2s, then SIGKILL if needed, clears state variables, updates global state manager, and logs.
    export async function stopExpo(): Promise<void> {
      logger.info("expo", "Stopping Expo/Metro...");
    
      if (!expoProcess) {
        logger.info("expo", "No Expo process running");
        stateManager.updateExpo({ state: "stopped" });
        return;
      }
    
      try {
        // Send SIGTERM first for graceful shutdown
        expoProcess.kill("SIGTERM");
    
        // Wait a bit for graceful shutdown
        await new Promise((resolve) => setTimeout(resolve, 2000));
    
        // If still running, force kill
        if (expoProcess) {
          expoProcess.kill("SIGKILL");
        }
      } catch {
        // Ignore errors during cleanup
      }
    
      expoProcess = null;
      outputBuffer = "";
      startedAt = null;
    
      stateManager.updateExpo({
        state: "stopped",
        metroUrl: undefined,
        processId: undefined,
      });
    
      logger.info("expo", "Expo stopped");
    }

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/andreahaku/expo_ios_development_mcp'

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