Skip to main content
Glama

app_open

Open a web application in the default browser using the specified app name. Automatically serves the app if not already active, supporting single-app management.

Instructions

Open an app in the default web browser. If the app is not currently being served, it will be served first. Can only open one app at a time. Args: app_name: Name of the application to open Returns: A dictionary containing the result of the operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_nameYes

Implementation Reference

  • main.py:514-582 (handler)
    The handler function for the 'app_open' tool. It serves the app if necessary and opens it in the default browser (preferring Chrome app mode on macOS).
    @mcp.tool() def app_open(app_name: str) -> Dict[str, Any]: """ Open an app in the default web browser. If the app is not currently being served, it will be served first. Can only open one app at a time. Args: app_name: Name of the application to open Returns: A dictionary containing the result of the operation """ global http_server try: # Find the app directory app_path = os.path.join(APP_DIR, app_name) if not os.path.exists(app_path): return { "success": False, "error": f"App '{app_name}' not found at {app_path}" } # If the server is not running, start it if not http_server: serve_result = app_serve(app_name) if not serve_result["success"]: return serve_result # Get the URL from the serve result url = serve_result["url"] else: # Use the current server port url = f"http://localhost:{server_port}" # Check if we're on macOS if os.uname().sysname == "Darwin": # macOS # Use Chrome in app mode chrome_path = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" if os.path.exists(chrome_path): logger.info(f"Opening app in Chrome app mode: {url}") # Use Popen instead of run to avoid blocking subprocess.Popen([chrome_path, f"--app={url}"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) else: # Fallback to default browser if Chrome is not installed logger.info(f"Chrome not found, opening in default browser: {url}") # Use Popen instead of run to avoid blocking subprocess.Popen(["open", url], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) else: # For non-macOS systems, use the default browser # Use Popen instead of run to avoid blocking subprocess.Popen(["open", url], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) return { "success": True, "app_name": app_name, "url": url, "message": f"App '{app_name}' opened in browser at {url}" } except Exception as e: logger.error(f"Error opening app: {e}") return {"success": False, "error": f"Failed to open app: {str(e)}"}
  • main.py:514-514 (registration)
    Registration of the app_open tool using the @mcp.tool() decorator.
    @mcp.tool()
  • Description of the app_open tool in the system instructions for the MCP server.
    app_open - open an app in a browser (macos)

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/michaelneale/goose-app-maker-mcp'

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