Codex
Register the Contentsquare MCP server with Codex CLI, then ask about your Contentsquare data without leaving the terminal.
Before you start
Section titled Before you start- You have a Contentsquare user account that can access the projects you want to query.
- You have installed Codex CLI and signed in to your OpenAI account. To install it, run
npm install -g @openai/codex. This guide was tested with Codex CLI 0.163.0. If sign-in fails on an older release, update Codex CLI first. - You have a browser on the same machine. The sign-in redirects to a local address that Codex opens for a few seconds.
Add the Contentsquare MCP server
Section titled Add the Contentsquare MCP server-
Run the following command. It adds the server to your
~/.codex/config.tomlfile.Terminal window codex mcp add contentsquare --url https://api.contentsquare.com/mcp -
Alternatively, add the following configuration to
~/.codex/config.toml:~/.codex/config.toml [mcp_servers.contentsquare]url = "https://api.contentsquare.com/mcp" -
Run the following command to sign in. Codex opens your browser.
Terminal window codex mcp login contentsquare -
In the popup, grant Codex access to Contentsquare. Sign in if asked and select the account you want to connect.
-
Choose to grant access to your entire account or select specific projects, then click Allow.
-
When the browser says you can return to the terminal, you're connected.
Check the connection
Section titled Check the connectionRun the following command:
codex mcp listThe contentsquare row shows enabled, with OAuth under Auth. In a Codex session, you can also type /mcp to see the server and its tools.
Start codex and ask a question such as "List all the projects" or "Compare visits and returning visits for my web project". The first tool call can ask for approval. Approve it once, or choose the option that remembers your choice for that tool.
Troubleshoot the connection
Section titled Troubleshoot the connection| Problem | Solution |
|---|---|
| Sign-in fails right away with an "authorization endpoint origin does not match" error | Update Codex CLI to the latest release and run codex mcp login contentsquare again. If it still fails, contact Contentsquare support with the output of codex --version and the full error. |
| The browser doesn't open | Copy the URL that Codex prints in the terminal into a browser on the same machine. |
| The status shows enabled but Auth isn't OAuth, or tools return a 401 error | Your sign-in expired or wasn't completed. Run codex mcp login contentsquare again. |
| The consent page loads, but approving gives an error | Check that your Contentsquare user can open the same projects in the web app, then try again. |
| Codex works, but a project is missing | The server only returns projects your Contentsquare user can access. Ask a Customer Admin to grant you access. |
Remove the Contentsquare MCP server
Section titled Remove the Contentsquare MCP serverRun the following commands:
codex mcp logout contentsquarecodex mcp remove contentsquareNext steps
Section titled Next stepsOnce connected, ask your AI client a question such as "Which projects do you have access to?" to check the connection. See the MCP overview for the other supported clients.