acf-mcp-server

acf-mcp-server

Production-ready Model Context Protocol server for safely reading and changing WordPress + ACF Pro structure through ACF Local JSON and explicit WP-CLI synchronization.

Category
Visit Server

README

ACF MCP Server

Production-ready Model Context Protocol server for safely reading and changing WordPress + ACF Pro structure through ACF Local JSON and explicit WP-CLI synchronization.

The server is built for AI agents that need to inspect or propose changes to ACF field groups, custom post types, taxonomies, and options pages without direct database access.

Features

  • TypeScript, Node.js, Zod, Vitest, and @modelcontextprotocol/sdk.
  • JSON-first ACF Local JSON repository.
  • No direct SQL, no arbitrary PHP, no shell interpolation.
  • Automatic backups before mutations.
  • dryRun support for write workflows.
  • Explicit WP-CLI sync/import/export tools.
  • stdio transport by default, optional Streamable HTTP for development.
  • DDEV WordPress fixture configuration.

Install

npm install
npm run build

For local development:

export ACF_MCP_ACF_JSON_DIR="/absolute/path/to/wp-content/themes/my-theme/acf-json"
export ACF_MCP_WP_ROOT="/absolute/path/to/wordpress"
npm run dev

MCP Client Configuration

Example stdio configuration:

{
  "mcpServers": {
    "acf": {
      "command": "node",
      "args": ["/absolute/path/to/acf_mcp/dist/server/stdio.js"],
      "env": {
        "ACF_MCP_ACF_JSON_DIR": "/absolute/path/to/wp-content/themes/my-theme/acf-json",
        "ACF_MCP_WP_ROOT": "/absolute/path/to/wordpress"
      }
    }
  }
}

During development, use tsx:

{
  "command": "npx",
  "args": ["tsx", "/absolute/path/to/acf_mcp/src/server/stdio.ts"]
}

Safety Model

Local JSON is the primary source of truth. Tools that create, update, delete, or apply content models write JSON files only. They do not sync the WordPress database automatically.

Recommended workflow:

  1. Call a write tool with dryRun: true.
  2. Review the planned changes.
  3. Call the same tool with dryRun: false.
  4. Review git diff for acf-json.
  5. Call acf_sync_json with dryRun: true.
  6. Call acf_sync_json with dryRun: false only when ready.

Tools

  • acf_ping
  • acf_list_field_groups
  • acf_get_field_group
  • acf_create_field_group
  • acf_update_field_group
  • acf_delete_field_group
  • acf_validate_field_group
  • acf_export_json
  • acf_import_json
  • acf_sync_json
  • acf_list_post_types
  • acf_create_post_type
  • acf_list_taxonomies
  • acf_create_taxonomy
  • acf_list_options_pages
  • acf_create_options_page
  • acf_apply_content_model

See docs/tools.md for schemas and examples.

Example: Apply a Content Model

{
  "dryRun": true,
  "backup": true,
  "model": {
    "postTypes": [
      {
        "key": "post_type_product",
        "post_type": "product",
        "labels": { "name": "Products", "singular_name": "Product" },
        "public": true,
        "show_in_rest": true
      }
    ],
    "taxonomies": [
      {
        "key": "taxonomy_brand",
        "taxonomy": "brand",
        "object_type": ["product"],
        "labels": { "name": "Brands", "singular_name": "Brand" }
      }
    ],
    "optionsPages": [
      {
        "key": "ui_options_page_theme_settings",
        "menu_slug": "theme-settings",
        "page_title": "Theme Settings"
      }
    ],
    "fieldGroups": [
      {
        "key": "group_product_details",
        "title": "Product Details",
        "fields": [
          {
            "key": "field_product_subtitle",
            "label": "Subtitle",
            "name": "subtitle",
            "type": "text"
          }
        ],
        "location": [
          [{ "param": "post_type", "operator": "==", "value": "product" }]
        ]
      }
    ]
  }
}

DDEV

This repository includes .ddev/config.yaml for a WordPress fixture in wp/.

ACF Pro is not bundled or redistributed. Install your licensed ACF Pro copy in the fixture when running WordPress integration checks.

See docs/ddev.md.

Development

npm run typecheck
npm run lint
npm test
npm run build

Optional integration tests can be added under tests/integration and gated with:

RUN_DDEV_INTEGRATION=1 npm run test:integration

Project Structure

src/
  adapters/
  config/
  errors/
  prompts/
  repositories/
  resources/
  schemas/
  server/
  services/
  tools/
  types/
  utils/

Contributing

Keep changes small, tested, and backward-compatible. New tools must include:

  • Zod input schema.
  • Typed structured result.
  • Error handling through the shared tool wrapper.
  • Tests for success, validation failure, and dry-run behavior when mutating.

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured