# Patchwork MCP server

> Lets an AI agent edit FileMaker structures including fields, scripts, value lists, layouts, and themes with reversible changes.

- Repository: https://github.com/Abdeltoto/patchwork-filemaker-mcp
- Page: https://hostedmcp.org/servers/abdeltoto/patchwork-filemaker-mcp
- Transport: stdio
- Stars: 1
- License: MIT
- Latest version: 0.1.0

## Install

### Claude Code

```sh
claude mcp add --env 'PATCHWORK_PASSWORD=<YOUR_PATCHWORK_PASSWORD>' patchwork-filemaker-mcp -- uvx filemaker-patchwork
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "patchwork-filemaker-mcp": {
      "command": "uvx",
      "args": [
        "filemaker-patchwork"
      ],
      "env": {
        "PATCHWORK_PASSWORD": "<YOUR_PATCHWORK_PASSWORD>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "patchwork-filemaker-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "filemaker-patchwork"
      ],
      "env": {
        "PATCHWORK_PASSWORD": "<YOUR_PATCHWORK_PASSWORD>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"patchwork-filemaker-mcp","type":"stdio","command":"uvx","args":["filemaker-patchwork"],"env":{"PATCHWORK_PASSWORD":"<YOUR_PATCHWORK_PASSWORD>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "patchwork-filemaker-mcp": {
      "command": "uvx",
      "args": [
        "filemaker-patchwork"
      ],
      "env": {
        "PATCHWORK_PASSWORD": "<YOUR_PATCHWORK_PASSWORD>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add patchwork-filemaker-mcp --env 'PATCHWORK_PASSWORD=<YOUR_PATCHWORK_PASSWORD>' -- uvx filemaker-patchwork
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.patchwork-filemaker-mcp]
command = "uvx"
args = ["filemaker-patchwork"]

[mcp_servers.patchwork-filemaker-mcp.env]
PATCHWORK_PASSWORD = "<YOUR_PATCHWORK_PASSWORD>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'PATCHWORK_PASSWORD=<YOUR_PATCHWORK_PASSWORD>' patchwork-filemaker-mcp uvx -- filemaker-patchwork
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "patchwork-filemaker-mcp": {
      "command": "uvx",
      "args": [
        "filemaker-patchwork"
      ],
      "env": {
        "PATCHWORK_PASSWORD": "<YOUR_PATCHWORK_PASSWORD>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `PATCHWORK_PASSWORD` | no | yes | Password of the FileMaker account used to open the file. Leave empty for files with no password. |

## Tools (21)

- `patchwork_open`: Open a closed .fmp12 as a new working copy (v000). Never modifies the source. The password comes from PATCHWORK_PASSWORD.
- `patchwork_status`: Current version, source file and object counts. (read-only)
- `patchwork_list`: List objects: layouts, scripts, value-lists, custom-functions, themes, tables, table-occurrences, or fields (with table). (read-only)
- `patchwork_show`: Show one object. A script comes as FileMaker text, one step per line (xml=true for its XML). Other kinds come as Save-as-XML. kind=field takes Table::Field. kind=step shows the XML of a real step by its name, e.g. 'Set Field'. (read-only)
- `patchwork_add_field`: Add a field to a table. type: Text, Number, Date, Time, Timestamp, Container. With calc it becomes a calculation.
- `patchwork_add_value_list`: Add a custom value list.
- `patchwork_add_custom_function`: Add a custom function.
- `patchwork_add_script`: Create a script. steps: FileMaker script text, one step per line, or <Step> XML. Text works for: # (comment), Allow User Abort, Beep, Close Window, Commit Records/Requests, Delete Record/Request, Else, Else If, End If, End Loop, Exit Loop If, Exit Script, Freeze Window, Go to Layout, Halt Script, If, Loop, New Record/Request, Perform Script, Refresh Window, Set Error Capture, Set Field, Set Variable, Show All Records, Show Custom Dialog.
- `patchwork_set_steps`: Replace all the steps of a script with the text from patchwork_show, edited. Lines left as they were keep their step exactly, whatever the step.
- `patchwork_append_steps`: Add steps at the end of a script.
- `patchwork_replace`: Replace a whole object with edited XML from patchwork_show. Supported: layout, theme, value-list, custom-function.
- `patchwork_place_field`: Put a field on a layout. Copies the look and label of `near`, a field already on the layout, and inserts a row below it (objects underneath move down, the part grows). side=right places it next to `near` if there is room.
- `patchwork_uses`: What uses an object: references (certain) and mentions by name in calculations (possible). Call it before deleting or renaming. Kinds: layout, script, value-list, custom-function, table, table-occurrence, field (Table::Field).
- `patchwork_delete`: Delete an object: script, layout, value-list, custom-function, or field (Table::Field). Refused when other objects reference it: show the list to the user, and only then retry with force=true.
- `patchwork_retheme`: Rewrite a theme: colors (map of hex to hex), fonts (map 'WinName,MacName' to 'WinName,MacName'), new display name.
- `patchwork_recolor_layouts`: Rewrite the layouts that change: local colors, fonts, or one field swapped for another everywhere.
- `patchwork_palette`: Colors a theme uses, most frequent first. (read-only)
- `patchwork_push`: Apply a hand-written FMUpgradeToolPatch. Prefer the specific tools.
- `patchwork_log`: Version history with the changes of each version. (read-only)
- `patchwork_undo`: Drop the last version.
- `patchwork_save`: Write the current version to a new .fmp12 file (never the source).

## FAQ

### Does Patchwork change my data records?

No, it only changes the structure of the file such as fields, scripts, layouts, value lists, and themes. For data manipulation, you should use the Data API or OData.

### Can I undo changes made by the AI?

Yes, every change is versioned and can be reverted using the undo command.

### Does it work on hosted FileMaker files?

No, it works on closed files. You should edit a copy, test it, and then deploy it as usual.

### What dependencies are required to run Patchwork?

It requires the Claris command-line tools (FMUpgradeTool and FMDeveloperTool) which are included with the FileMaker Server installer.
