{"id":2938,"date":"2026-09-01T08:43:36","date_gmt":"2026-09-01T08:43:36","guid":{"rendered":"https:\/\/kb.shortpixel.com\/?post_type=docs&#038;p=2938"},"modified":"2026-09-07T10:54:32","modified_gmt":"2026-09-07T10:54:32","password":"","slug":"connect-shortpixel-with-openai-codex-via-mcp","status":"publish","type":"docs","link":"https:\/\/kb.shortpixel.com\/knowledge-base\/article\/connect-shortpixel-with-openai-codex-via-mcp\/","title":{"rendered":"Connect ShortPixel with OpenAI Codex via MCP"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This guide shows you how to connect <strong>ShortPixel Image Optimizer<\/strong> to <strong>Codex<\/strong> using the Model Context Protocol (MCP). Once connected, Codex can check your ShortPixel optimization status, manage image optimization, work with AI Image SEO, and access other ShortPixel abilities directly from your WordPress site.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before continuing, complete the <strong>Prepare WordPress<\/strong> section of the main ShortPixel MCP guide.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should have the following information ready:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Your WordPress site URL<\/li>\n\n\n\n<li>Your WordPress username<\/li>\n\n\n\n<li>Your WordPress Application Password<\/li>\n\n\n\n<li>Your MCP endpoint:<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/YOUR-SITE\/wp-json\/mcp\/mcp-adapter-default-server\">https:\/\/YOUR-SITE\/wp-json\/mcp\/mcp-adapter-default-server<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before you begin, make sure you have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <strong>ChatGPT desktop app with Codex<\/strong> installed<\/li>\n\n\n\n<li>An OpenAI account with access to Codex<\/li>\n\n\n\n<li><strong>Node.js<\/strong> installed (<code>npx<\/code> is required to run the STDIO MCP server)<\/li>\n\n\n\n<li><strong>ShortPixel Image Optimizer<\/strong> verson 6.6.0 or newer, active on your WordPress site<\/li>\n\n\n\n<li>The <strong>WP MCP Adapter<\/strong> active on your WordPress site<\/li>\n\n\n\n<li>A WordPress Application Password for the user Codex will connect as<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Important:<\/strong> Treat your WordPress Application Password like any other password. Do not share it publicly or include it in screenshots.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1 \u2014 Add a new MCP server<\/h2>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Open the <strong>ChatGPT desktop app<\/strong> and switch to <strong>Codex<\/strong>.<\/li>\n\n\n\n<li>Open <strong>Settings \u2192 MCP servers<\/strong>.<\/li>\n\n\n\n<li>Click <strong>Add server<\/strong>.<\/li>\n\n\n\n<li>Choose <strong>STDIO<\/strong> as the server type.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Screenshot suggestion:<\/strong> Show the MCP servers screen with <strong>Add server<\/strong> and <strong>STDIO<\/strong> highlighted.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2 \u2014 Configure the WordPress MCP bridge<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Enter the following values:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Field<\/th><th>Value<\/th><\/tr><tr><td><strong>Name<\/strong><\/td><td><code>shortpixel-wordpress<\/code> or your site domain<\/td><\/tr><tr><td><strong>Command<\/strong><\/td><td><code>npx<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Arguments<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Add the following arguments separately, one per line if the interface supports it:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>-y<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>@automattic\/mcp-wordpress-remote@latest<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Environment variables<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Add these environment variables:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>Variable<\/td><td>Value<\/td><\/tr><tr><td><code>WP_API_URL<\/code><\/td><td><code>https:\/\/YOUR-SITE\/wp-json\/mcp\/mcp-adapter-default-server<\/code><\/td><\/tr><tr><td><code>WP_API_USERNAME<\/code><\/td><td>Your WordPress username<\/td><\/tr><tr><td><code>WP_API_PASSWORD<\/code><\/td><td>Your WordPress Application Password<\/td><\/tr><tr><td><code>OAUTH_ENABLED<\/code><\/td><td><code>false<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Replace <code>YOUR-SITE<\/code> with your actual domain.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/example.com\/wp-json\/mcp\/mcp-adapter-default-server\" rel=\"noopener\">https:\/\/example.com\/wp-json\/mcp\/mcp-adapter-default-server<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If WordPress is installed in a subdirectory, make sure that path is included in the URL.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Screenshot suggestion:<\/strong> Show a completed <strong>Add server<\/strong> form. Blur or hide the value of <code>WP_API_PASSWORD<\/code>, and make sure <code>OAUTH_ENABLED=false<\/code> is visible.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3 \u2014 Save the MCP server<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Review the configuration and click <strong>Save<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you already use other MCP servers, you do not need to replace or modify them. Add the ShortPixel WordPress server alongside your existing servers.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4 \u2014 Restart the MCP server<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After saving:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Return to the <strong>MCP servers<\/strong> list.<\/li>\n\n\n\n<li>Confirm that <code>shortpixel-wordpress<\/code> \u2014 or the name you chose \u2014 appears in the list.<\/li>\n\n\n\n<li>Click <strong>Restart<\/strong> to reload the MCP configuration.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Screenshot suggestion:<\/strong> Show the ShortPixel\/WordPress MCP server in the server list after it has been restarted successfully.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5 \u2014 Verify the connection<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once the MCP server is running, close Settings and start a new Codex chat.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ask:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>What ShortPixel abilities are available on my WordPress site?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the connection is working, Codex should discover ShortPixel tools such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>shortpixel\/get-stats<\/code><\/li>\n\n\n\n<li><code>shortpixel\/get-quota<\/code><\/li>\n\n\n\n<li><code>shortpixel\/optimize-media<\/code><\/li>\n\n\n\n<li><code>shortpixel\/generate-ai-seo<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">You can then try a real ShortPixel request, for example:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Show my ShortPixel quota and tell me how many images are still unoptimized.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Codex should query your WordPress site and return the current information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can also type:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>\/mcp<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">to view the MCP servers currently connected to Codex.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Screenshot suggestion:<\/strong> Show a Codex response listing the available ShortPixel abilities or displaying a successful ShortPixel quota summary.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Windows note<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If Codex reports that <code>npx<\/code> cannot be found, install the latest <strong>Node.js LTS<\/strong> version and then restart the ChatGPT desktop app.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After installing Node.js, try the MCP connection again.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can verify that Node.js and <code>npx<\/code> are available by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>node --version<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">and:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>npx --version<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">in Command Prompt or PowerShell.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Next steps<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Your ShortPixel MCP connection is now ready.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can use natural-language prompts to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Check image optimization statistics<\/li>\n\n\n\n<li>View your ShortPixel credit balance<\/li>\n\n\n\n<li>Optimize or restore individual images<\/li>\n\n\n\n<li>Start bulk optimization jobs<\/li>\n\n\n\n<li>Monitor processing queues<\/li>\n\n\n\n<li>Generate AI Image SEO metadata<\/li>\n\n\n\n<li>Review or update supported ShortPixel settings<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For examples of what you can ask Codex to do, continue to the <strong><a href=\"https:\/\/shortpixel.com\/knowledge-base\/article\/shortpixel-ai-assistants-mcp\/\" rel=\"noopener\">Get started \u2014 example prompts<\/a><\/strong> section of the main ShortPixel MCP guide.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide shows you how to connect ShortPixel Image Optimizer to Codex using the Model Context Protocol (MCP). Once connected, Codex can check your ShortPixel optimization status, manage image optimization, work with AI Image SEO, and access other ShortPixel abilities directly from your WordPress site. Before continuing, complete the Prepare WordPress section of the main [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[64],"glossaries":[],"doc_tag":[],"class_list":["post-2938","docs","type-docs","status-publish","hentry","doc_category-mcp"],"blocksy_meta":[],"year_month":"2026-09","word_count":647,"total_views":"15","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"admin","author_nicename":"admin_mdli53m5","author_url":"https:\/\/kb.shortpixel.com\/author\/admin_mdli53m5\/"},"doc_category_info":[{"term_name":"MCP","term_url":"https:\/\/kb.shortpixel.com\/knowledge-base\/category\/mcp\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/2938","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/comments?post=2938"}],"version-history":[{"count":5,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/2938\/revisions"}],"predecessor-version":[{"id":2980,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/2938\/revisions\/2980"}],"wp:attachment":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/media?parent=2938"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_category?post=2938"},{"taxonomy":"glossaries","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/glossaries?post=2938"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_tag?post=2938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}