MCP server

Skala’s command line tool, SkalaCLI, contains an MCP (Model Context Protocol) server. MCP is a standard way for AI agents to use tools, and Skala’s server lets agents like Claude Code, Codex, and Gemini CLI read, edit, render, and export Skala documents. The server works on the documents on disk, so Skala doesn’t need to be open.

Connecting an agent #

The easiest way to connect an agent is via the Agents tab of Skala’s settings, which can be opened by choosing Skala › Preferences. It shows the command for each agent, already filled in with the location of SkalaCLI on your Mac. Copy the command for your agent, and run it in Terminal.

For Claude Code:

claude mcp add skala -- "/Applications/Skala.app/Contents/SharedSupport/SkalaCLI" mcp

For Codex:

codex mcp add skala -- "/Applications/Skala.app/Contents/SharedSupport/SkalaCLI" mcp

For Gemini CLI:

gemini mcp add skala "/Applications/Skala.app/Contents/SharedSupport/SkalaCLI" mcp

For other agents, such as Claude Desktop and Cursor, add the following JSON to the agent’s MCP configuration.

{
  "mcpServers" : {
    "skala" : {
      "args" : [
        "mcp"
      ],
      "command" : "/Applications/Skala.app/Contents/SharedSupport/SkalaCLI"
    }
  }
}

The server is started by running SkalaCLI with the mcp command. It communicates using standard input and output, so it’s launched by your agent, rather than by you.

If you’re editing a document in Skala and an agent is working on the same document, save in Skala first. The agent can only see changes that have been saved, and Skala reloads the document after the agent saves it.

Further reading: Settings and command line

MCP tools #

The MCP server gives agents the following tools. Agents choose which tools to use by themselves, so you don’t need to know these to use them, but it helps to know what they can do.

Documents:

  • create_document, open_document, list_documents, save_document, reload_document, and close_document manage the documents the agent is working on.
  • undo_last_change restores a document to how it was before the last change. Only one step is kept.

Reading:

  • get_outline lists the pages, layers, and other items in a document.
  • get_node reads the full details of a page, layer, material, or other item.
  • find_nodes searches a document by name, type, material, build group, or constant.
  • describe_type explains the properties of each type of item.
  • get_bounds measures the bounding box of layers.
  • evaluate works out the result of expressions and colors, using the document’s constants.
  • render_preview renders pages or layers as images, so the agent can look at what it has made.

Creating and styling:

  • add_shape, add_text, and add_image_layer create painted shapes, text layers, and image layers.
  • import_image adds an image to the document.
  • set_fill, set_gradient, set_stroke, and add_effect change materials.

Editing:

  • insert_nodes, update_nodes, delete_nodes, move_nodes, duplicate_nodes, and copy_nodes add, change, remove, and rearrange items, including copying between documents.
  • set_constants and delete_constants manage the document’s constants.
  • set_document_size resizes or crops the document.
  • tidy_document cleans up a document.

Components:

  • get_component reads what a component shows, including its linked document, pages, constants, and overrides.
  • set_component changes a component’s linked document, page, and constant overrides.
  • list_component_issues lists the components in a document that can’t be drawn, and why.

Collections:

  • create_collection, open_collection, get_collection, save_collection, and close_collection manage the collections the agent is working on.
  • add_collection_documents, add_collection_group, rename_collection_group, move_collection_items, and remove_collection_items change the documents and groups in a collection. The documents themselves aren’t changed.
  • undo_last_collection_change restores a collection to how it was before the last change. Only one step is kept.

Exporting:

  • add_export sets up layers or pages to export, creating a build group and build task if needed.
  • build_document, build_group, build_page, and build_layers export images, in the same way as Build All. They can also write to a different folder.

get_bounds, render_preview, get_component, and list_component_issues need a GPU, so they may not work on some virtual machines and CI servers.

Further reading: Constants, expressions, components, and collections