Skip to content

ACF (Advanced Custom Fields)

New in v3.2.1. When Advanced Custom Fields (free or PRO) is active, EMCP exposes ACF as a first-class integration: enough for an agent to stand up a whole content structure end to end: custom post type → taxonomy → field group → posts with values.

To keep the MCP tool-list small, the whole domain is exposed as two dispatcher tools rather than one tool per operation:

  • acf-read: all read operations (enabled by default)
  • acf-write: all write operations (ships disabled by default)

Each takes an operation and an arguments object. Call a tool with no operation to get its catalog of operations, then call it again to run one:

// discover
acf-read({})
// → { mode: "read", operations: [ { operation: "list-field-groups", … }, … ] }
// act
acf-read({ operation: "get-fields", arguments: { post_id: 123 } })

This is the same discover → act pattern as the widget catalog. The two dispatchers only register when ACF is active, and each operation still enforces its own WordPress capability, checked per call.

OperationArgumentsReturns
list-field-groupsNoneField groups: key, title, active, field count.
get-field-group{ key }One group’s location rules + recursive field tree. Read this before writing values.
list-options-pagesNoneACF PRO options pages (empty on free ACF).
get-fields{ post_id } or { options_page }Current field values, formatted.
list-post-typesNoneACF-managed custom post types (ACF 6.1+).
get-post-type{ key }One CPT’s definition (6.1+).
list-taxonomiesNoneACF-managed taxonomies (6.1+).
get-taxonomy{ key }One taxonomy’s definition (6.1+).
OperationArgumentsNotes
update-fields{ post_id|options_page, fields: { name: value } }Writes values by field name (resolved to keys).
create-field-group{ title, fields: […], location: [[…]] }Creates a group with fields + location rules.
update-field-group{ key, … }Edit settings / add fields. No deletes or renames.
create-post-type{ post_type, title, … }Registers a CPT as data through ACF (6.1+).
update-post-type{ key, … }Edit a CPT. Slug is immutable. (6.1+)
create-taxonomy{ taxonomy, title, object_type: […] }Registers a taxonomy as data (6.1+).
update-taxonomy{ key, … }Edit a taxonomy. Slug is immutable. (6.1+)

The Custom Post Type / Taxonomy operations require ACF 6.1+; they’re omitted from the catalog on older ACF.

  • Data, not code. Custom post types and taxonomies are registered through ACF’s own acf_import_post_type / acf_import_taxonomy: nothing executable is written, and ACF registers them itself.
  • No deletes. There is no delete operation for anything.
  • Immutable identifiers. A field’s name/key/type, and a post type / taxonomy slug, can never change: renaming would orphan stored content.
  • PRO fields. Repeaters, flexible content (rows validated against the field’s layouts), galleries, groups and clones round-trip as nested JSON; on free ACF those field types are rejected with acf_pro_required.
  • Per-operation capabilities. Field reads need edit_posts; field-value writes need edit_post on the target; field-group / CPT / taxonomy writes need manage_options.
// 1. a custom post type
acf-write({ operation: "create-post-type",
arguments: { post_type: "book", title: "Books", singular: "Book",
supports: ["title","editor","thumbnail"] } })
// 2. a taxonomy on it
acf-write({ operation: "create-taxonomy",
arguments: { taxonomy: "genre", title: "Genres", object_type: ["book"] } })
// 3. a field group on that post type
acf-write({ operation: "create-field-group",
arguments: { title: "Book Details",
fields: [ { label: "Subtitle", name: "subtitle", type: "text" },
{ label: "Rating", name: "rating", type: "number", min: 0, max: 5 } ],
location: [[ { param: "post_type", operator: "==", value: "book" } ]] } })
// 4. create a book (with the content tools), then write its values
acf-write({ operation: "update-fields",
arguments: { post_id: 123, fields: { subtitle: "The Spice Must Flow", rating: 5 } } })
// 5. read it back
acf-read({ operation: "get-fields", arguments: { post_id: 123 } })

The dispatchers appear under EMCP Tools → Tools → Plugins → ACF as two toggles, acf-read (on) and acf-write (off by default), each card listing the operations it covers. Toggle a tool to allow or block all of its operations at once.

Pro ships an emcp-plugins Agent Skill that teaches a connected agent this whole model (the two-dispatcher pattern, the discover→act flow, and the full ACF operation reference), so it drives the integration correctly without you spelling it out.