Part 2 of our series on AI integrations with Liferay. Part 1 explained what MCP is and why it matters. Today it gets concrete.
In the first part, we laid the foundation: what MCP is, how the Liferay MCP server works in principle, and why it is more than a demo feature. If you haven't read it yet, you should catch up briefly — the following article assumes this basic understanding.
Now it gets practical. This tutorial shows step by step how to connect Cursor to the Liferay MCP server and create a new web content article directly from the chat. No poring over APIs, no assembling tokens — just a natural-language request and an entry that appears in Liferay.
What you need
Before you start, three prerequisites:
- Liferay DXP (running instance, reachable at
localhost:8080or another URL) - Feature flag LPD-63311 enabled (more on that in a moment)
- Cursor installed — free at cursor.com
For this tutorial, we use localhost:8080 as the Liferay URL. If you use a different environment, adjust the URL in the configuration steps accordingly.
Step 1: Enable the feature flag in Liferay
The Liferay MCP server is currently in beta and has to be enabled explicitly.
In the Liferay admin area:
- Open Control Panel → Instance Settings → Feature Flags
- Switch to the Beta tab
- Search for
LPD-63311— the entry is called “MCP Server” - Set the toggle to active
- Save
From this moment on, the MCP endpoint is reachable at /o/mcp. No restart required.
Quick test in the browser: Open http://localhost:8080/o/mcp in your browser. You will get an error message due to missing authentication — that is correct and shows that the endpoint is active.
Step 2: Generate the Authorization header
The Liferay MCP server uses HTTP Basic Auth. For this, the user name and password have to be base64-encoded.
In the terminal:
echo -n "admin@liferay.com:deinPasswort" | base64
The result looks roughly like this:
YWRtaW5AbGlmZXJheS5jb206ZGVpblBhc3N3b3Jk
You will need this value shortly for the Cursor configuration. Replace admin@liferay.com and deinPasswort with your actual credentials.
Windows users can use PowerShell instead:
[Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("admin@liferay.com:deinPasswort"))
Step 3: Configure Cursor
Cursor reads its MCP server configuration from a JSON file. Open this file in a text editor:
- macOS / Linux:
~/.cursor/mcp.json - Windows:
C:\Users\DeinName\.cursor\mcp.json
If the file does not exist yet, simply create it.
Content of the file:
{
"mcpServers": {
"liferay": {
"type": "http",
"url": "http://localhost:8080/o/mcp",
"headers": {
"Authorization": "Basic YWRtaW5AbGlmZXJheS5jb206ZGVpblBhc3N3b3Jk",
"Content-Type": "application/json"
}
}
}
}
Replace the Base64 string after Basic with the value from step 2. Then restart Cursor — the MCP configuration is read at startup.
Step 4: Check the connection
After the restart, Cursor shows which MCP servers are connected and which tools are available.
How to check:
- Open the chat in Cursor (
Cmd+Lon macOS,Ctrl+Lon Windows) - Click the tool icon in the chat area — there you can see all available MCP servers
- Liferay should appear as “connected” with a green dot
- Clicking the entry shows the available tools — including tools for reading and writing web content
If the status shows “Error”, the most common causes are: a wrong Base64 string, a wrong URL, or the feature flag has not been saved yet.
Step 5: Create web content — the first request
Open the Cursor chat and type:
“On the Liferay website 'Guest', create a new Basic Web Content. Title: 'Welcome to our platform'. Content: 'We are delighted to welcome you to our new website. Here you will find all the important information about our products and services.'”
What happens in the background:
- Resource call: query sites. The model determines the site ID of the “Guest” website.
- Resource call: query content structures. The model retrieves the fields and layout of “Basic Web Content”.
- Tool call: create web content. Using the site ID, structure ID and your content, the API call is assembled and executed.
- Confirmation. Cursor shows the title and ID of the newly created content.
Check the result in Liferay: Open Site Administration → Content & Data → Web Content. The new entry “Welcome to our platform” appears in the list.
Step 6: What else you can do directly in the chat
An overview of further actions that work right away:
Read existing web content:
“Show me all web content on the Guest website.”
Update an entry:
“Change the content of the web content 'Welcome to our platform' — replace the second sentence with: 'Our support team is available to you on weekdays from 9 a.m. to 5 p.m.'”
Search for content:
“Are there any web content entries on the Guest website that contain the word 'Contact' in the title?”
In each case, the model handles the translation between your intention and the API call. You don't need to know any IDs or look up any endpoints.
Security note for production use
What works for the tutorial with an admin account should be set up differently in production. The MCP server inherits the permissions of the authenticated user — dedicated service accounts with minimal rights are the right way to go. Every MCP tool call appears in the Liferay audit log and is therefore fully traceable.
Conclusion
Enable the feature flag, create a JSON file, restart Cursor — those are the three steps to the first working connection. What comes after that is the really interesting part: a platform whose entire headless API layer can be addressed in natural language. Web content is the easiest entry point — the same connection gives access to objects, structures, assets and more.
If you have a running Liferay instance: the test is worth it, and it takes less than an hour.



