Skip to main content
Glama
Suisei110

Apple Shortcut Maker MCP

by Suisei110
README.md
# Apple Shortcut Maker MCP

Create Apple Shortcut with AI using MCP (Model Context Protocol).

## Description

An MCP server that allows AI assistants (like Claude, Cursor, etc.) to create, duplicate, list, and run Apple Shortcuts directly from code. Uses the Cherri programming language for creating shortcuts programmatically.

## Features

- **Create Shortcut** - Create new Apple Shortcuts using Cherri code
- **Duplicate Shortcut** - Duplicate existing shortcuts with a new name
- **List Shortcuts** - List all available shortcuts on your Mac
- **Run Shortcut** - Run any shortcut with optional input

## Requirements

- macOS Monterey or later
- Python 3.10+
- [Cherri](https://github.com/electrikmilk/cherri) compiler installed

## Installation

### 1. Install Cherri

```bash
brew tap electrikmilk/cherri
brew install electrikmilk/cherri/cherri
```

Verify Cherri is installed:
```bash
cherri --version
```

### 2. Install this MCP server

```bash
# Clone the repository
git clone https://github.com/suisei110/apple-shortcut-maker-mcp.git
cd apple-shortcut-maker-mcp

# Install as package (recommended for direct CLI usage)
uv pip install -e . --system
```

Or install dependencies only:
```bash
uv sync
```

### 3. Configure MCP Client

#### Claude Desktop

Add this to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "Apple Shortcut Maker": {
      "command": "apple-shortcut-mcp",
      "enabled": true
    }
  }
}
```

Or using uv (alternative):
```json
{
  "mcpServers": {
    "apple-shortcut-maker": {
      "command": "uv",
      "args": [
        "--directory",
        "/PATH/TO/apple-shortcut-maker-mcp",
        "run",
        "apple-shortcut-mcp"
      ]
    }
  }
}
```

#### VS Code (Cursor)

Add to your MCP settings:
```json
{
  "mcpServers": {
    "Apple Shortcut Maker": {
      "command": "apple-shortcut-mcp",
      "enabled": true
    }
  }
}
```

## Usage

### Available Tools

Once configured, you can use these tools in your AI assistant:

#### 1. create_shortcut

Create a new Apple Shortcut from Cherri code.

**Parameters:**
- `code` (string, required): Cherri code for the shortcut
- `name` (string, required): Name for the shortcut

**Example:**
```
Create a shortcut named "Hello World" that shows an alert with "Hello, World!"
```

#### 2. duplicate_shortcut

Duplicate an existing shortcut with a new name.

**Parameters:**
- `source_name` (string, required): Name of the shortcut to duplicate
- `new_name` (string, required): Name for the new shortcut

#### 3. list_shortcuts

List all available shortcuts on your Mac.

**Parameters:**
- `folder` (string, optional): Filter by folder name

#### 4. run_shortcut

Run an existing shortcut.

**Parameters:**
- `name` (string, required): Name of the shortcut to run
- `input` (string, optional): Input to pass to the shortcut

## Cherri Code Examples

### Simple Alert

```javascript
#define name "Hello World"
#define color blue
#define glyph star

alert("Hello, World!", "Greeting")
```

### With Variables

```javascript
#define name "Calculate"

@number1 = askNumber("Enter first number")
@number2 = askNumber("Enter second number")
@result = calculate(@number1 + @number2)

showResult("Result: {@result}")
```

### Menu

```javascript
#define name "Main Menu"

menu "Choose an option:" {
    item "Option 1":
        alert("You chose 1")
    item "Option 2":
        alert("You chose 2")
    item "Option 3":
        alert("You chose 3")
}
```

## Troubleshooting

### Cherri not found

Make sure Cherri is installed and in your PATH:
```bash
which cherri
```

If not found, reinstall:
```bash
brew reinstall electrikmilk/cherri/cherri
```

### Shortcuts permission denied

Make sure Shortcuts has permission to run. Go to:
**System Settings > Privacy & Security > Automation**

### Package not found

Ensure you're using the correct Python path. The server requires Python 3.10+.

## License

MIT License - see [LICENSE](LICENSE) for details.

## Author

[suisei110](https://github.com/suisei110)

## Acknowledgments

- [Cherri](https://github.com/electrikmilk/cherri) - Shortcuts programming language
- [MCP](https://modelcontextprotocol.io/) - Model Context Protocol

---

## Quick Test

After installation, you can test the MCP server directly:

```bash
cd apple-shortcut-maker-mcp
uv run apple-shortcut-mcp
```

You should see the server start without errors. Then configure your MCP client to use it.

## Tools Available

Once configured, these tools will be available in your AI assistant:

| Tool | Description |
|------|-------------|
| `create_shortcut` | Create new Apple Shortcuts from Cherri code |
| `duplicate_shortcut` | Duplicate existing shortcuts |
| `list_shortcuts` | List all available shortcuts |
| `run_shortcut` | Run existing shortcuts |

## Example Usage

### Create a Shortcut
```
Create a shortcut named "Hello World" with code:
#define name "Hello World"
#define color blue
alert("Hello, World!", "Greeting")
```

### List Shortcuts
```
List all shortcuts on my Mac
```

### Run Shortcut
```
Run the shortcut named "My Daily Routine"
```