# How to Integrate Palmier Pro with External Services: A Complete MCP API Guide

> Learn how to integrate Palmier Pro with external services using its MCP API. Control the editor via JSON-RPC calls from any service. Explore the palmier-io/palmier-pro repository for details.

- Repository: [Palmier/palmier-pro](https://github.com/palmier-io/palmier-pro)
- Tags: how-to-guide
- Published: 2026-06-22

---

**Palmier Pro exposes a native MCP HTTP server on `http://127.0.0.1:19789/mcp` that lets any external service control the editor via JSON-RPC calls.**

If you want to integrate Palmier Pro with AI agents, automation scripts, CI pipelines, or custom backends, you don't need to build UI plugins or hack into the application. According to the `palmier-io/palmier-pro` source code, the editor ships with a built-in **Model Context Protocol (MCP)** server that exposes tools and resources over pure HTTP. This guide walks through the exact endpoints, file locations, and code patterns you need to build robust integrations.

## The MCP HTTP Server: Core Integration Surface

When Palmier Pro launches, it automatically starts an MCP server at `http://127.0.0.1:19789/mcp`, implemented in [`Sources/PalmierPro/Agent/MCP/MCPService.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Sources/PalmierPro/Agent/MCP/MCPService.swift). This is a language-agnostic JSON-RPC endpoint that accepts standard HTTP POST requests.

The protocol exposes four primary methods:

- **`listTools`** – Returns every available tool the editor can execute (e.g., `insertClip`, `applyEffect`, `exportProject`)
- **`callTool`** – Executes a tool with provided arguments; dispatches to `ToolExecutor` in [`Sources/PalmierPro/Agent/Tools/ToolExecutor.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Sources/PalmierPro/Agent/Tools/ToolExecutor.swift)
- **`listResources`** – Enumerates read-only assets like AI model catalogs
- **`readResource`** – Fetches JSON data for a specific URI (e.g., `palmier://models/video`)

Any service capable of HTTP requests—Python scripts, Node.js utilities, CI jobs, or AI agents like Claude and Cursor—can integrate with Palmier Pro through this surface.

## Calling Tools from External Services

Tools are the primary mechanism for modifying projects or triggering actions. Each tool follows a strict schema defined in `ToolDefinition` structs.

### Basic Tool Call Structure

```python
import requests, json

MCP_URL = "http://127.0.0.1:19789/mcp"

def call_tool(name, args):
    payload = {
        "jsonrpc": "2.0",
        "method": "callTool",
        "params": {"name": name, "arguments": args}
    }
    resp = requests.post(MCP_URL, json=payload)
    resp.raise_for_status()
    return resp.json()

# Insert a clip at track 1, position 5.0 seconds

result = call_tool(
    "insertClip",
    {"clipId": "1234", "track": 1, "position": 5.0}
)

```

The `ToolExecutor` receives these calls and routes them to the appropriate handler. Mutation operations require the editor to be active; `ToolExecutor` validates this via the `editorProvider` before executing destructive actions.

### Adding Captions Programmatically

```python
result = call_tool(
    "addCaption",
    {
        "track": 2,
        "time": 12.3,
        "text": "Hello, world!",
        "style": {"font": "SpaceGrotesk", "size": 24}
    }
)
print(json.dumps(result, indent=2))

```

## Reading Resources: Model Catalogs and Static Data

Resources provide read-only access to editor configuration. The video model list is constructed from `VideoModelConfig.allModels` in [`Sources/PalmierPro/Agent/Models/VideoModelConfig.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Sources/PalmierPro/Agent/Models/VideoModelConfig.swift) and exposed via the `palmier://models/video` URI.

### Fetching Available Models

```bash
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"readResource","params":{"uri":"palmier://models/video"}}' \
  http://127.0.0.1:19789/mcp

```

Adding new models to Palmier Pro only requires appending a `VideoModelConfig` instance to the configuration array; the MCP server generates the JSON response dynamically inside `readResource`.

## Extending the Integration: Custom Tools and Exporters

For deep integrations, you can extend Palmier Pro's capabilities by registering custom tools or export formats directly in the source.

### Registering a Custom Tool

Define the tool schema in a new file:

```swift
// Sources/PalmierPro/Agent/Tools/ToolDefinitions/MyCustomTool.swift
import MCP

struct MyCustomTool {
    static let definition = ToolDefinition(
        name: .init(rawValue: "myCustomExport"),
        description: "Exports the current project as a custom JSON bundle",
        schema: .object([
            "includeAssets": .boolean(description: "Whether to embed media files")
        ])
    )
}

```

Then extend `ToolDefinitions.all` in [`Sources/PalmierPro/Agent/Tools/ToolDefinitions.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Sources/PalmierPro/Agent/Tools/ToolDefinitions.swift) and implement the execution logic in `ToolExecutor+Export.swift`. The tool automatically appears in `listTools` responses after compilation.

### Creating Custom Export Formats

The export pipeline in `Sources/PalmierPro/Export` uses a pluggable architecture. Exporters conform to `ProjectExporter` and register via `ExportService.registerExporters()`:

```swift
// Sources/PalmierPro/Export/CustomJSONExporter.swift
import Foundation

struct CustomJSONExporter: ProjectExporter {
    static let identifier = "com.palmier.customJSON"

    func export(_ project: Project, to destination: URL) async throws {
        let json = try JSONEncoder().encode(project)
        try json.write(to: destination.appendingPathComponent("project.json"))
    }
}

// In ExportService.swift
func registerExporters() {
    exporters.append(CustomJSONExporter.self)
    // existing exporters...
}

```

Third-party tools trigger exports via the `exportProject` MCP tool, which returns the output path in the `CallTool.Result` payload.

## Security Configuration and Deployment

The MCP server includes several security controls:

- **Enable/Disable toggle**: Controlled via `io.palmier.pro.mcp.enabled` preference, accessible through `MCPService.isEnabledPreference`
- **Read-only default**: Resources are always readable; tools mutating state require an active editor session
- **HTTPS enforcement**: When exposed beyond localhost, the server validates `url.scheme == "https"` before accepting external resources (see `ToolExecutor+Import.swift`)

For production deployments, run the MCP server on a privileged port behind a TLS-terminating reverse proxy.

## Reference: Key Source Files

| Component | Path | Purpose |
|-----------|------|---------|
| **MCP server** | [`Sources/PalmierPro/Agent/MCP/MCPService.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Sources/PalmierPro/Agent/MCP/MCPService.swift) | HTTP endpoint startup, tool/resource registration |
| **Tool dispatcher** | [`Sources/PalmierPro/Agent/Tools/ToolExecutor.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Sources/PalmierPro/Agent/Tools/ToolExecutor.swift) | Routes MCP calls to editor actions |
| **Tool registry** | [`Sources/PalmierPro/Agent/Tools/ToolDefinitions.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Sources/PalmierPro/Agent/Tools/ToolDefinitions.swift) | Central catalog of tool schemas |
| **Model configuration** | [`Sources/PalmierPro/Agent/Models/VideoModelConfig.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Sources/PalmierPro/Agent/Models/VideoModelConfig.swift) | Generates `palmier://models/video` resource |
| **Export orchestration** | [`Sources/PalmierPro/Export/ExportService.swift`](https://github.com/palmier-io/palmier-pro/blob/main/Sources/PalmierPro/Export/ExportService.swift) | Manages pluggable export formats |
| **Import validation** | `Sources/PalmierPro/Agent/Tools/ToolExecutor+Import.swift` | HTTPS scheme validation for external resources |

## Summary

Integrating Palmier Pro with external services centers on its **MCP HTTP server** at `http://127.0.0.1:19789/mcp`. Key integration patterns include:

- **HTTP JSON-RPC calls** to `listTools`, `callTool`, `listResources`, and `readResource` for remote control
- **Python, Node.js, or shell scripts** that POST to the MCP endpoint without UI dependencies
- **Custom tool registration** by extending `ToolDefinitions` and `ToolExecutor` for domain-specific operations
- **Pluggable exporters** implementing `ProjectExporter` for custom asset pipelines
- **Security controls** via user defaults and HTTPS enforcement for production exposure

## Frequently Asked Questions

### What protocol does Palmier Pro use for external integration?

Palmier Pro implements the **Model Context Protocol (MCP)**, a JSON-RPC over HTTP specification. The server listens on port 19789 and exposes standard MCP methods for tools (actions) and resources (read-only data).

### Can I integrate Palmier Pro without modifying its source code?

Yes. The MCP server runs automatically when the app starts. Any external process can send HTTP POST requests to `http://127.0.0.1:19789/mcp` to list available tools, execute editing commands, or retrieve model configurations. No Swift coding or recompilation is required for basic integrations.

### How do I add custom export formats to Palmier Pro?

Create a new type conforming to `ProjectExporter` in `Sources/PalmierPro/Export/`, then append it to the `exporters` array in `ExportService.registerExporters()`. The new format becomes available via the `exportProject` MCP tool immediately after compilation.

### Is the MCP server secure for production use?

By default, the server binds to localhost only. For external access, the source code enforces HTTPS validation in `ToolExecutor+Import.swift`. For production, disable the default server and run a signed binary on a privileged port with TLS termination via a reverse proxy.