Peter Knight Posted January 29 Posted January 29 I wanted a way to chat with my Processwire site and built a Module (PW MCP) and an MCP server to connect into it. It's a private repo at the moment but it can be public if anyone finds it useful. It's basically a way to use the Cursor Chat Ui to query my site, fields, templates and content. Here's part of the readme which explains it better. What Is It? ProcessWire MCP is a bridge between ProcessWire and Cursor IDE (the AI-powered code editor). It lets you query your ProcessWire site's structure and content directly from Cursor's chat interface using natural language. Instead of writing selectors or browsing the admin, you can just ask: "What templates does this site have?" "Show me the fields on the blog-post template" "Search for pages containing 'summer'" "Find all images with 'lake' in the filename" Why I Built It Cursor can see your template files and code in the local directory, but it can't see what's actually in your ProcessWire database — which templates and fields are registered, what pages exist, or what content they contain. With ProcessWire MCP, the AI can: Query the actual database schema (not just parse template files) Look up page content by ID, path, or selector Understand field configurations (types, settings, which templates use them) Search across all text content and find files/images Get RepeaterMatrix content with type labels See file metadata (dimensions, descriptions, URLs) It's the difference between seeing $page->body in code vs. knowing what that page's body actually contains. Architecture Cursor Chat → MCP Server (Node.js) → PHP CLI → ProcessWire API The module consists of: PwMcp — A ProcessWire module with a CLI interface mcp-server — A Node.js server that speaks the Model Context Protocol The CLI can also be used standalone for quick queries from terminal. Available Commands Command Description health Check connection and get site info list-templates List all templates with field counts get-template [name] Get template details and fields list-fields List all fields with types get-field [name] Get field details and usage get-page [id\|path] Get page by ID or path with all field values query-pages [selector] Query pages using PW selectors search [query] Search content across all text fields search-files [query] Search files by name/extension export-schema Export complete site schema Example: Health Check php site/modules/PwMcp/bin/pw-mcp.php health --pretty { "status": "ok", "pwVersion": "3.0.241", "siteName": "www.example.com", "moduleLoaded": true, "counts": { "templates": 45, "fields": 72, "pages": 960 } } Example: Content Search Ask Cursor: "Search for pages containing 'summer'" { "query": "summer", "count": 5, "results": [ { "id": 1764, "title": "Lake District walks in summer", "path": "/guides/lake-district-summer/", "template": "page-guide", "matchedField": "Body", "snippet": "The Lake District offers some of the best walking trails in summer. From gentle lakeside strolls to challenging fell walks..." } ] } Example: File Search Ask Cursor: "Find images with 'lake' in the filename" { "query": "lake", "count": 5, "results": [ { "filename": "lake-windermere-sunset.jpg", "url": "/site/assets/files/1070/lake-windermere-sunset.jpg", "size": 31207, "sizeStr": "30.5 kB", "description": "Sunset over Lake Windermere", "field": "Images", "page": { "id": 1070, "title": "Lake District walks in summer", "path": "/guides/lake-district-summer/" }, "width": 500, "height": 626 } ] } Example: Get Page with All Fields Ask Cursor: "Get the page at /about/" { "id": 1050, "name": "about", "path": "/about/", "url": "/about/", "template": "basic-page", "status": 1, "statusName": "published", "parent": { "id": 1, "path": "/", "title": "Home" }, "numChildren": 5, "created": "2023-05-15T10:30:00+00:00", "modified": "2024-11-20T14:22:00+00:00", "fields": { "title": "About Us", "body": "<p>We are a team of dedicated professionals...</p>", "Images": { "_count": 2, "_files": ["team-photo.jpg", "office.jpg"] } } } Example: RepeaterMatrix Support The module fully supports RepeaterMatrix fields, returning the actual content with type labels: { "matrix": { "_count": 3, "_items": [ { "_typeId": 1, "_typeLabel": "Body", "Body": "<h2>Welcome to our guide</h2><p>This guide covers...</p>", "Images": null }, { "_typeId": 2, "_typeLabel": "FAQs", "faq_question": "What is the best time to visit?", "faq_answer": "The summer months offer the best weather for walking..." }, { "_typeId": 3, "_typeLabel": "Call to Action", "cta_title": "Plan Your Visit", "cta_link": "/contact/" } ] } } So thats the first part done and working. My next plan is to be able to 1. PULL / convert a databse page into a local text file which lists all page properties, fields, template etc 2. edit the file as a local text file 3 PUSH the text file back into PW so that the original content picks up the changes Just having fun and building something useful. Very likely there are similar solutions or better ways to handle this but this suits my workflow ATM. Cheers P 4
Peter Knight Posted January 29 Author Posted January 29 I should clarify - I used Cursor itself to build this with Opus. I gave it a comprehensive PRD and built it in plan mode.
Peter Knight Posted January 29 Author Posted January 29 Ok, Phase 2 is working.... I can now say to Cursor... Get any page with "Lake Windermere" in the title Processwire will create 2 local files in site/syncs directory consisting of 1 x YAML version of the file listing all fields, content etc and understands to ignore HannaCode placeholders 1 x sidecar file listing the metadata (separate file to save AI tokens) In the site/syn folder, these pages are created using the matching directory structure of the page paths, so it's essentially matches the PW tree and makes it easy to find pages etc. I can then edit the YAML and tell Cursor to push the page back to PW and the page is updated
Peter Knight Posted January 29 Author Posted January 29 Cursor can summarise these changes better than me, so here's the update according to our robot overlords... What We Built Today The Problem Previously, to edit ProcessWire content, you had to either: Log into the admin panel and use the web interface Or ask the AI to read page content, but it couldn't write back The Solution We added Pull/Push sync — a Git-like workflow for ProcessWire content: Pull a page from ProcessWire → saves it as an editable YAML file Edit the YAML in your IDE (or have AI edit it) Push the changes back → updates the live page Key Features Feature Description Natural language -> Just say "Pull the About page" in Cursor chat Mirrored folders -> Pages save to site/syncs/[page-path]/ matching your site structure Readable YAML -> Content is human-editable, not database dumps Readable dates -> Dates show as 2026-01-27 not Unix timestamps Dry-run by default -> Push shows what would change before applying Conflict detection -> Warns if someone else edited the page since you pulled Revision tracking -> Each pull stores a hash to detect remote changes What Works Now Pull any page by path or ID Edit text fields, titles, SEO fields, dates Push changes back to ProcessWire Re-pull to get latest version What's Not Yet Implemented Editing RepeaterMatrix content (the complex page builders) Uploading/changing images and files Bulk pull/push of multiple pages Creating new pages Example Workflow You: "Pull the blog post about the Lake District" AI: Finds and pulls it to site/syncs/news/posts/lake-district-walks/page.yaml (this mirrors the page path/slug) You: Edit the YAML file + save You: "Push the Lake District walks page" AI: Shows preview, then applies changes to ProcessWire and updates the 'real' PW page 1
elabx Posted January 30 Posted January 30 Amazing! Definitely needed, will you release this as open source? Was about to put my hand into building something like this.
Peter Knight Posted February 2 Author Posted February 2 Hey thanks @elabx I guess so! If other people find it useful and can build upon it then that would be great. I've just added support for Matrix items and a related Module, which is essentially a front-end (in Processwire) for managing import and export. The only issue is I'm not very familiar with open-sourcing a Module and all the pull requests etc etc. But I suppose if it's open source then other people can handle that too? 1
bernhard Posted yesterday at 12:38 PM Posted yesterday at 12:38 PM On 2/2/2026 at 1:39 PM, Peter Knight said: But I suppose if it's open source then other people can handle that too? That's not the case. If you release it as open source you are still the owner of the repo. Others can then "fork" the repo (which creates a copy of your repo in their own github account) and can then work on it, make changes and commit them (to their repo). Once they have new commits they can create a pull request (it's easy, the github website will suggest it and it's really just a click of a button). That pull request will then be added to YOUR repo and you can then merge it (or anyone having rights for it). @gebeer how is that approach different to what we have been talking today? is one approach better than the other? seems like it's doing the same thing? 1
gebeer Posted 9 hours ago Posted 9 hours ago 19 hours ago, bernhard said: @gebeer how is that approach different to what we have been talking today? is one approach better than the other? seems like it's doing the same thing? @bernhard this approach looks great and seems a good solution for content related workflows. So for devs that also do content editing that should make it easier. The conversion from/to YAML is the key part here. @Peter Knight how did you implement that in cursor, as a skill with scripts?
pideluxe Posted 6 hours ago Posted 6 hours ago Slightly off-topic, but looking how others do similar things could be helpful: Drupal 10’s "Recipes" - modular YAML configuration packages for specific use cases like blogs or e-commerce - could inspire a similar approach in ProcessWire to streamline project setups. While PW already excels in flexibility, a "Recipe Manager" module could allow users to define, share, and install pre-configured templates, fields, and modules via JSON/YAML files, making it easier to replicate common setups (e.g., portfolios, multilingual sites) without manual repetition. Existing tools like RockMigrations or Site Profiles already cover parts of this, but a dedicated system could automate dependencies, roles, and content structures while keeping PW’s core simplicity intact. Community-driven recipes (e.g., for SEO, galleries, or contact forms) could further accelerate development - especially for agencies handling repetitive project types. Would such a system add value, or does PW’s current flexibility already cover these needs? 1
gebeer Posted 6 hours ago Posted 6 hours ago 3 minutes ago, pideluxe said: Slightly off-topic, but looking how others do similar things could be helpful: Drupal 10’s "Recipes" - modular YAML configuration packages for specific use cases like blogs or e-commerce - could inspire a similar approach in ProcessWire to streamline project setups. While PW already excels in flexibility, a "Recipe Manager" module could allow users to define, share, and install pre-configured templates, fields, and modules via JSON/YAML files, making it easier to replicate common setups (e.g., portfolios, multilingual sites) without manual repetition. Existing tools like RockMigrations or Site Profiles already cover parts of this, but a dedicated system could automate dependencies, roles, and content structures while keeping PW’s core simplicity intact. Community-driven recipes (e.g., for SEO, galleries, or contact forms) could further accelerate development - especially for agencies handling repetitive project types. Would such a system add value, or does PW’s current flexibility already cover these needs? Good idea, thank you! You might want to create a separate thread for this for further discussion. Sure people are interested in working together on this. 1
bernhard Posted 6 hours ago Posted 6 hours ago 9 minutes ago, pideluxe said: Existing tools like RockMigrations or Site Profiles already cover parts of this Which parts does RockMigrations not cover? Not saying it's perfect, but from what you wrote I don't see anything it can't do.
pideluxe Posted 6 hours ago Posted 6 hours ago I'm not that familiar with RockMigrations, but i think a static file for describing configurations and content is easier to modify/understand for someone who is not a programmer and maybe also easier to generate with AI. And it should not be a replacement, but an addition.
Peter Knight Posted 6 hours ago Author Posted 6 hours ago Some updates to the Cursor MCP to Processwire Module. There's a new front-end called MCP Sync. So if the MCP server acted as a bridge between Processwire and Cursor, why do I then need a front-end UI? Surely the point of an MCP server was 50% to bypass the Admin? Well, apart from building it for fun, I thought it was nice to have a more visual front-end for the import and export of pages. From the screenshot you might notice a traditional tree view with some useful columns... Change Status Never exported - probably doesnt need a badge but just means it's the original state Local Changes - I've downloaded the page to a file and edited it In Sync - changes have been imported Conflict - both the remote (PW) and the local file) have changes In the Actions column the three icons are WTF (Wire to file) 🙂 - exporting FTW (File to wire) - importing This was a little tricky because import and export mean different things wether you're operating from Curors MCP or import/export via the Cursor UI. So I settled on WTF and FTW because they are less relative to your environment. Big change Previously, when a page was in WTF mod,e I was storing a YAML file. Apart from Matrix items which were separate YAML files. But as we know, YAML can be prone to misformatting so the Module now understands if a field is a Rich Text field and will export that as a stand alone HTML file with a match name. It's means a few more files on the file system than the previous method but I like that I get a separate HTML entity. The screenshot of my local file system you can see I have WTF my Diagram and Illustrations page. And not just because the content was out of date and mentioned Macromedia Flash! Back to the GUI, you can see a screenshot of that row now picks up the change requiring a FTW. There's a few other helpful functions such as a changes preview as a safety step prior to committing a FTW. There's also a View YAML icon on each row which is a preview too. Here's the raw details of my WTF of Diagram and Illustrations page site/assets/pw-mcp/services/diagrams-illustration/page.meta.json This is a high-level overview of the exported page and is not meant to be edited. { "_readme": "DO NOT EDIT - This file is auto-generated. Edit page.yaml and field HTML files instead.", "pageId": 1051, "canonicalPath": "/services/diagrams-illustration/", "template": "services-detail", "title": "Professional Diagram Design & Illustration Services", "pulledAt": "2026-02-11T11:27:58+00:00", "lastPushedAt": null, "revisionHash": "sha256:2c264809d740ff009e27a5c664b3dced0e529493e54f39c3b458a718d47defb4", "contentHash": "0fc046d624ae2a6add4f6ffbcd6b80dd", "status": "clean" } /site/assets/pw-mcp/services/diagrams-illustration/page.yaml Note how the body field around line 4 or 5 is an RTE, so it's not included in the raw YAML but saved as a standalone file. fields: title: "Professional Diagram Design & Illustration Services" body_summary: "Need to clarify a product, process or service? Clarify your offering with our diagram design services." body: _file: fields/body.html image: [] service_thumbnail: - filename: icon-service-diagrams.png description: null width: 173 height: 113 seo_tab: null seo_title: "Professional Diagram Design & Illustration Services" seo_keywords: null seo_description: Transform complex ideas into clear, compelling diagrams. We create technical illustrations, infographics, and process diagrams that simplify your message and engage your audience. seo_image: null seo_custom: null seo_canonical: null seo_tab_END: null First_Child_Redirect: 0 sitemap_ignore: 0 site/assets/pw-mcp/services/diagrams-illustration/fields/body.html Just a html page and not worth including That's it for the mo. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now