AgentKit by OpenAI
AgentKit by OpenAI allows developers to deploy AI agents to websites. This guide shows you how to connect OpenAI’s AgentKit to your WordPress site. This integration uses your site’s Smart Search content via a Model Context Protocol (MCP) server, allowing you to deploy a powerful, no-code AI chatbot that can answer user questions based on your website’s specific content.
Prerequisites
Before you begin, you must have the following set up:
- WP Engine AI Toolkit: The plugin must be installed and activated on your WordPress site. The plugin gets automatically installed when you purchase our Smart Search AI product and enable it for an environment.
- Smart Search Enabled: You must have Smart Search active and your site’s content indexed. You can check this under WP Engine AI Toolkit > Smart Search, in the WP Engine AI Toolkit plugin.
- AI Toolkit MCP Server (Beta): This is the most critical prerequisite. The MCP server is a Beta feature.
- You must contact your WP Engine account manager to be added to the beta and have the MCP server enabled for your account.
- You can find more information about the MCP server here.
- OpenAI Account & API Key:
- You need an active OpenAI account.
- You must generate an API key. This key needs to be added to your WordPress admin under WP Engine AI Toolkit > ChatKit > OpenAI API Key.
- Domain Allowlisting (Important): You may need to add your site’s domain to your OpenAI organization’s security settings. This tells OpenAI it’s a trusted domain.
- Go to: https://platform.openai.com/settings/organization/security/domain-allowlist
- Add the domain of your site (e.g., decodesearch.wpenginepowered.com or your-live-domain.com).
Important Note on Privacy & PII
Do not input any Personally Identifiable Information (PII) into the agent’s instructions or your site’s content for this tool, as this puts both you and your customers at risk. You can learn more about how OpenAI uses data and manage your privacy controls via these links:
How your data is used:
https://help.openai.com/en/articles/5722486-how-your-data-is-used-to-improve-model-performance
Take control of your data:
https://privacy.openai.com/policies?modal=take-control
Setup Guide: 4-Step Configuration
Follow these steps to connect your agent to your site.
Step 1: Get Your MCP Server URL
First, you need to get the unique URL for your site’s MCP server.
- In your WordPress admin dashboard, navigate to WP Engine AI Toolkit > Smart Search.
- Click the Plugin Credentials tab.
- Copy the URL field. Keep this on your clipboard; you’ll need it in the next step.
Step 2: Create Your OpenAI Agent Workflow
Next, you’ll build the agent in the OpenAI platform and connect it to your site’s content.
- Go to the OpenAI Agent Builder at platform.openai.com/agent-builder.
- Click Create and select New workflow.
- You will see a simple workflow with a Start node and a My agent node.
- On the My agent node, click the + (Tools) icon on the right side.
- From the “Add MCP server” list, select + Server.
- A “Connect to MCP Server” modal will appear. Fill it out as follows:
- URL: Paste the URL you copied from Step 1.
IMPORTANT: You must modify this URL. Find and delete /graphql from the end of the URL and replace it with /mcp.
Example:
Before: https://my-site.wpengine.a.run.app/graphql
After: https://my-site.wpengine.a.run.app/mcp - Label & Description: Give your server a recognizable name (e.g., “My Site’s Content” or “Movies and TV Show MCP”).
- Authentication: Select None. (Your MCP server is designed to serve your site’s public, vectorized data).
- Click Connect.
- URL: Paste the URL you copied from Step 1.
- After a successful connection, you will see the available tools (e.g., fetch and search). Ensure both are checked and click Add.
- Click on the My agent node again to open its settings. In the Instructions field, you must tell the agent how to use this new tool.
- Example Prompt: You are a helpful assistant, and you know everything about the TV Shows and Movies on my website via the MCP server. Use this knowledge to answer user questions.
IMPORTANT: This prompt will allow you to place “guardrails” on your agent — this is the place to specify what you do and do not want this agent to do, specify, tone, etc.
There is also a “Guardrails” node in Agent Kit that will allow you to go even further!
- Example Prompt: You are a helpful assistant, and you know everything about the TV Shows and Movies on my website via the MCP server. Use this knowledge to answer user questions.
Step 3: Publish the Agent & Get the Workflow ID
Now that the agent is built, you need to publish it and get the ID to link it back to WordPress.
- In the Agent Builder interface, click the Publish button in the top-right corner.
- Give your workflow a name (e.g., “Site Chatbot”) and click Publish.
- A modal will appear with your Workflow ID. Click the copy icon to copy this ID to your clipboard.
Step 4: Configure ChatKit in WordPress
Finally, go back to your WordPress admin to activate the chatbot on your site.
- Navigate to WP Engine AI Toolkit > ChatKit.
- You should see two fields under “API Configuration”:
- OpenAI API Key: Ensure your main OpenAI key (from the prerequisites) is pasted here.
- Workflow ID: Paste the Workflow ID you just copied from Step 3 into this field.
- Scroll down to Display Settings.
- Check the box for Enable ChatKit on this site.
- Check the box for Show floating chat button (FAB).
- Click Save Configuration.
Test Your Chatbot
That’s it! Visit the front end of your website. You should now see a chat icon in the bottom-right corner.
Click the icon and ask a question related to your site’s content (e.g., “Show me some good horror TV shows, but not too scary”). The agent will use its search tool (connected to your site’s data via MCP) to find the answer and respond in the chat window. Model Context Protocol (MCP) server, allowing you to deploy a powerful, no-code AI chatbot that can answer user questions based on your website’s specific content.
Next steps: Learn about WP Engine’s AI Toolkit