# Appy as an MCP server

`Appy mcp` serves Appy's tools over the Model Context Protocol (stdio), so an agent can build Mac apps from web
files, install websites as apps, and look at what it made.

## Adding it to an agent

Claude Code:

```sh
claude mcp add appy -- /Applications/Appy.app/Contents/MacOS/Appy mcp
```

Claude Desktop, Cursor and other clients take the same command in their MCP settings:

```json
{ "mcpServers": { "appy": { "command": "/Applications/Appy.app/Contents/MacOS/Appy", "args": ["mcp"] } } }
```

For a development build use `build/Appy.app/Contents/MacOS/Appy` instead.

## Tools

| Tool | What it does |
| --- | --- |
| `get_docs` | app.json and the `window.appy` API (this repository's `docs/appy-json.md`). |
| `create_app` | Makes an app from files (HTML, CSS, JS, images as base64), installs it and opens it. `update` replaces an app it made before, keeping its id and saved data. `save_package` also writes a `.appyapp` to share. |
| `install_web_app` | Installs a website, or a community catalog name, as an app. |
| `list_apps` | Installed apps: id, name, kind, start address, what each may do, whether it runs. |
| `open_app` | Opens an app; `restart` relaunches it. |
| `inspect_app` | A screenshot of the app's page, and the result of a script run in it. |
| `uninstall_app` | Removes an app and its data. |
| `get_extension_docs` | How to write an Appy extension (this repository's `docs/extensions.md`). Read before `create_extension`. |
| `create_extension` | Builds a Raycast-style extension from TypeScript/React files with esbuild, installs it and opens it. `update` replaces the code of an extension it made before, keeping its data and preferences. |
| `list_extensions` | Installed extensions: id, title, source, commands with enabled state, menu-bar activation, whether a process runs. |
| `run_extension` | Runs one command of a local or MCP-made extension: view commands open in the launcher, no-view commands return done/error + toasts/HUDs + logs, menu-bar commands return their rendered menu. |
| `inspect_extension` | Drives the launcher for a local or MCP-made extension: steps (`type`, `key`, `select`, `action`, `dropdown`, `fill`, `submit`, `wait`), then state, events, logs and a PNG. |
| `install_raycast_extension` | Installs a Raycast Store extension by exact `author/name`; search words install one clear match or return the top 10 candidates. |
| `uninstall_extension` | Removes an extension's code, data and Keychain items. |
| `publish_to_store` | Publishes an app made with `create_app`, or an extension made with `create_extension`, to the Appy Store as source code, and returns its public page. Publishing again updates the same listing. `remove` takes a listing down. Ask the person first: the code becomes public. |

## MCP servers Appy uses

The other way round: Appy is also an MCP client. Servers added in Settings › MCP Servers, with the CLI, or declared by an
extension can be called by the extensions the person allows (`docs/extensions.md`).

```sh
appy mcp add chime -- /Applications/Chime.app/Contents/MacOS/chime-mcp
appy mcp add linear https://mcp.linear.app/mcp && appy mcp login linear      # OAuth, in the browser
appy mcp add other https://example.com/mcp --header "Authorization: Bearer …"
appy mcp list | tools <name> | call <name> <tool> '{"a":1}' | remove <name>
```

Servers are in `~/Library/Application Support/Appy/mcp.json`; header and environment values and sign-ins are in the Keychain.
Local servers speak over stdin and stdout, remote ones over Streamable HTTP (the older HTTP+SSE transport isn't supported).
Plain http is only for this Mac and the local network. Only tools are used, not resources or prompts.

## What to know

- Whatever an app asks for (notifications, a menu bar item, shortcuts…) is granted, as with `appy install`: adding
  Appy's server to an agent is the person's consent. Apps stay visible in Appy's Settings, where each grant can be
  turned off.
- `inspect_app` reaches apps that `create_app` or `open_app` opened: those run with `APPY_DEBUG=1`, which lets local
  processes run scripts in their page through Appy's debug channel. Apps opened from the Dock or Finder do not listen.
  The screenshot is of the page, without the window frame.
- Only apps made from files can be updated; a website app is reinstalled instead.
- The server runs in its own process and needs Appy installed (it uses Appy's installer and app runtime), not running.
- Extensions are different: running and inspecting them goes through the host app, which the server opens when it
  isn't running. Only extensions whose source is `mcp` or `local` can be run or inspected — Raycast Store extensions
  may hold the person's signed-in data, so they are refused. Dependencies must be exact versions published at least
  7 days ago, and are installed with `--ignore-scripts`.
