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.
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.
dryRunsupport for write workflows.- Explicit WP-CLI sync/import/export tools.
stdiotransport 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:
- Call a write tool with
dryRun: true. - Review the planned
changes. - Call the same tool with
dryRun: false. - Review git diff for
acf-json. - Call
acf_sync_jsonwithdryRun: true. - Call
acf_sync_jsonwithdryRun: falseonly when ready.
Tools
acf_pingacf_list_field_groupsacf_get_field_groupacf_create_field_groupacf_update_field_groupacf_delete_field_groupacf_validate_field_groupacf_export_jsonacf_import_jsonacf_sync_jsonacf_list_post_typesacf_create_post_typeacf_list_taxonomiesacf_create_taxonomyacf_list_options_pagesacf_create_options_pageacf_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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。