For the complete documentation index, see llms.txt.

Codex

Last updated View as Markdown

Register the Contentsquare MCP server with Codex CLI, then ask about your Contentsquare data without leaving the terminal.

  • 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
  1. Run the following command. It adds the server to your ~/.codex/config.toml file.

    Terminal window
    codex mcp add contentsquare --url https://api.contentsquare.com/mcp
  2. Alternatively, add the following configuration to ~/.codex/config.toml:

    ~/.codex/config.toml
    [mcp_servers.contentsquare]
    url = "https://api.contentsquare.com/mcp"
  3. Run the following command to sign in. Codex opens your browser.

    Terminal window
    codex mcp login contentsquare
  4. In the popup, grant Codex access to Contentsquare. Sign in if asked and select the account you want to connect.

  5. Choose to grant access to your entire account or select specific projects, then click Allow.

  6. When the browser says you can return to the terminal, you're connected.

Run the following command:

Terminal window
codex mcp list

The 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.

ProblemSolution
Sign-in fails right away with an "authorization endpoint origin does not match" errorUpdate 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 openCopy 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 errorYour sign-in expired or wasn't completed. Run codex mcp login contentsquare again.
The consent page loads, but approving gives an errorCheck that your Contentsquare user can open the same projects in the web app, then try again.
Codex works, but a project is missingThe 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 server

Run the following commands:

Terminal window
codex mcp logout contentsquare
codex mcp remove contentsquare

Once 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.