---
title: "CanAI for WordPress – Ihsan Berahim"
canonical: "https://ihsanberahim.com/lab/canai/"
updated: "2026-10-10T16:57:12Z"
---

# CanAI for WordPress – Ihsan Berahim

WordPress Engine v1.97 • Open Source

# CanAI for WordPress

A WordPress plugin that connects coding agents to WordPress via MCP. It handles template rendering with Twig 3, compiles Tailwind CSS for production, and manages site content without raw PHP execution.

[ View on GitHub ](https://github.com/ihsanberahim/wpcanai) [ Core capabilities](#capabilities)

## Architecture and core features

### Native MCP server

Exposes controlled WordPress abilities directly to coding agents such as Cursor and Claude Code, with permission checks and operation guardrails.

### Twig 3 sandboxing

Separates layout markup from theme PHP. Templates run in a sandboxed Twig environment with no eval calls.

### Automated Tailwind build

Uses the Tailwind Play CDN during template editing, then compiles a standalone production stylesheet when saving.

### Architectural highlights

- Supports hierarchical pages and clean URL paths like `/lab/canai/` without manual rewrite rules.
- Includes built-in string translation and menu management per language without external translation plugins.
- Audits structural landmarks (`<nav>`, `<main>`, `<section>`) to keep templates accessible and organised.

### Live implementation

This page hierarchy (both the `/lab/` hub and this `/lab/canai/` subpage) is rendered and managed directly through CanAI. All templates, layouts, and page records were authored via MCP tool calls.

 Verified via CanAI Nested Pages API

Previous project in Lab### GNU Screen Zero Trust

Remote terminal access and session management through Cloudflare Zero Trust tunnels.

[View project ](https://ihsanberahim.com/lab/gnu-screens/)

## Structured data

```json
[
    {
        "@type": "BreadcrumbList",
        "itemListElement": [
            {
                "@type": "ListItem",
                "position": 1,
                "name": "Home",
                "item": "https://ihsanberahim.com/"
            },
            {
                "@type": "ListItem",
                "position": 2,
                "name": "Lab",
                "item": "https://ihsanberahim.com/lab/"
            },
            {
                "@type": "ListItem",
                "position": 3,
                "name": "CanAI for WordPress",
                "item": "https://ihsanberahim.com/lab/canai/"
            }
        ]
    },
    {
        "@type": "SoftwareApplication",
        "name": "CanAI for WordPress",
        "url": "https://ihsanberahim.com/lab/canai/",
        "applicationCategory": "DeveloperApplication",
        "operatingSystem": "WordPress",
        "codeRepository": "https://github.com/ihsanberahim/wpcanai",
        "programmingLanguage": "PHP, Twig, JavaScript",
        "description": "A WordPress plugin that connects coding agents to WordPress via MCP with sandboxed Twig 3 templating and automated Tailwind CSS production builds.",
        "softwareRequirements": "WordPress 6.4+, PHP 8.1+",
        "author": {
            "@type": "Person",
            "name": "Ihsan Berahim",
            "jobTitle": "Ai Innovation Lead",
            "url": "https://ihsanberahim.com/#about"
        }
    }
]
```

<!-- WP Optimize page cache - https://teamupdraft.com/wp-optimize/ - Page not served from cache  -->
