Integrate the Matomo MCP Server with OpenAI Desktop App and Codex CLI
Before you start
This guide explains how to connect Matomo to the OpenAI desktop app and Codex CLI. To use the ChatGPT web version, see the guide on integrating with ChatGPT Web.
- Ensure the Matomo MCP server is enabled.
- For Matomo On-Premise, install and activate the MCP server plugin.
- You will need access to the OpenAI desktop app or Codex CLI.
- Note your Matomo MCP endpoint URL found in the MCP settings.
- Generate a Matomo API token; or
- You can use OAuth 2.0 to create access tokens. For Matomo On-Premise, this requires installing and activating the OAuth 2.0 plugin.
Integrate with OpenAI desktop app
Connect the desktop app to the Matomo MCP Server by adding the server details to its config.toml configuration file.
- Open the desktop app and go to Settings > Configuration.
- Select Codex and click Open config.toml. If the file does not exist, create it and save it in the required folder.
- You can use either the user-level configuration file at
~/.codex/config.tomlor a project-level configuration file at.codex/config.toml. - Add the following configuration and replace
YOUR_MCP_URLwith your Matomo MCP endpoint, andYOUR_API_TOKENwith your Matomo API token.
[mcp_servers.analytics]
url = "YOUR MCP URL"
http_headers = { "Authorization" = "Bearer YOUR_API_TOKEN" }
The desktop app must be restarted so the new MCP configuration is loaded. After the restart, open a session and ask a question about your Matomo analytics data.
If the MCP server is configured correctly, the desktop app should be able to access the available analytics tools through the Matomo MCP.
Integrate with OpenAI Codex CLI
Codex CLI lets you work with Codex directly from your terminal. It uses the Codex configuration file to store MCP Server settings.
- Use a terminal or command-line application and start Codex CLI by running:
codex - Open the Codex configuration file at
~/.codex/config.toml. If the file does not exist, create it. - Add the following configuration and replace
YOUR_MCP_URLwith your Matomo MCP endpoint, andYOUR_API_TOKENwith your Matomo API token.
[mcp_servers.analytics]
url = "YOUR MCP URL"
http_headers = { "Authorization" = "Bearer YOUR_API_TOKEN" }
After updating the configuration file, restart the Codex CLI so the changes take effect.
To temporarily disable the MCP server without removing the configuration, add the following setting to the MCP server configuration: enabled = false.