WordPress, ChatGPT and MCP on AWS Lightsail

WordPress, ChatGPT and MCP on AWS Lightsail

How a small website recommending children's books led me to explore n8n, OpenClaw and a self-hosted MCP server - and how this is affordable and useful for your public site.

AWS Technical Evangelist

From Zero to Ninja: Automate Publishing on Your WordPress Site

The starting point: books, children and a WordPress site

Some time ago, I set up  More Books & Fewer Screens , a small WordPress website to recommend children's books and encourage reading. Its content comes from something very simple: conversations with my son and his friends about the books they have read and enjoyed. As a parent, it can sometimes be difficult to choose the right books for your child, so I decided to share our experiences through the website.
I could have used several hosting providers, from SaaS solutions such as WordPress.com to VPS providers offering very low prices per server. Instead, I decided to use AWS because I was familiar with it and could draw on its broad range of services to extend the project if necessary. As a starting point, I chose AWS Lightsail rather than EC2 because of its predictable pricing and preconfigured images, which are particularly well suited to this use case: a public website.

Technological context

As I mentioned before, the website runs on WordPress, hosted on Amazon Lightsail. I use Amazon Route 53 for DNS and Amazon Simple Email Service (SES) for transactional emails, such as confirmations, notifications and contact form messages.
Nothing particularly unusual about the infrastructure: a small application, a limited operational budget and a few AWS services around it.

Pain point

The problem appeared on the editorial side. I wanted to turn those conversations into structured content without having to edit every post manually in the WordPress administration interface. At the same time, I did not want to delegate the children's opinions to an AI system. The interviews and recommendations are the source material; AI can help me prepare and manage the entries, but not replace that source.
I was looking for a convenient, semi-automated workflow, preferably one that could reuse the ChatGPT or Claude subscription I already had, without an additional paid platform standing between the assistant and my website.

Three approaches to the same problem

I looked at three architectural alternatives, in that order. These were approaches I considered and tested, not three production deployments or a formal benchmark.
1. n8n on Lightsail
The first approach was to run n8n on another Lightsail instance (with a MEAN setup) and build a workflow around content preparation and the WordPress API. This would put the emphasis on automation and orchestration. It also implied managing a separate workflow runtime for what was still a relatively small editorial requirement. There are many workflows integrating AI for text and image generation. I found them a little complex for my needs, but they gave me plenty of ideas about automation and became the starting point for this project.
2. OpenClaw on Lightsail
The second possibility was to host an agent runtime separately and use it to interact with WordPress. This is a different model: the agent has its own execution environment rather than operating directly from the conversational SaaS product. It was worth considering, but it also meant more infrastructure and more moving parts to operate. Thanks to Lightsail, deployment and initial setup were straightforward, but I couldn't find the right balance between interacting with the agent and customising the content.
3. A remote MCP server connected to ChatGPT or Claude
Finally, I explored exposing a deliberately limited set of WordPress capabilities through the Model Context Protocol (MCP). In this option, the conversational interface remains in ChatGPT or Claude, while a small service under my control mediates access to WordPress. I had first tested this approach locally, using MCP to manage software running on my own machine, so I decided to adapt it to WordPress.
The third option is the one I implemented. It fitted the scope of the project: I already had WordPress and I already used a conversational assistant. What I needed was a controlled connection between them, not another content management interface or a general-purpose autonomous agent.
For more information about the available images, see the  AWS Lightsail instance image documentation .

What I built

The result is wpmcp, a remote MCP server that runs alongside WordPress on the same Lightsail instance. The assistant connects to its HTTPS endpoint. Apache forwards MCP requests to an isolated systemd service, and that service interacts with WordPress through a local REST API and a small must-use plugin (mu-plugin).
That distinction is important: MCP does not generate the text itself. It exposes operations that the conversational client can invoke. The AI model remains on the SaaS side (ChatGPT or Claude); WordPress and the access-control boundary remain on my infrastructure.
The integration provides tools to inspect content, create and update drafts, manage translations and SEO information, and carry out certain publishing operations. The security model separates reading from writing, restricts WordPress permissions, protects sensitive pages, and makes live changes reversible. Authentication uses OAuth 2.1 with a password and TOTP-based approval. The WordPress integration account is limited to loopback access rather than being exposed to the Internet.
There are deliberate limits. The repository describes an early implementation for one owner and one WordPress site, not a multi-tenant publishing platform. It also records that ChatGPT connectivity has been verified, while Claude integration is documented but not yet marked as verified. That is the scope I would use when evaluating or replicating it.
[Architecture diagram]
Architecture: ChatGPT (or Claude) connects over HTTPS to the remote MCP server on the same Lightsail instance as WordPress. Amazon Route 53 provides DNS; Amazon SES handles transactional email. Terraform is used for deployment, not for runtime content requests.
To achieve this, I used Claude Code to develop a repository that brings together the different components required to deploy and operate the solution:
  • Terraform stacks to provision the Lightsail instance, configure DNS through Route 53 and integrate Amazon SES.
  • Bash scripts to prepare the server, configure WordPress and deploy the MCP service.
  • WordPress integration, including a small bridge plugin to expose the necessary operations and an SMTP configuration for transactional emails.
  • Technical documentation, covering installation, security, operations and common troubleshooting scenarios.
The deployment supports both the older Bitnami-based WordPress images and the newer Debian-based Lightsail images.
I have published the code, deployment scripts and Terraform configurations in the following repository:

Why is this useful for you?

The main advantage is that you can extend an existing WordPress website with AI-assisted content management without introducing another automation platform or a paid intermediary service.
For a small personal project, this approach offers several practical benefits:
  • Affordable infrastructure: You can run WordPress and the MCP service on a single Lightsail instance, with predictable infrastructure costs.
  • Reuse your existing subscriptions: Content preparation and management take place through your ChatGPT or Claude account, without requiring a separate AI model API subscription for the integration.
  • Controlled publishing: You can create drafts, manage images, translations and SEO information, and perform publishing operations without manually navigating the WordPress administration interface for every change.
  • Infrastructure under your control: Authentication, permissions and publishing operations are managed by your own MCP service rather than a third-party integration platform.
Of course, there are trade-offs. This is a self-hosted solution, so you remain responsible for maintaining the server, securing its access and keeping the components updated. It is also deliberately limited to one owner and one website.
For my particular case, this balance makes sense: I already have the infrastructure and the AI subscription. The missing piece was a controlled integration between them.

OK, let's go! Where can I start?

The repository includes a detailed walkthrough in  docs/zero-to-ninja.md .
Rather than reproducing the complete installation guide here, I will summarise the four main stages and their objectives.
First, you need an AWS account with the necessary permissions, a domain name and a local environment with Terraform, AWS CLI and SSH.
The repository separates deployment code from your private configuration. A possible local structure is:
.
├── lightsail-wp-mcp-public/ # GitHub repository
└── my-site/ # Private deployment files
├── keys/
└── state/
Most of the initial effort consists of preparing the environment files, configuring AWS access and checking that the deployment prerequisites are satisfied. The scripts handle much of the remaining installation work.
The process consists of four main blocks:
1. Prepare the infrastructure
Using Terraform, provision the WordPress instance on AWS Lightsail through  infra/instance .
This provides the server where both WordPress and the MCP service will run. You can also adapt the deployment to an existing WordPress installation.
2. Configure DNS and transactional email
The  infra/dns  stack configures the necessary DNS records in Route 53, including the hostname dedicated to the MCP service. It assumes that you already have a domain and a hosted zone.
The  infra/mail  stack prepares Amazon SES for transactional email delivery, including the necessary domain authentication records.
The goal is to have a publicly accessible website, a dedicated HTTPS endpoint for MCP and an email service for WordPress notifications.
3. Deploy WordPress and the MCP integration
The deployment scripts prepare the server, configure HTTPS, install the required WordPress integration and deploy the MCP service.
You can initialise a fresh WordPress installation or follow the migration procedure for an existing site.
At this point, WordPress remains accessible through its usual interface, while the MCP endpoint provides a separate, controlled entry point for AI assistants.
4. Connect your AI SaaS account
The last step is to register yourself as the owner and configure the clients that will connect to the MCP service.
The repository provides administrative commands to generate the authentication credentials and register ChatGPT or Claude as clients.
Security note: Secrets are displayed only once in your terminal. These operations should be performed manually, not delegated to an AI assistant.
# Connect to the instance and configure the owner account and MFA
ssh -t -i ~/my-site/keys/my-site admin@<ipv4>
sudo wpmcp-admin owner set

# Register each client; credentials are displayed once
sudo wpmcp-admin client add --preset chatgpt
sudo wpmcp-admin client add --preset claude
Once authentication is configured, you can connect the MCP endpoint to your conversational assistant and test the available WordPress operations.
That's it!
The detailed commands, validation steps and troubleshooting instructions are available in the repository.

Some final thoughts

What started as a simple requirement to publish children's book recommendations became an interesting exercise in connecting conversational AI with traditional software.
The objective was never to generate automatic reviews or replace the children's opinions. It was to reduce the effort required to transform those conversations into structured, publishable content.
I think this distinction is important: we don't necessarily need another application or automation platform to benefit from AI. Sometimes, extending the software we already use through a controlled interface is enough.
In this case, MCP provides that connection, while AWS Lightsail keeps the infrastructure relatively simple and affordable.
The implementation is still an early-stage project, but the code is available for anyone interested in testing, adapting or improving it.
I hope you find it useful, and I would be happy to hear about other approaches or experiences with similar integrations.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article